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.

Access requirement

A Pro or higher plan is required, and REST depth access must also be enabled for your account. Plan eligibility alone does not activate this market-data entitlement.

Endpoint

https://api.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-08-12T12:19:54.982770+00:00",
  "session": "atc",
  "book_state": "normal",
  "levels": 5,
  "best_bid": 26.6,
  "best_ask": 26.62,
  "spread": 0.02,
  "spread_bps": 7.52,
  "total_bid_quantity_top5": 241514,
  "total_ask_quantity_top5": 491802,
  "total_bid_quantity": 241514,
  "total_ask_quantity": 491802,
  "level_imbalance": -0.3413,
  "level_imbalance_top5": -0.3413,
  "bids": [
    { "level": 0, "price": 26.6, "quantity": 9181, "order_count": 18 },
    { "level": 1, "price": 26.58, "quantity": 228, "order_count": 3 },
    { "level": 2, "price": 26.56, "quantity": 13363, "order_count": 34 },
    { "level": 3, "price": 26.54, "quantity": 4133, "order_count": 21 },
    { "level": 4, "price": 26.52, "quantity": 214609, "order_count": 120 }
  ],
  "asks": [
    { "level": 0, "price": 26.62, "quantity": 38155, "order_count": 17 },
    { "level": 1, "price": 26.64, "quantity": 25208, "order_count": 12 },
    { "level": 2, "price": 26.66, "quantity": 17877, "order_count": 36 },
    { "level": 3, "price": 26.68, "quantity": 203743, "order_count": 53 },
    { "level": 4, "price": 26.7, "quantity": 206819, "order_count": 72 }
  ],
  "entitled_levels": 5
}

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."
  }
}

Last updated on