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

# Get order book

> Retrieve a snapshot of the orderbook for a trading pair.

Returns a snapshot of the orderbook for a trading pair, including price levels on both sides and the current spot price.

## Query parameters

<ParamField query="base" type="string" required>
  Base asset identifier. Use `ADA` for Cardano's native asset, or `<policy_id_hex>:<asset_name_hex>` for native tokens.
</ParamField>

<ParamField query="quote" type="string" required>
  Quote asset identifier. Same format as `base`.
</ParamField>

## Response

<ResponseField name="base" type="string">
  Base asset identifier (echoed from query).
</ResponseField>

<ResponseField name="quote" type="string">
  Quote asset identifier (echoed from query).
</ResponseField>

<ResponseField name="spot" type="DecimalPrice | null">
  Most recent execution price. `null` if no trades have occurred.
</ResponseField>

<ResponseField name="bids" type="PriceLevel[]">
  Buy-side levels, highest price first.
</ResponseField>

<ResponseField name="asks" type="PriceLevel[]">
  Sell-side levels, lowest price first.
</ResponseField>

## Response codes

| Status          | Body                   | Condition                |
| --------------- | ---------------------- | ------------------------ |
| `200 OK`        | `GetOrderBookResponse` | Pair exists in the index |
| `404 Not Found` | `{"error": "..."}`     | Pair not found           |

<RequestExample>
  ```bash Request theme={null} theme={null}
  curl "https://api.shadowbook.io/trading-view/order-book?base=0691b2fecca1ac4f53cb6dfb00b7013e561d1f34403b957cbb5af1fa:4e49474854&quote=ADA"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null} theme={null}
  {
    "base": "ADA",
    "quote": "279c909f348e533da5808898f87f9a14bb2c3dfbbacccd631d927a3f:534e454b",
    "spot": "0.00001",
    "bids": [
      { "price": "0.0000110", "accumulated_liquidity": 3000000000 },
      { "price": "0.0000100", "accumulated_liquidity": 1500000000 },
      { "price": "0.0000090", "accumulated_liquidity": 500000000 }
    ],
    "asks": [
      { "price": "0.0000120", "accumulated_liquidity": 2000000000 },
      { "price": "0.0000130", "accumulated_liquidity": 800000000 }
    ]
  }
  ```

  ```json 404 theme={null} theme={null}
  {
    "error": "Pair ADA/UNKNOWN not found"
  }
  ```
</ResponseExample>
