> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trusset.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Order Book Snapshot

> Retrieve the current bid/ask depth of an order book

Returns a snapshot of the current order book depth, showing aggregated bid and ask levels. Use this to display market depth or calculate spread.

## Authentication

Requires an instance API key with the `trading` service enabled.

## Path Parameters

<ParamField path="orderBookId" type="string" required>
  The order book identifier.
</ParamField>

## Query Parameters

<ParamField query="levels" type="integer">
  Number of price levels to return per side. Default `20`, maximum `100`.
</ParamField>

<RequestExample>
  ```bash theme={null}
  curl -X GET "https://api.trusset.org/orderbooks/stocks/api/order-books/ob_abc123/snapshot?levels=10" \
    -H "x-api-key: trusset_{instanceRef}_{secret}"
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "orderBookId": "ob_abc123",
      "bids": [
        { "price": "99500000000000000000", "quantity": "5000000000000000000" },
        { "price": "99000000000000000000", "quantity": "12000000000000000000" }
      ],
      "asks": [
        { "price": "100500000000000000000", "quantity": "3000000000000000000" },
        { "price": "101000000000000000000", "quantity": "8000000000000000000" }
      ]
    },
    "metadata": {
      "requestId": "550e8400-e29b-41d4-a716-446655440000",
      "timestamp": "2025-01-15T10:30:00.000Z",
      "instanceId": "inst_abc"
    }
  }
  ```
</ResponseExample>
