Viewing: Depth

Depth

Get order book depth snapshots for a symbol with selectable level controls. See Real-time WebSocket for streaming updates.

GET /market/depth/{symbol}/

Pro+

Fetch depth snapshots for a symbol with requested level depth.

Endpoint

https://app.sahmk.sa/api/v1/market/depth/2222/?levels=5

Parameters

(*) Required

ParameterTypeExample
symbol *string2222
levels integer5 (or any numeric value)

Choose the depth you need with levels (typically 5 or up to 20). Returned depth may be lower based on your entitlement and current market-data availability.

Data availability by plan:

200 OKapplication/json
{
  "symbol": "2222",
  "updated_at": "2026-07-09T12:40:23.185897+00:00",
  "session": "postmarket",
  "book_state": "normal",
  "levels": 5,
  "best_bid": 26.68,
  "best_ask": 26.72,
  "spread": 0.04,
  "spread_bps": 14.99,
  "bids": [
    { "level": 0, "price": 26.68, "quantity": 79, "order_count": 10 },
    { "level": 1, "price": 26.66, "quantity": 82, "order_count": 4 },
    { "level": 2, "price": 26.64, "quantity": 565, "order_count": 10 },
    { "level": 3, "price": 26.62, "quantity": 7081, "order_count": 14 },
    { "level": 4, "price": 26.6, "quantity": 21278, "order_count": 26 }
  ],
  "asks": [
    { "level": 0, "price": 26.72, "quantity": 41188, "order_count": 38 },
    { "level": 1, "price": 26.74, "quantity": 38841, "order_count": 23 },
    { "level": 2, "price": 26.76, "quantity": 20031, "order_count": 23 },
    { "level": 3, "price": 26.78, "quantity": 20361, "order_count": 23 },
    { "level": 4, "price": 26.8, "quantity": 384223, "order_count": 68 }
  ]
}

Depth Serving Notes

  • The API returns the best available snapshot at request time.
  • Returned depth may be lower than requested based on entitlement and current market-data availability.
View Endpoint-Specific Errors
json
{
  "error": {
    "code": "DEPTH_NOT_AVAILABLE",
    "message": "No usable depth snapshot found for '2222'."
  }
}

{
  "error": {
    "code": "MARKET_DATA_ENTITLEMENT_REQUIRED",
    "message": "Market-depth access requires an approved entitlement."
  }
}