WebSocket
Streams
The three WebSocket streams and their messages.
| Stream | URL | Plan | Messages |
|---|---|---|---|
| Quotes | wss://api.q4.sa/v1/ws/stocks | Pro+ | quote |
| Trades | wss://api.q4.sa/v1/ws/trades | Business+ | trades_snapshot, trade |
| Depth | wss://api.q4.sa/v1/ws/depth | Business+ | depth |
Every message is a JSON object with a type. Ignore types you don't recognise: we may add new ones.
Quotes
Sent when a subscribed stock's price, volume, or best bid or ask changes. At most one per symbol every 250 ms.
Trades
After you subscribe, you get one trades_snapshot with the last 50 trades, then a trade message for every execution.
Depth
A full 10-level book whenever the top of the book changes.
