Market Feed


PURPOSE


This API is used to fetch the market feed of a particular scrip or a set of scrips. Like other APIs this work only with active session and you need to be successfully logged in to consume this API. The input parameters include Client code, Count of the requested scrips, Client Login type, refresh rate, Last Requested Time and Market Feed Request data consisting of Exchange, exchange type and scrip code. The response of the API consists of an array of type MarketFeedNewWatch which has all the details of the requested scrips. The response also consists of status and messages to be delivered as per status of execution of the API.

Request Method: POST

Request format: JSON

Request Header:

Content-Type: application/json

Ocp-Apim-Subscription-Key:
to be provided after registration


REQUEST BODY


HEADER

Field Name Description Data Type
(max length)
Validation Sample Value
appName App Name provided at the time of registration String Cannot be empty. IIFLMarDEMO
appVer Developer App Version String Cannot be empty. 1.0
key UserKey generated at the time of registration String Cannot be empty. ABpyyGUh1nsbesSlup3VKURkI4tQDe8y
osName Channel of order String Cannot be empty. WEB, Android, iOS
requestCode Request Code of the API called String Cannot be empty. IIFLMarRQMarketFeed
userId User ID generated at the time of registration String Cannot be empty. ZkhghN5uKj
password Password generated at the time of registration String Cannot be empty. lfjnfS7rHGj

BODY

Field Name Description Data Type
(max length)
Validation Sample Value
ClientCode Pass the Register client code String Cannot be empty Dummy123
Count This is the count of scrip Long Cannot be empty 2
MarketFeedData Array list of MarketFeedNew Cannot be empty
ClientLoginType Pass the Register client code Integer Cannot be empty 0
LastRequestTime This the epoch conversion date time DateTime Cannot be empty /Date(1576480500000)/
RefreshRate This is the cache refresh time String Cannot be empty H

MARKET FEED NEW

FieldName Type Description value
Exch String N - NSE
B - BSE
N
ExchType String C - CASH
D - Derivative
C
ScripCode String This is the scrip code 2885

REQUEST:

{
  "head": {
    "appName": "IIFLMarLOHIO1",
    "appVer": "1.0",
    "key": "SgxxuJ8kGknAXypbJkpuHh1gvuafZY1A",
    "osName": "Android",
    "requestCode": "IIFLMarRQMarketFeed",
    "userId": "3RUOAG43zhTA",
    "password": "HDp43buK54Wc"
  },
  "body": {
    "ClientCode": "Dummy123",
    "Count": "2",
    "MarketFeedData": [
      {
        "Exch": "N",
        "ExchType": "C",
        "ScripCode": "2885"
      },
      {
        "Exch": "N",
        "ExchType": "C",
        "ScripCode": "22"
      }
    ],
    "ClientLoginType": "0",
    "LastRequestTime": "/Date(1576480500000)/",
    "RefreshRate": "H"
  }
}

RESPONSE BODY


HEADER

Field Name Description Data Type
(max length)
List of Values Sample Value
responseCode This is the response code of API String - IIFLMarRQLoginForVendor
status This is the response code of API String 0
2
0
statusDescription This is the response code of API String 0 - Success
2 - Invalid head parameters
Success
responseCode This is the response code of API String - IIFLMarRQLoginForVendor

BODY

Field Name Description Data Type
(max length)
List Values Sample Value
Status Returns the status of the response. Int -1 = Exception
0 = success
1=No Record Found
2- Invalid Input/ head parameters
9-“Invalid Session”
Success
Message Returns the message of the response. String “Success”
“No record found.”
“Invalid input parameters.”
“Invalid head parameters.”
“Error while processing your request.”
“Invalid Session”
"No Order found for this Client."
Success
CacheTime This is the cache refresh time Integer -
TimeStamp This is the epoch time Date Date
Data Array list of MarketFeedNewWatch Array list of MarketFeedNewWatch

MARKET FEED NEW WATCH:

Field Name Type Description Value
Exch Char N - NSE
B - BSE
N
ExchType Char C - Cash
D - Derivative
N
High Double This is the scrip high rate 2157
LastRate Double This is the scrip last rate 2134.95
Low Double This is the scrip Low rate 2120.2
Message String Message of list “ ”
PClose Double Scrip Name of the scrip. 2134.1
Status Integer Given status of list 0
TickDt Date This date of tick /Date(1596778587000+0530)/
Time Integer This is the time 18387
Token UInt32 This is the scrip code 2885
TotalQty UInt32 This is the total quantity of scrip 6676009

Success Response

{
  "head": {
    "responseCode": "IIFLMarRPMarketFeed",
    "status": "0",
    "statusDescription": "Success"
  },
  "body": {
    "CacheTime": 2,
    "Data": [
      {
        "Exch": "N",
        "ExchType": "C",
        "High": 2157,
        "LastRate": 2134.95,
        "Low": 2120.2,
        "Message": "",
        "PClose": 2134.1,
        "Status": 0,
        "TickDt": "/Date(1596778587000+0530)/",
        "Time": 18387,
        "Token": 2885,
        "TotalQty": 6676009
      },
      {
        "Exch": "N",
        "ExchType": "C",
        "High": 1423.05,
        "LastRate": 1404,
        "Low": 1400.45,
        "Message": "",
        "PClose": 1406.2,
        "Status": 0,
        "TickDt": "/Date(1596778588000+0530)/",
        "Time": 18388,
        "Token": 22,
        "TotalQty": 293409
      }
    ],
    "Message": "",
    "Status": 0,
    "TimeStamp": "/Date(1596778588000+0530)/"
  }
}

Failure Response

{
  "head": {
    "responseCode": "IIFLMarRQMarketFeed",
    "status": "2",
    "statusDescription": "Success."
  },
  "body": {
    "CacheTime": 0,
    "Data": [],
    "Message": "Not getting response from feed server",
    "Status": 1,
    "TimeStamp": "/Date(1596782029882+0530)/"
  }
}