Skip to Content

Tick-by-Tick (TBT) Socket Overview

This WebSocket allows you to stream 50 levels of market depth for NSE equity and NFO symbols.

USE CASE

Track order flow or run high-frequency strategies on full 50-level market depth.

Introduction

Tick-by-tick data is the most detailed market data, recording every trade and order book update in real-time. Each tick includes the price, volume, and timestamp of individual trades, as well as changes to buy and sell orders. This granular data is crucial for analyzing market microstructure, tracking order flow, and developing high-frequency trading strategies.

Key Points

Supported Instruments
Exclusively available for NFO (NSE Futures & Options) and NSE (Equity) instruments.
NFONSE Equity
Data Formats & Transmission
Requests are sent in JSON format. Responses are received in Protobuf format — a compact, efficient binary stream.
JSONProtobuf
Incremental Data Updates
The server sends only delta changes (differences) between the last packet and the current one. Apply those changes onto the previous state to reconstruct the book. Official FYERS SDKs handle this process automatically.
Snapshot Data on New Subscriptions
Packet #1 returns a complete initial snapshot of the market data at subscribe time. Subsequent packets stream real-time updates and differences that you apply to that snapshot.

Details

  • The only feature on this socket today is TBT 50 Market Depth, requested with mode depth.
  • Connect to wss://rtsocket-api.fyers.in/versova with the header Authorization: appId:accessToken. See TBT WebSocket Connection.
  • See Ratelimits for connection and channel limits.
  • Subscribing to symbols on a channel does not start the stream. Resume the channel to receive data. See Concept of channels.
  • Send the string ping to keep the connection alive.
  • Requests are JSON strings. Responses are protobuf, defined by the .proto file.
  • SDK support: TBT 50 depth was added in the Python SDK v3.1.7 (04 Mar 2025) and the Node SDK v1.4.1 (26 Mar 2025). NSE equity support was added on 23 Jun 2025. See the Change Log.

Plan limits

Standard plan

  • 1 symbol, counted per user across all connections
  • 1 active connection

Prime plan

  • 15 symbols, counted per user across all connections
  • Up to 3 active connections with 5 symbols each

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

Connection

Connect to wss://rtsocket-api.fyers.in/versova with the header Authorization: appId:accessToken, subscribe with mode depth and a channel number, then resume that channel to start the stream.

Full reference and samples: Tick-by-Tick (TBT) Socket - Connection (50 Market Depth).

Channels and message types

With the Tick-by-Tick (TBT) WebSocket, we are introducing the concept of channels. A channel acts as a logical grouping for different subscribed symbols, making it easier to manage data streams efficiently.

How Channels Work

  • When subscribing to market data, you need to specify both the symbols and a channel number.
  • Simply subscribing to a channel does not start the data stream—you must also resume the channel to begin receiving updates.

Example Usage

Let's say you organize your subscriptions as follows:

  • Channel 1: All Nifty-related symbols
  • Channel 2: All BankNifty-related symbols

Now, depending on what data you need, you can control the channels dynamically:

  • Receive only Nifty data → Pause Channel 2 and Resume Channel 1
  • Receive only BankNifty data → Pause Channel 1 and Resume Channel 2
  • Receive both Nifty and BankNifty data → Resume both channels

This approach provides greater flexibility and control over market data streaming, allowing you to filter and manage real-time data efficiently.

Details

  • Every subscribe and unsubscribe request carries a channel number. A connection supports 50 channels (1 to 50). See Rate limits for symbol and connection limits by plan.
  • Subscribing to a channel does not start the stream. Send a switch-channel request (type 2) with the channel in resumeChannels to start it.
  • Use pauseChannels and resumeChannels in the same request to switch between groups. Both lists hold channel numbers as strings; the sample sends an empty pauseChannels list.
  • Subscribe uses subs 1 and unsubscribe uses subs -1, both with type 1 and mode depth.
  • Responses are protobuf. snapshot is true for the first full packet and false for diff packets. When error is true, feeds is empty.
  • Each depth level has price, qty, nord and num. For 50 levels, num runs from 0 to 49.

Request Message Types

