> For the complete documentation index, see [llms.txt](https://docs.bbx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bbx.com/bbx-dex-public-api/coinmarketcap-integration/spot/spot-orderbook.md).

# Spot Orderbook

Returns the current level-2 order book for a specified spot market.

### Request

```http
GET /sapi/v4/market/v1/public/cmc/orderbook/{market_pair}
```

### Path parameter

| Parameter     | Location | Type   | Required | Description                                |
| ------------- | -------- | ------ | -------: | ------------------------------------------ |
| `market_pair` | path     | string |      Yes | Spot market identifier, such as `BTC_USDT` |

### Query parameters

| Parameter | Location | Type    | Required | Description                                                                                        |
| --------- | -------- | ------- | -------: | -------------------------------------------------------------------------------------------------- |
| `depth`   | query    | integer |       No | Total number of levels across both sides. Allowed values: `0`, `5`, `10`, `20`, `50`, `100`, `500` |
| `level`   | query    | integer |       No | Order-book level: `1`, `2`, or `3`. Default: `2`                                                   |

### Example request

```
https://dex.bbx.com/sapi/v4/market/v1/public/cmc/orderbook/BTC_USDT?depth=10&level=2
```

### cURL

```bash
curl -s \
  'https://dex.bbx.com/sapi/v4/market/v1/public/cmc/orderbook/BTC_USDT?depth=10&level=2'
```

### Response fields

| Field       | Type    | Description                                                                      |
| ----------- | ------- | -------------------------------------------------------------------------------- |
| `timestamp` | integer | Order-book update time in Unix milliseconds                                      |
| `bids`      | array   | Bid levels formatted as `[price, quantity]`, sorted from highest to lowest price |
| `asks`      | array   | Ask levels formatted as `[price, quantity]`, sorted from lowest to highest price |

### Example response

```json
{
  "timestamp": 1784612375911,
  "bids": [
    ["66366.10", "0.5231"],
    ["66365.80", "1.2044"]
  ],
  "asks": [
    ["66366.80", "0.8810"],
    ["66367.00", "2.1500"]
  ]
}
```
