Skip to main content

Live Data Stream

Stay ahead in the market with real-time updates using our Live Data Stream API. This feature empowers you to access live stock prices for all instruments supported by the getAllInstruments API. With every price change, your callback function will receive the updated tick, enabling you to make swift, informed decisions.

Key Features

Real-Time Updates: Get live stock prices and other critical data points as they happen.

Customizable Callbacks: Define how each tick should be processed in your application.

Flexible Integration: Easily integrate with both Node.js on the backend or React.js on the client side to save server cost.

How to Use


await initialize("APIKEY", (tick) => {
// Custom processing logic here
console.log(tick);
});

unsubscribe = subscribe(instrumentTokens);

initialize: Initializes the live data stream with your API key and a callback function to handle each tick.

subscribe: Subscribes to updates for the specified instrument tokens. Example: subscribe([738561, ..])

Example Response

Your callback will be called with array of live data of instruments continuously till it is subscribed

[
{
"tradable": true,
"mode": "full",
"instrument_token": 208947,
"last_price": 3939,
"last_quantity": 1,
"average_price": 3944.77,
"volume": 28940,
"buy_quantity": 4492,
"sell_quantity": 4704,
"ohlc": {
"open": 3927,
"high": 3955,
"low": 3927,
"close": 3906
},
"change": 0.8448540706605223,
"last_trade_time": 1515491369,
"timestamp": 1515491373,
"oi": 24355,
"oi_day_high": 0,
"oi_day_low": 0,
"depth": {
"buy": [
{
"quantity": 59,
"price": 3223,
"orders": 5
},
{
"quantity": 164,
"price": 3222,
"orders": 15
},
{
"quantity": 123,
"price": 3221,
"orders": 7
},
{
"quantity": 48,
"price": 3220,
"orders": 7
},
{
"quantity": 33,
"price": 3219,
"orders": 5
}
],
"sell": [
{
"quantity": 115,
"price": 3224,
"orders": 15
},
{
"quantity": 50,
"price": 3225,
"orders": 5
},
{
"quantity": 175,
"price": 3226,
"orders": 14
},
{
"quantity": 49,
"price": 3227,
"orders": 10
},
{
"quantity": 106,
"price": 3228,
"orders": 13
}
]
}
}
]

Example

Explore sample implementations and see how easy it is to integrate live data streaming into your project by visiting our code samples.