0% found this document useful (0 votes)
38 views6 pages

Trading API - Market Feed

The document outlines the Trading API, detailing its functionalities such as market feeds, order management, and error handling. It includes specifications for authorization, request and response formats, and example code for fetching market data. Additionally, it emphasizes the importance of investor security and compliance with regulatory standards.

Uploaded by

doshi.album1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views6 pages

Trading API - Market Feed

The document outlines the Trading API, detailing its functionalities such as market feeds, order management, and error handling. It includes specifications for authorization, request and response formats, and example code for fetching market data. Additionally, it emphasizes the importance of investor security and compliance with regulatory standards.

Uploaded by

doshi.album1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Trading API

Overview

Authorization

Login +

Market Feeds

Historical Candles

Order +

Report +

Transactions Info +

Error Messages

Fees

API Limits

API Keys

Scrip Master

Example Codes +

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 Header:
Request URL Request Method: POST
Content-Type: application/json
[Link] Request format: JSON Ocp-Apim-Subscription-Key:
to be provided after registration

REQUEST BODY

HEADER
Field Name Description Data Type Validation Sample Value
(max length)

appName App Name provided at the String Cannot be empty. IIFLMarDEMO


time of registration

appVer Developer App Version String Cannot be empty. 1.0

key UserKey generated at the time String Cannot be empty. ABpyyGUh1nsbesSlup3VKURkI4tQDe8y


of registration

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 String Cannot be empty. ZkhghN5uKj


of registration

password Password generated at the time String Cannot be empty. lfjnfS7rHGj


of registration

BODY

Field Name Description Data Type Validation Sample Value


(max length)

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 DateTime Cannot be empty /Date(1576480500000)/


date time

RefreshRate This is the cache refresh time String Cannot be empty H

MARKET FEED NEW

FieldName Type Description value

Exch String N - NSE N


B - BSE

ExchType String C - CASH C


D - Derivative

ScripCode String This is the scrip code 2885

REQUEST:
1 {
2 "head": {
3 "appName": "IIFLMarLOHIO1",
4 "appVer": "1.0",
5 "key": "SgxxuJ8kGknAXypbJkpuHh1gvuafZY1A",
6 "osName": "Android",
7 "requestCode": "IIFLMarRQMarketFeed",
8 "userId": "3RUOAG43zhTA",
9 "password": "HDp43buK54Wc"
10 },
11 "body": {
12 "ClientCode": "Dummy123",
13 "Count": "2",
14 "MarketFeedData": [
15 {
16 "Exch": "N",
17 "ExchType": "C",
18 "ScripCode": "2885"
19 },
20 {
21 "Exch": "N",
22 "ExchType": "C",
23 "ScripCode": "22"
24 }
25 ],
26 "ClientLoginType": "0",
27 "LastRequestTime": "/Date(1576480500000)/",
28 "RefreshRate": "H"
29 }
30 }

RESPONSE BODY

HEADER

Field Name Description Data Type List of Values Sample Value


(max length)

responseCode This is the response code of String - IIFLMarRQLoginForVendor


API

status This is the response code of String 0 0


API 2

statusDescription This is the response code of String 0 - Success Success


API 2 - Invalid head
parameters

responseCode This is the response code of String - IIFLMarRQLoginForVendor


API

BODY
Field Name Description Data Type List Values Sample Value
(max length)

Status Returns the status of the Int -1 = Exception Success


response. 0 = success
1=No Record Found
2- Invalid Input/ head
parameters
9-“Invalid Session”

Message Returns the message of the String “Success” Success


response. “No record found.”
“Invalid input
parameters.”
“Invalid head
parameters.”
“Error while processing
your request.”
“Invalid Session”
"No Order found for this
Client."

CacheTime This is the cache refresh time Integer -

TimeStamp This is the epoch time Date Date

Data Array list of Array list of


MarketFeedNewWatch MarketFeedNewWatch

MARKET FEED NEW WATCH:

Field Name Type Description Value

Exch Char N - NSE N


B - BSE

ExchType Char C - Cash N


D - Derivative

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 6676009


scrip
Success Response

1 {
2 "head": {
3 "responseCode": "IIFLMarRPMarketFeed",
4 "status": "0",
5 "statusDescription": "Success"
6 },
7 "body": {
8 "CacheTime": 2,
9 "Data": [
10 {
11 "Exch": "N",
12 "ExchType": "C",
13 "High": 2157,
14 "LastRate": 2134.95,
15 "Low": 2120.2,
16 "Message": "",
17 "PClose": 2134.1,
18 "Status": 0,
19 "TickDt": "/Date(1596778587000+0530)/",
20 "Time": 18387,
21 "Token": 2885,
22 "TotalQty": 6676009
23 },
24 {
25 "Exch": "N",
26 "ExchType": "C",
27 "High": 1423.05,
28 "LastRate": 1404,
29 "Low": 1400.45,
30 "Message": "",
31 "PClose": 1406.2,
32 "Status": 0,
33 "TickDt": "/Date(1596778588000+0530)/",
34 "Time": 18388,
35 "Token": 22,
36 "TotalQty": 293409
37 }
38 ],
39 "Message": "",
40 "Status": 0,
41 "TimeStamp": "/Date(1596778588000+0530)/"
42 }
43 }

Failure Response
1 {
2 "head": {
3 "responseCode": "IIFLMarRQMarketFeed",
4 "status": "2",
5 "statusDescription": "Success."
6 },
7 "body": {
8 "CacheTime": 0,
9 "Data": [],
10 "Message": "Not getting response from feed server",
11 "Status": 1,
12 "TimeStamp": "/Date(1596782029882+0530)/"
13 }
14 }

ATTENTION INVESTORS - "Prevent Unauthorized Transactions in your demat / trading account --> Update your Mobile Number/ email Id with your stock broker / Depository
Participant. Receive information of your transactions directly from Exchanges on your mobile / email at the end of day and alerts on your registered mobile for all debits and
other important transactions in your demat account directly from NSDL/ CDSL on the same day." - Issued in the interest of investors.

*The content modification rights lie with IIFL Securities and the content can be modified as and when IIFL Securities deem fit in interest of the stakeholders involved.

Copyright © 2020 IIFL Securities Limited All rights Reserved. SEBI REGN NO.:INZ000164132, DEPOSITORY: IN DP NSDL 185 2000, IN DP CDSL 352 2006 | AMFI REGN NO.: ARN-
47791, India Infoline Commodities Limited: NCDEX: NCDEX-CO-04-00378 & MCX:10470

We are ISO 27001:2013 Certified.


This certificate demonstrates that IIFL as an organization has defined and put in place best-practice information security processes.

You might also like