20-MarketDepth

POSTJSONRest API
100

Daily API Calls

100%

Success Rate

3ms

Avg. Response Time


The Market 20-Depth feature provides a detailed view of the order book for a particular instrument, displaying up to 20 levels of bid (buy) and ask (sell) orders. This depth information reflects the current market liquidity by showing the quantity, price, and number of orders available at different price levels.

Market depth is commonly used by traders, algorithmic systems, and institutional participants to analyze supply and demand dynamics, assess market liquidity, and understand potential price movements based on order concentration.

CONNECTION URL

wss://gateway.5paisa.com/openapi/20depth?access_token={{access_token}}

URL Query Parametrs

PARAMETER NAMEMANDATORYDESCRIPTION

access_token

STRING

Yes

Access token received in the response of login API

SAMPLE CONNECTION URL

wss://gateway.5paisa.com/openapi/20depth?access_token={{access_token}}

Subscription Requests

PARAMETER NAMEMANDATORYDESCRIPTION

Method

STRING

Yes

It specifies if the request is for subscribing or unsubscribing the data feed.

Subscribe
Unsubscribe

Operation

STRING

Yes

20Depth

instruments

ARRAY

Yes

List of instrument identifiers to subscribe

["nc1660","nd45456"]

Response body

FieldData Type
ExchString
ExchTypeString
TokenInteger
TBidQInteger
TOffQInteger
DetailsArray
QuantityInteger
PriceFloat
NumberOfOrdersInteger
BbBuySellFlagInteger
TimeStampInteger (Epoch Milliseconds)
 Sample Response  

{
 "Exch": "N",
 "ExchType": "C",
 "Token": 1660,
 "TBidQ": 0,
 "TOffQ": 0,
 "Details": [
   {
     "Quantity": 13,
     "Price": 305.15,
     "NumberOfOrders": 3,
     "BbBuySellFlag": 66
   },
   {
     "Quantity": 25,
     "Price": 305.1,
     "NumberOfOrders": 4,
     "BbBuySellFlag": 66
   },
   {
     "Quantity": 1440,
     "Price": 305.05,
     "NumberOfOrders": 8,
     "BbBuySellFlag": 66
   },
   {
     "Quantity": 3064,
     "Price": 305.0,
     "NumberOfOrders": 68,
     "BbBuySellFlag": 66
   },
   {
     "Quantity": 3379,
     "Price": 304.95,
     "NumberOfOrders": 20,
     "BbBuySellFlag": 66
   }.

As follows till 20Depth.
 ],
 "TimeStamp": 1773052927557
}

NOTE

  • The details scrip code for any instrument can be found from the Scrip master.
  • Example for multiple subscribe : instruments:["nc1660","nd47625"]
  • This only works for NSE Scrip codes.
On this Page

Knowledge base

Displays the top 20 bid and 20 ask price levels with their respective quantities in the order book.
20MarketDepth

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