Understanding Data Format in WebSocket Order and Data Updates

What data type does a client receive when calling for order updates or data updates from Websocket?

When working with FYERS' WebSocket API, it's important to understand the structure of the data being returned. Both the market data stream and order updates follow a consistent format to simplify integration and parsing.

Data format received from WebSocket

FYERS WebSocket responses are delivered in the form of a dictionary (JSON object). This applies to:

  • Market Data WebSocket – used for live stock price, volume, and tick updates.
  • Order Socket – used for receiving order status events (placed, executed, cancelled, etc.).

This dictionary includes key-value pairs that describe each update, such as:

  • symbol
  • ltp (Last Traded Price)
  • order_id
  • status
  • message_type
  • timestamp

Example: Market data tick

{
  "symbol": "NSE:TCS-EQ",
  "ltp": 3730.5,
  "timestamp": 1729912302,
  "type": "symbolUpdate"
}

Example: Order update event

{
  "order_id": "22000239812",
  "status": "TRADE_EXECUTED",
  "message_type": "orderUpdate",
  "timestamp": 1729912302
}

This uniform dictionary structure allows developers to use common parsing logic across different types of updates.

Always validate incoming keys and handle optional fields gracefully, as the structure may vary slightly between message types.

Last updated: 30 Jun 2025