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_typeset toSymbolUpdateand symbols in FYERS format, for exampleNSE:SBIN-EQ. - Check
typeon every message:sfcarries equity and option data.cnandsubare connection and subscribe messages. - Price fields such as
high_price,low_price,open_price,ch,chpandvol_traded_todayare for the current trading day. - Use lite mode (
litemode=Truein Python,mode(LiteMode)in Node and Web JS) to get onlysymbol,ltpandtype. 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)
| Attribute | Data Type | Description |
|---|---|---|
symbol | string | The symbol in fyers symbology format whose data is received on socket. |
ltp | float | Last traded price of security or asset. |
prev_close_price | float | Previous day's close of security or asset. |
high_price | float | Current day's high of security or asset. |
low_price | float | Current day's low of security or asset. |
open_price | float | Current day's open of security or asset. |
ch | float | Change in price of security or asset today. |
chp | float | Change in price in % of security or asset today. |
vol_traded_today | int | Volume traded for security or asset today. |
last_traded_time | int | Last traded time of security or asset. |
bid_size | int | The 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_size | int | The 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_price | float | The ask price key represents the lowest price at which sellers are willing to sell a particular security or asset. |
bid_price | float | The bid price key represents the highest price at which buyers are willing to purchase a particular security or asset. |
last_traded_qty | int | Last traded quantity of security or asset. |
tot_buy_qty | int | Total buy quantity of security or asset. |
tot_sell_qty | int | Total sell quantity of security or asset. |
avg_trade_price | float | Average trade price of security or asset. |
type | string |
|
Last updated on