TypePurposeEncoding FormatData Format
PingPing message to keep connection aliveString
"ping"
SubscribeSubscribe to the symbols for which data is requiredJson string
{
  "type": 1,
  "data": {
    "subs": 1,
    "symbols": [
      "NSE:IOC25FEBFUT",
      "NSE:NIFTY25FEBFUT",
      "NSE:BANKNIFTY25FEBFUT",
      "NSE:FINNIFTY25FEBFUT",
      "NSE:TCS25FEBFUT"
    ],
    "mode": "depth",
    "channel": "1"
  }
}
UnsubscribeUnsubscribe to the symbols for which data is NOT requiredJson string
{
  "type": 1,
  "data": {
    "subs": -1,
    "symbols": [
      "NSE:IOC25FEBFUT",
      "NSE:NIFTY25FEBFUT",
      "NSE:BANKNIFTY25FEBFUT",
      "NSE:FINNIFTY25FEBFUT",
      "NSE:TCS25FEBFUT"
    ],
    "mode": "depth",
    "channel": "1"
  }
}
Switch ChannelSwitch between active and paused channelsJson string
{
  "type": 2,
  "data": {
    "resumeChannels": ["1"],
    "pauseChannels": []
  }
}

Response Message Types

We use Protocol Buffers (protobuf) as the response format for all market data. The .proto file, which defines the data structure, is available at:

Protobuf is a widely used data format, and compilers are available to generate code in different programming languages.

How to install and use Protobuf

We have uploaded the compiled files also for python, nodejs, and golang. Download from: https://public.fyers.in/tbtproto/1.0.0/protogencode.zip

Copy the required file directly in your project and use it.

Proto versions & links

Response structures

TypeData FormatField Explanation
SocketMessage
  • type: value will always be MessageType.depth
  • feeds: string (key) will be the symbol ticker and value will be the MarketFeed datastructure. This value will have the actual 50 depth values.
  • snapshot: true if it's a snapshot and false if it's a diff packet.
  • msg: will mostly contain error msgs when error = true.
  • error: true if it is an error, else false. In case of true, feeds will be nil/empty.
message SocketMessage {
  MessageType type = 1;
  map<string, MarketFeed> feeds = 2;
  bool snapshot = 3;
  string msg = 4;
  bool error = 5;
}
MarketFeed
  • depth: Depth datastructure. This field will have the actual market depth value.
  • feed_time: time of packet in unix epoch.
  • send_time: time of packet at the time of sending from server.
  • token: fytoken for symbol.
  • snapshot: true if snapshot, false if diff packet.
  • ticker: symbol ticker.
  • Note: other fields can be ignored
message MarketFeed {
  Quote quote = 1;
  ExtendedQuote eq = 2;
  DailyQuote dq = 3;
  OHLCV ohlcv = 4;
  Depth depth = 5;
  google.protobuf.UInt64Value feed_time = 6;
  google.protobuf.UInt64Value send_time = 7;
  string token = 8;
  uint64 sequence_no = 9;
  bool snapshot = 10;
  string ticker = 11;
  SymDetail symdetail = 12;
}
Depth
  • tbq: total bid qty
  • tsq: total sell qty
  • asks: array of asks of type MarketLevel datastructure
  • bids: array of bids of type MarketLevel datastructure
message Depth {
  google.protobuf.UInt64Value tbq = 1;
  google.protobuf.UInt64Value tsq = 2;
  repeated MarketLevel asks = 3;
  repeated MarketLevel bids = 4;
}
MarketLevel
  • price: price
  • qty: qty in the market depth for the price
  • nord: number of orders in market depth for the price
  • num: depth number, for 50 depth will be between 0 and 49 [0 based array indexing]
message MarketLevel {
  google.protobuf.Int64Value price = 1;
  google.protobuf.UInt32Value qty = 2;
  google.protobuf.UInt32Value nord = 3;
  google.protobuf.UInt32Value num = 4;
}

Rate limits

Following ratelimits apply for TBT Websocket. The symbol limit is per user, across all connections: Standard allows 1 symbol and Prime allows 15 symbols, which is up to 3 connections with 5 symbols each. See Plans & rate limits.

DescriptionStandard planPrime plan
Symbols per user, across all connections [Market Depth]115
Active Connections Per App Per User13
Symbols per connection [Market Depth]15
Channels per connection50 (1-50)50 (1-50)

Full reference and samples: Tick-by-Tick (TBT) Socket - Channels and Message Types.

In this section

Last updated on