Skip to Content

Data Socket - Symbol Update

This WebSocket allows you to stream live price updates for equity and option symbols.

USE CASE

React to every price change on a stock or option, such as a watchlist update or a strategy trigger.

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
  • To update symbols in an already subscribed socket, it is recommended to unsubscribe from the existing list of symbols and then resubscribe with the updated list.
  • Subscribe with data_type set to SymbolUpdate and symbols in FYERS format, for example NSE:SBIN-EQ.
  • Check type on every message: sf carries equity and option data. cn and sub are connection and subscribe messages.
  • Price fields such as high_price, low_price, open_price, ch, chp and vol_traded_today are for the current trading day.
  • Use lite mode (litemode=True in Python, mode(LiteMode) in Node and Web JS) to get only symbol, ltp and type. See Lite Mode.
  • Index symbols arrive as index messages with fewer fields. See Indices Update.

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 (Market Data 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.
vol_traded_todayintVolume traded for security or asset today.
last_traded_timeintLast traded time of security or asset.
bid_sizeintThe bid size key represents the quantity or volume of the security or asset that buyers are willing to purchase at a specific bid price level.
ask_sizeintThe ask size key represents the quantity or volume of the security or asset that sellers are willing to sell at a specific ask price level.
ask_pricefloatThe ask price key represents the lowest price at which sellers are willing to sell a particular security or asset.
bid_pricefloatThe bid price key represents the highest price at which buyers are willing to purchase a particular security or asset.
last_traded_qtyintLast traded quantity of security or asset.
tot_buy_qtyintTotal buy quantity of security or asset.
tot_sell_qtyintTotal sell quantity of security or asset.
avg_trade_pricefloatAverage trade price of security or asset.
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