Live prices (WebSocket)¶
Stream live prices for Global stocks over one WebSocket connection.
Connect¶
Send your access token in the Authorization header, or add it to the URL as ?auth=YOUR_ACCESS_TOKEN.
Subscribe¶
| Field | Value |
|---|---|
action | subscribe or unsubscribe |
mode | ltp, full or depth |
instruments | List of security_ids from Instruments |
To stop, send the same message with "action": "unsubscribe".
Responses¶
Every tick has the same outer shape: mode, instrument, timestamp (epoch milliseconds) and data.
ltp
full
JSON
{"mode": "full", "instrument": "112778", "timestamp": 1793196524311, "data": {"ltp": 378.5, "ltt": 1793196524000, "volume": 243110}}
ltt is the last trade time in epoch milliseconds.
depth
JSON
{"mode": "depth", "instrument": "112778", "timestamp": 1793196524311, "data": {"bids": [{"price": 378.47, "quantity": 240}], "asks": [{"price": 378.49, "quantity": 280}]}}
Depth gives the best bid and best ask.
Keep-alive¶
The server sends a ping every second, and most WebSocket libraries reply automatically. If 5 pings in a row go unanswered, the server closes the connection. Reconnect and subscribe again.