Skip to Content
Scalar
Trading APIs

Read order book depth

Returns the current order book depth (bids and asks) for a given instrument. The instrument must reference a known product and parameter index, and refer to the product's currently active cycle. Every response includes a server-generated `x-request-id` for correlating the request with endpoint logs.

GET
/instruments/{instrument_bytes}/depth

Returns the current order book depth (bids and asks) for a given instrument. The instrument must reference a known product and parameter index, and refer to the product's currently active cycle. Every response includes a server-generated x-request-id for correlating the request with endpoint logs.

Path Parameters

instrument_bytes*string

Instrument identifier in hex format (0x prefix optional)

Query Parameters

max_levels?integer

Maximum levels of depth to return per side. Defaults to 50, capped at 500.

Formatint32
Range0 <= value

Response Body

Order book depth

application/json
  1. response

A depth snapshot. GET /instruments/{instrument_bytes}/depth returns exactly the shape the market-data WebSocket sends as depth_snapshot, minus type.

asks*array<>
bids*array<>
instrument*string

Instrument identifier as 0x-prefixed lowercase hex

sequence_id*integer

The book's next-expected sequence: every update with seq < sequence_id is already reflected here, so it is the first_seq_id of the next delta.

Formatint64
Range0 <= value
Example Request
curl -X GET 'https://testnet-api.scalar.market/instruments/string/depth'
Example Response
{
  "asks": [
    {
      "price": 0.1,
      "quantity": 0
    }
  ],
  "bids": [
    {
      "price": 0.1,
      "quantity": 0
    }
  ],
  "instrument": "string",
  "sequence_id": 0
}