How to Retrieve Level 1 (L1) Data from Zerodha WebSocket API.

Rohit2190
I am currently using Zerodha's WebSocket API in "full" mode to access market data. In response to my request, I received detailed Level 2 (L2) data, which includes information on the top 5 buy and sell orders in the market depth.

Here's an example of the request I'm making:

wss://ws.kite.trade?api_key=apiKey&access_token=access_token

Message : { "a": "mode", "v": ["full", [408065]] }



And here's an example of the response I receive:

Response

[
{
"tradable": true,
"mode": "full",
"instrument_token": 408065,
"last_price": 1292.95,
"last_traded_quantity": 2,
"average_traded_price": 1287.12,
"volume_traded": 1466671,
"total_buy_quantity": 340528,
"total_sell_quantity": 565362,
"ohlc": {
"open": 1290.0,
"high": 1293.25,
"low": 1281.4,
"close": 1279.15
},
"change": 1.0788414181292227,
"last_trade_time": "2023-06-28 11:31:24",
"oi": 0,
"oi_day_high": 0,
"oi_day_low": 0,
"exchange_timestamp": "2023-06-28 11:31:24",
"depth": {
"buy": [
{
"quantity": 190,
"price": 1292.55,
"orders": 4
},
{
"quantity": 1382,
"price": 1292.5,
"orders": 6
},
{
"quantity": 476,
"price": 1292.45,
"orders": 5
},
{
"quantity": 461,
"price": 1292.4,
"orders": 5
},
{
"quantity": 345,
"price": 1292.35,
"orders": 5
}
],
"sell": [
{
"quantity": 75,
"price": 1292.9,
"orders": 1
},
{
"quantity": 69,
"price": 1292.95,
"orders": 2
},
{
"quantity": 1914,
"price": 1293.0,
"orders": 7
},
{
"quantity": 58,
"price": 1293.05,
"orders": 4
},
{
"quantity": 245,
"price": 1293.1,
"orders": 3
}
]
}
}
]





However, I am interested in receiving a simplified Level 1 (L1) data response, specifically only one record in the depth section. Can someone guide me on how to modify my API request to achieve this?
Sign In or Register to comment.