Viewing: Depth

Real-time WebSocket - Depth

Stream real-time level-by-level bid/ask depth updates through the depth channel.

WS /ws/v1/market/depth/

Pro+

Real-time depth channel for level-by-level bid/ask streaming.

Endpoint

wss://app.sahmk.sa/ws/v1/market/depth/?api_key=YOUR_API_KEY

Data availability by plan:

Connected message

json
{
  "type": "connected",
  "channel": "depth",
  "plan": "enterprise",
  "mode": "customer_production",
  "limits": {
    "entitled_levels": 20,
    "max_symbols_per_connection": 200,
    "max_symbols_per_call": 100,
    "wildcard_allowed": true,
    "max_concurrent_wildcard_streams": 1
  },
  "timestamp": "2026-07-09T15:05:37.840967+00:00"
}

Client actions

json
{"action":"snapshot","symbol":"2222","levels":5}
{"action":"subscribe","symbols":["2222","1120"],"levels":20}
{"action":"unsubscribe","symbols":["1120"]}
{"action":"ping"}
{"action":"subscribe","symbols":["*"],"levels":20} // Enterprise only

Depth snapshot message

200 OKapplication/json
{
  "type": "depth_snapshot",
  "symbol": "2222",
  "available": true,
  "session": "postmarket",
  "book_state": "normal",
  "bids": [
    {
      "level": 0,
      "price": 26.68,
      "quantity": 79,
      "order_count": 10
    }
  ],
  "asks": [
    {
      "level": 0,
      "price": 26.72,
      "quantity": 41188,
      "order_count": 38
    }
  ],
  "entitled_levels": 20,
  "timestamp": "2026-07-09T15:05:37.872738+00:00"
}