Market Feed

POSTJSONRest API
21340

Daily API Calls

100%

Success Rate

96.26ms

Avg. Response Time


This API is used to fetch the market feed of a particular scrip or a set of scrips. 

The response of the API consists of an details like LTP, High, Low, Previous Close of the requested scrips. The response also consists of status and messages to be delivered as per status of execution of the API.

REQUEST URL

https://Openapi.5paisa.com/VendorsAPI/Service1.svc/V1/MarketFeed

Headers

KEYVALUE

Content-Type

application/json

Authorization

bearer {Your Access Token}

Request body

FIELD NAMEMANDATORYDESCRIPTION

head

key

STRING

Yes

AppKey of User or Partner

body

ClientCode

STRING

Yes

5paisa demat account client code of the user.

MarketFeedData

ARRAY

Yes

An array consisting of details (exchange, exchange segment , scrip code or scrip Data) of all the instruments for which live feed is required.

MarketFeedData

FIELD NAMEMANDATORYDESCRIPTION

Exch

STRING

Yes

This is the exchange of the instrument.

N: NSE
B: BSE
M: MCX

ExchType

STRING

Yes

It specifies the exchange segment of the instrument.

C: Cash
D: Derivatives (FnO for NSE, BSE & MCX)
U: Currency Derivatives

ScripCode

STRING

Optional

This is the unique code for the instrument. Can be skipped or passed as 0 if ScripData is to be used.

ScripData

STRING

OptionalThis is the unique Scrip Data for the instrument. Can be skipped or passed as Blank("") if ScripCode is to be used.
SAMPLE REQUEST BODY  :

{
    "head": {
        "key": "{{Your App Key}}"
    },
    "body": {
        "MarketFeedData": [
            {
                "Exch": "N",
                "ExchType": "C",
                "ScripCode": "2885",
                "ScripData": ""
            },
            {
                "Exch": "N",
                "ExchType": "C",
                "ScripData": "ITC_EQ"
            }
        ],
        "LastRequestTime": "/Date(0)/",
        "RefreshRate": "H"
    }
}

Response body

FIELD NAMEVALUESDESCRIPTION

head

responseCode

STRING

5PMFV1

This is the unique response code for the API.

status

STRING

0: Success

2: Invalid head parameters.

 

This is the status code which depicts the status of API request to the server.

statusDescription

STRING

Success

Invalid head parameters.

This is the description of the status received from the server for the API request.

body

CacheTime

INTEGER

-

It provides total cache time for the tick data.

Data

ARRAY

-

It provides the OHLC and volume data for the requested scrips.

Message

STRING

-

This is the description of 
the status of API request

Status

INTEGER

-

This is the numeric code
for the status of API 
request

TimeStamp

DATETIME

-

This is the time stamp of the tick data.

Data

FIELD NAMEVALUESDESCRIPTION

Chg

DOUBLE

-This is Points change between Previous Close and LTP.

ChgPcnt

DOUBLE

-This is Percentage change between Previous Close and LTP.

Exch

STRING

N: NSE
B: BSE
M:MCX

This is the exchange of the instrument.

ExchType

STRING

C: Cash
D: Derivatives (FnO for NSE, BSE & MCX)
U: Currency

 

This specifies the exchange segment of the instrument.

High

DOUBLE

-

This is the high rate for the day of the instrument.

LastRate

DOUBLE

-

This is the last rate for the instrument.

Low

DOUBLE

-

It provides the low rate for the day for the instrument.

Message

STRING

-

This is the description of 
the status of data request

PClose

DOUBLE

-

This is the previous close rate for the instrument.

Status

INTEGER

0

2

This is the status of the data request through the API.

TickDt

DATETIME

-

This is the time stamp of the tick data.

Time

INTEGER

-

-

Token

INTEGER

-

This is the unique scrip code for the instrument.

TotalQty

INTEGER

-

This is the total quantity or volume trading on the day.

 SAMPLE SUCCESS RESPONSE  SAMPLE SUCCESS RESPONSE

{
   "body": {
       "CacheTime": 5,
       "Data": [
           {
               "Chg": 62.1,
               "ChgPcnt": 2.18,
               "Exch": "N",
               "ExchType": "C",
               "High": 2949.8,
               "LastRate": 2915.4,
               "Low": 2866.35,
               "PClose": 2853.3,
               "Symbol": "RELIANCE",
               "TickDt": "/Date(1706956047000+0530)/",
               "Time": 35847,
               "Token": 2885,
               "TotalQty": 0
           },
           {
               "Chg": -2.8,
               "ChgPcnt": -0.63,
               "Exch": "N",
               "ExchType": "C",
               "High": 447.2,
               "LastRate": 440.1,
               "Low": 439.5,
               "PClose": 442.9,
               "Symbol": "ITC",
               "TickDt": "/Date(1706956150000+0530)/",
               "Time": 35950,
               "Token": 1660,
               "TotalQty": 0
           }
       ],
       "Message": "Success",
       "Status": 0,
       "TimeStamp": "/Date(1707038151652+0530)/"
   },
   "head": {
       "responseCode": "5PMFV1",
       "status": "0",
       "statusDescription": "Success"
   }
}

 SAMPLE FAILURE RESPONSE:  Failure when scripCode is passed as blank

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
   <title>Request Error</title>
   <style>BODY { color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top: 0px;
} #content { margin-left: 30px; font-size: .70em; padding-bottom: 2em;
} A:link { color: #336699; font-weight: bold; text-decoration: underline;
} A:visited { color: #6699cc; font-weight: bold; text-decoration: underline;
} A:active { color: #336699; font-weight: bold; text-decoration: underline;
} .heading1 { background-color: #003366; border-bottom: #336699 6px solid; color: #ffffff; font-family: Tahoma; font-size: 26px; font-weight: normal;margin: 0em 0em 10px -20px; padding-bottom: 8px; padding-left: 30px;padding-top: 16px;
} pre { font-size:small; background-color: #e5e5cc; padding: 5px; font-family: Courier New; margin-top: 0px; border: 1px #f0f0e0 solid; white-space: pre-wrap; white-space: -pre-wrap; word-wrap: break-word;
} table { border-collapse: collapse; border-spacing: 0px; font-family: Verdana;
} table th { border-right: 2px white solid; border-bottom: 2px white solid; font-weight: bold; background-color: #cecf9c;
} table td { border-right: 2px white solid; border-bottom: 2px white solid; background-color: #e5e5cc;
}</style>
 </head>
 <body>
   <div id="content">
     <p class="heading1">Request Error</p>
     <p>The server encountered an error processing the request. See server logs for more details.</p>
   </div>
 </body>
</html>

On this Page

Knowledge base

Historical candles docs is the next thing to checkout
Historical Candles API
How to use this API that suits your work flow best
Start using our APIs

Contribute and get rewarded

Help make these Dev Docs great, contribute to the APIs and get rewarded for your contribution

Need Help

Ask Developer Community

Contact Support

 

Changelog

Changes made to our APIs - Changelog

AVENUES