Doc Fundamentals
Funds Management
Order Management
Portfolio Management
User Authentication
Market Feed
Daily API Calls
Success Rate
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.
https://Openapi.5paisa.com/VendorsAPI/Service1.svc/V1/MarketFeed
Headers
KEY | VALUE |
---|---|
Content-Type | application/json |
Authorization | bearer {Your Access Token} |
Request body
FIELD NAME | MANDATORY | DESCRIPTION | |
---|---|---|---|
head | keySTRING | Yes | AppKey of User or Partner |
body | ClientCodeSTRING | Yes | 5paisa demat account client code of the user. |
MarketFeedDataARRAY | 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 NAME | MANDATORY | DESCRIPTION |
---|---|---|
ExchSTRING | Yes | This is the exchange of the instrument.N: NSE |
ExchTypeSTRING | Yes | It specifies the exchange segment of the instrument.C: Cash |
ScripCodeSTRING | Optional | This is the unique code for the instrument. Can be skipped or passed as 0 if ScripData is to be used. |
ScripDataSTRING | Optional | This is the unique Scrip Data for the instrument. Can be skipped or passed as Blank("") if ScripCode is to be used. |
{
"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 NAME | VALUES | DESCRIPTION | |
---|---|---|---|
head | responseCodeSTRING | 5PMFV1 | This is the unique response code for the API. |
statusSTRING | 0: Success2: Invalid head parameters.
| This is the status code which depicts the status of API request to the server. | |
statusDescriptionSTRING | SuccessInvalid head parameters. | This is the description of the status received from the server for the API request. | |
body | CacheTimeINTEGER | - | It provides total cache time for the tick data. |
DataARRAY | - | It provides the OHLC and volume data for the requested scrips. | |
MessageSTRING | - | This is the description of | |
StatusINTEGER | - | This is the numeric code | |
TimeStampDATETIME | - | This is the time stamp of the tick data. |
Data
FIELD NAME | VALUES | DESCRIPTION |
---|---|---|
ChgDOUBLE | - | This is Points change between Previous Close and LTP. |
ChgPcntDOUBLE | - | This is Percentage change between Previous Close and LTP. |
ExchSTRING | N: NSE | This is the exchange of the instrument. |
ExchTypeSTRING | C: Cash | This specifies the exchange segment of the instrument. |
HighDOUBLE | - | This is the high rate for the day of the instrument. |
LastRateDOUBLE | - | This is the last rate for the instrument. |
LowDOUBLE | - | It provides the low rate for the day for the instrument. |
MessageSTRING | - | This is the description of |
PCloseDOUBLE | - | This is the previous close rate for the instrument. |
StatusINTEGER | 02 | This is the status of the data request through the API. |
TickDtDATETIME | - | This is the time stamp of the tick data. |
TimeINTEGER | - | - |
TokenINTEGER | - | This is the unique scrip code for the instrument. |
TotalQtyINTEGER | - | This is the total quantity or volume trading on the day. |
{
"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"
}
}
<?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>