Skip to Content

Data Socket - Indices Update

This WebSocket allows you to stream live index values such as NIFTY 50 and NIFTY Bank.

USE CASE

Show live index levels in a market header, or compare a stock's move with its index.

Details

  • The WebSocket API for receiving stock data is a real-time communication protocol designed to provide seamless and low-latency access to live stock market data. This API allows developers and traders to establish a persistent, bidirectional connection with the server, enabling them to receive continuous updates on stock prices, trading volumes, and other relevant market information.
  • To quickly get started with the WebSocket API and start receiving real-time stock data, you can explore our sample scripts and code examples in our GitHub repository:
    Data WebSocket Sample Scripts
  • Subscribe with data_type set to SymbolUpdate and index symbols such as NSE:NIFTY50-INDEX or NSE:NIFTYBANK-INDEX.
  • Index messages have type set to if.
  • An index message has only symbol, ltp, prev_close_price, high_price, low_price, open_price, ch, chp and type. Volume and bid or ask fields are not sent.
  • A missing symbol key in index updates was fixed on 22 Aug 2025 (Java v1.3.0). Use a recent SDK version. See the Change Log.

Plan limits

Standard plan

  • Up to 100 symbols, counted per user across all connections

Prime plan

  • Up to 5,000 symbols, counted per user across all connections

For rate limits and all other plan details, see Plans & rate limits.

Response Attributes (Index Update)

AttributeData TypeDescription
symbolstringThe symbol in fyers symbology format whose data is received on socket.
ltpfloatLast traded price of security or asset.
prev_close_pricefloatPrevious day's close of security or asset.
high_pricefloatCurrent day's high of security or asset.
low_pricefloatCurrent day's low of security or asset.
open_pricefloatCurrent day's open of security or asset.
chfloatChange in price of security or asset today.
chpfloatChange in price in % of security or asset today.
typestring
  • cn - connection message
  • sub - subscribe message
  • if - index data message
  • dp - market depth data message
  • sf - Equity and option data message
Last updated on