Market Data Feed V3โ
The Market Stream Feed V3 provides real-time market updates, including the latest trading price, close price, open price, and more, through a WebSocket connection. The feed utilizes Protobuf encoding, which requires decoding messages using the provided Market Data V3 Proto file.
With the V3 version, significant enhancements have been introduced, offering improved stability, performance, and reliability for uninterrupted data delivery. This version also includes limitations on connections and subscriptions to ensure a stable and efficient data transmission process. These limitations are designed to optimize performance and maintain consistent feed quality.
To connect to the WebSocket endpoint, use the wss:
protocol. Ensure that your WebSocket client is configured to handle automatic redirection to the authorized endpoint after authentication. For example, in a Node.js client, enabling the followRedirects
setting facilitates seamless handling of redirection.
Once connected, you can subscribe to the required instrumentKeys
by specifying the method and mode based on your needs. Ensure that the subscription request adheres to the V3 format. Incoming data from the feed must be decoded using Protobuf and the provided .proto
file, properly adapted to your programming language for compatibility. The following table lists the defined limits for the feeder, which must be adhered to for uninterrupted data streaming.
Connection and Subscription Limitsโ
Limit Type | Category | Individual Limit | Combined Limit |
---|---|---|---|
Connection | 1 connection per app-user combination | N/A | |
Subscription | LTPC | 5000 instrument keys | 2000 instrument keys |
Option Greeks | 3000 instrument keys | 2000 instrument keys | |
Full | 2000 instrument keys | 1500 instrument keys |
The Individual Limit refers to the maximum number of instrument keys allowed when a user subscribes to a single category. For instance, if a user subscribes only to 'LTPC', they can access up to 5000 instrument keys.
The Combined Limit applies when subscriptions cover multiple categories. For example, if the same user subscribes to both 'LTPC' and 'Option Greeks', the limit for each category is set to 2000 instrument keys. This structure ensures users can efficiently manage multiple data streams within system capacity constraints.
Header Parametersโ
Name | Required | Type | Description |
---|---|---|---|
Authorization | true | string | Requires the format Bearer access_token where access_token is obtained from the Token API. |
Accept | true | string | Defines the content format the client expects, which should be set to */* . |
Request structureโ
{
"guid": "13syxu852ztodyqncwt0",
"method": "sub",
"data": {
"mode": "full",
"instrumentKeys": ["NSE_INDEX|Nifty Bank"]
}
}
The WebSocket request message should be sent in binary format, not as a text message.
Field | Description |
---|---|
guid | Globally unique identifier for the request. |
method | The method for the request. (Refer to the table below for possible values.) |
mode | The mode for the request. (Refer to the table below for possible values.) |
instrumentKeys | Instrument keys for which you want updates. |
Method field valuesโ
Value | Description |
---|---|
sub | Default mode is ltpc unless specified by user. |
change_mode | Instrument key is mandatory. |
unsub | Unsubscribe instrument key/s with further updates. |
Mode field valuesโ
Value | Description |
---|---|
ltpc | Contains only the latest trading price (LTP) and close price (CP) changes. |
option_greeks | Contains only option greeks. |
full | Includes LTPC, 5 market level quotes, extended feed metadata, and option greeks. |
- 302
This API does not provide a typical JSON response. Instead, upon successful authentication, it automatically redirects the client to the appropriate websocket endpoint where market updates can be received in real-time. Users are expected to handle data streams as per the websocket protocol once the redirection is complete.
The feeds are structured to ensure seamless data flow and synchronization.
- The first tick provides the market status, giving the current state of various market segments to ensure synchronization.
- The second tick delivers a snapshot of the current market data, offering the latest available information.
- Subsequent ticks stream live, real-time updates, ensuring clients stay updated with the latest market activity.
Market Statusโ
The market_info
is the first message sent for all feeds. It provides the real-time status of various market segments, ensuring the client is aware of the current trading conditions before streaming data. This helps synchronize the client with active segments and prevents unnecessary data processing for inactive or closed segments.
{
"type": "market_info",
"currentTs": "1732775008661",
"marketInfo": {
"segmentStatus": {
"NSE_COM": "NORMAL_OPEN",
"NCD_FO": "NORMAL_OPEN",
"NSE_FO": "NORMAL_OPEN",
"BSE_EQ": "NORMAL_OPEN",
"BCD_FO": "NORMAL_OPEN",
"BSE_FO": "NORMAL_OPEN",
"NSE_EQ": "NORMAL_OPEN",
"MCX_FO": "NORMAL_OPEN",
"MCX_INDEX": "NORMAL_OPEN",
"NSE_INDEX": "NORMAL_OPEN",
"BSE_INDEX": "NORMAL_OPEN"
}
}
}
Name | Type | Description |
---|---|---|
type | string | Identifies the message type as market_info . |
currentTs | string | Timestamp indicating when the message was generated. |
marketInfo | object | Contains details about the status of various market segments. |
marketInfo.segmentStatus | object | Key-value pairs where the key is the market segment and the value is its current status (e.g., NORMAL_OPEN ). Valid statuses are listed in the Market Status Appendix |
Market Data Snapshotโ
The second tick provides a snapshot of the current market data, presenting the latest state of the market at the time of connection. This ensures the client starts with an accurate and up-to-date view of market conditions. The following is a sample object for LTPC.
{
"feeds": {
"NSE_FO|53023": {
"ltpc": {
"ltp": 60.15,
"ltt": "1732774771650",
"cp": 105.55
}
}
},
"currentTs": "1732774772179"
}
Live Feedโ
- LTPC
- Option Greeks
- Full
{
"type": "live_feed",
"feeds": {
"NSE_FO|53023": {
"ltpc": {
"ltp": 60.05,
"ltt": "1732774772481",
"cp": 105.55
}
}
},
"currentTs": "1732774772584"
}
Name | Type | Description |
---|---|---|
type | string | Present in live feed, indicating the nature of the data. |
feeds | object | Includes updates for instrumentKeys requested. |
ltpc | object | Details of LTP information |
ltpc.ltp | number | Last traded price |
ltpc.ltt | string | Last traded time (Timestamp) |
ltpc.cp | number | Closed price |
feeds.currentTs | number | Timestamp of the received tick |
{
"type": "live_feed",
"feeds": {
"NSE_FO|53023": {
"firstLevelWithGreeks": {
"ltpc": {
"ltp": 61.35,
"ltt": "1732774941631",
"cp": 105.55
},
"firstDepth": {
"bidQ": "300",
"bidP": 61.4,
"askQ": "200",
"askP": 61.55
},
"optionGreeks": {
"delta": 0.2302,
"theta": -9.9036,
"gamma": 0.0007,
"vega": 10.2686,
"rho": 1.077
},
"vtt": "18689200",
"oi": 4780750,
"iv": 0.137939453125
}
}
},
"currentTs": "1732774942705"
}
Name | Type | Description |
---|---|---|
type | string | Present in live feed, indicating the nature of the data. |
feeds | object | Contains updates for the instrument keys requested. |
feeds[InstrumentKey] | object | Data specific to the requested instrument key. |
firstLevelWithGreeks | object | Includes LTP, bid/ask details, and option Greeks for the instrument. |
ltpc | object | Details of the latest trading price (LTP), last traded time (LTT), and CP. |
ltpc.ltp | number | Last traded price of the instrument. |
ltpc.ltt | string | Last traded time (timestamp). |
ltpc.cp | number | Close price of the instrument. |
firstDepth | object | Details of the first-level market depth (bid/ask). |
firstDepth.bidQ | string | Quantity available at the best bid price. |
firstDepth.bidP | number | Best bid price. |
firstDepth.askQ | string | Quantity available at the best ask price. |
firstDepth.askP | number | Best ask price. |
optionGreeks | object | Includes Greeks data (e.g., delta, gamma) for the instrument. |
optionGreeks.delta | number | Sensitivity of the option's price to changes in the underlying asset's price. |
optionGreeks.theta | number | Rate of decline in the option's value due to the passage of time. |
optionGreeks.gamma | number | Rate of change of delta with respect to changes in the underlying asset's price. |
optionGreeks.vega | number | Sensitivity of the option's price to changes in volatility. |
optionGreeks.rho | number | Sensitivity of the option's price to changes in interest rates. |
vtt | string | Volume traded today (in contracts). |
oi | number | Open interest for the instrument. |
currentTs | string | Timestamp of the current tick received. |
{
"type": "live_feed",
"feeds": {
"NSE_FO|53023": {
"fullFeed": {
"marketFF": {
"ltpc": {
"ltp": 61.35,
"ltt": "1732775009472",
"cp": 105.55
},
"marketLevel": {
"bidAskQuote": [
{
"bidQ": "400",
"bidP": 61.15,
"askQ": "175",
"askP": 61.4
},
{
"bidQ": "1200",
"bidP": 61.1,
"askQ": "1025",
"askP": 61.45
},
{
"bidQ": "1675",
"bidP": 61.05,
"askQ": "1075",
"askP": 61.5
},
{
"bidQ": "1800",
"bidP": 61,
"askQ": "875",
"askP": 61.55
},
{
"bidQ": "700",
"bidP": 60.95,
"askQ": "1075",
"askP": 61.6
}
]
},
"optionGreeks": {
"delta": 0.2242,
"theta": -9.8289,
"gamma": 0.0006,
"vega": 10.1118,
"rho": 1.0484
},
"marketOHLC": {
"ohlc": [
{
"interval": "1d",
"open": 90.55,
"high": 129,
"low": 52.05,
"close": 61.35,
"ts": "1732732200000"
}
]
},
"atp": 81.44,
"vtt": "18750475",
"oi": 4780750,
"iv": 0.139007568359375,
"tbq": 261350,
"tsq": 859375
}
}
}
},
"currentTs": "1732775009745"
}
Name | Type | Description |
---|---|---|
type | string | Present in live feed, indicating the nature of the data. |
feeds | object | Contains updates for the instrument keys requested. |
feeds[InstrumentKey] | object | Data specific to the requested instrument key. |
fullFeed | object | Includes full market feed details for the instrument. |
marketFF | object | Contains detailed market-level data. |
ltpc | object | Details of the latest trading price (LTP), last traded time (LTT), and close price. |
ltpc.ltp | number | Last traded price of the instrument. |
ltpc.ltt | string | Last traded time (timestamp). |
ltpc.cp | number | Close price of the instrument. |
marketLevel | object | Contains multiple levels of market bid/ask quotes. |
marketLevel.bidAskQuote | array | List of bid and ask quotes at various market levels. |
bidAskQuote[n].bidQ | string | Quantity available at the nth best bid price. |
bidAskQuote[n].bidP | number | nth best bid price. |
bidAskQuote[n].askQ | string | Quantity available at the nth best ask price. |
bidAskQuote[n].askP | number | nth best ask price. |
optionGreeks | object | Includes Greeks data (e.g., delta, gamma) for the instrument. |
optionGreeks.delta | number | Sensitivity of the option's price to changes in the underlying asset's price. |
optionGreeks.theta | number | Rate of decline in the option's value due to the passage of time. |
optionGreeks.gamma | number | Rate of change of delta with respect to changes in the underlying asset's price. |
optionGreeks.vega | number | Sensitivity of the option's price to changes in volatility. |
optionGreeks.rho | number | Sensitivity of the option's price to changes in interest rates. |
marketOHLC | object | Contains OHLC (Open, High, Low, Close) data for various time intervals. |
ohlc | array | List of OHLC data for different intervals. |
ohlc[n].interval | string | Interval duration (e.g., 1d for daily). |
ohlc[n].open | number | Open price for the nth interval. |
ohlc[n].high | number | High price for the nth interval. |
ohlc[n].low | number | Low price for the nth interval. |
ohlc[n].close | number | Close price for the nth interval. |
ohlc[n].ts | string | Timestamp for the nth interval. |
atp | number | Average traded price for the instrument. |
vtt | string | Volume traded today (in contracts). |
oi | number | Open interest for the instrument. |
tbq | number | Total buy quantity across all levels. |
tsq | number | Total sell quantity across all levels. |
currentTs | string | Timestamp of the current tick received. |
If there is no data to stream over an open WebSocket connection, the API automatically sends a standard ping
frame periodically to maintain the connection's aliveness. Most standard WebSocket client libraries across various programming languages handle this automatically by responding with a pong
frame, requiring no manual intervention.