WebSocket

Streams

The three WebSocket streams and their messages.
StreamURLPlanMessages
Quoteswss://api.q4.sa/v1/ws/stocksPro+quote
Tradeswss://api.q4.sa/v1/ws/tradesBusiness+trades_snapshot, trade
Depthwss://api.q4.sa/v1/ws/depthBusiness+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.