Data Socket - Market Depth Update
This WebSocket allows you to stream live five-level market depth for a symbol.
USE CASE
Build a live order book showing the best five bids and asks as they change.
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 - Depth covers 5 levels on each side, for example
bid_price1tobid_price5. For 50 levels use the Tick-by-Tick (TBT) Socket. - Subscribe with
data_typeset toDepthUpdatein Python. In Node, passtrueas the second argument ofsubscribe. - Depth messages have
typeset todp. - Each level has a price, a size and an order count, for example
bid_price1,bid_size1andbid_order1. - In the sample response, levels with no quantity show 0.
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 (Depth Update)
| Attribute | Data Type | Description |
|---|---|---|
symbol | string | The symbol in fyers symbology format whose data is received on socket. |
bid_price1-bid_price5 | float | The bid price key represents the highest price at which buyers are willing to purchase a particular security or asset. |
ask_price1-ask_price5 | float | The ask price key represents the lowest price at which sellers are willing to sell a particular security or asset. |
bid_size1-bid_size5 | 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_size1-ask_size5 | 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. |
bid_order1-bid_order5 | int | The number of bid order. |
ask_order1-ask_order5 | int | The number of ask order. |
type | string |
|
Last updated on