> For the complete documentation index, see [llms.txt](https://docs.kaiko.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kaiko.com/rest-api/cefi-spot-markets/market-data/order-book-aggregations/average-market-depth-by-level.md).

# Average market depth by level

{% hint style="info" %}

### This data is included in the following Kaiko packages:

* **Level 1 & Level 2 Data** \[Level 2 Aggregations Tier]
* **Level 1 & Level 2 Data** \[Level 2 Tick-Level Tier]

*Subscriptions with "CeFi Spot" as the market type.*
{% endhint %}

### What is this endpoint for? <a href="#what-is-this-endpoint-for" id="what-is-this-endpoint-for"></a>

This endpoint returns the average depth of the order book over each interval, at 24 levels measured in basis points (bps) from the reference price (5, 10, 15, 20, 25, 50, 75 and 100 bps, then every 25 bps up to 500 bps). For every level, it gives the average size, USD value and number of orders on the bid and ask side. To get the depth at the start of each interval instead, use [Market depth by level](https://docs.kaiko.com/rest-api/cefi-spot-markets/market-data/order-book-aggregations/market-depth-by-level.md).

{% hint style="warning" %}
Depth is measured within 0 to 10% of the reference price. We can't collect the full 10% of the order book from every exchange we cover, so on some exchanges these figures don't show the full order book volume.
{% endhint %}

### Endpoint

{% code overflow="wrap" %}

```http
https://<eu|us>.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{instrument}/ob_aggregations/average_depth
```

{% endcode %}

### Path parameters

<table><thead><tr><th width="203">Parameter</th><th>Required?</th><th>Description</th></tr></thead><tbody><tr><td><code>region</code></td><td>Yes</td><td>Choose between <code>eu</code> and <code>us</code>.</td></tr><tr><td><code>exchange</code></td><td>Yes</td><td>Exchange <code>code</code>.<br><br>See <a data-mention href="https://docs.kaiko.com/rest-api/cefi-spot-markets/reference-data/exchange-codes.md">Exchange codes</a></td></tr><tr><td><code>instrument_class</code></td><td>Yes</td><td>Instrument <code>class</code>: <code>spot</code>.</td></tr><tr><td><code>instrument</code></td><td>Yes</td><td>Instrument <code>code</code>.<br><br>See <a data-mention href="https://docs.kaiko.com/rest-api/cefi-spot-markets/reference-data/exchange-trading-pair-codes-instruments.md">Exchange trading pair codes (instruments)</a></td></tr></tbody></table>

### Query parameters

<table><thead><tr><th width="187">Parameter</th><th width="114">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>start_time</code></td><td>No</td><td>Starting time in ISO 8601 (inclusive).<br><br><em>Automatically included in continuation tokens.</em></td></tr><tr><td><code>end_time</code></td><td>No</td><td>Ending time in ISO 8601 (exclusive).<br><br><em>Automatically included in continuation tokens.</em></td></tr><tr><td><code>interval</code></td><td>No</td><td>Length of each interval, suffixed with <code>s</code>, <code>m</code>, <code>h</code> or <code>d</code> (for example <code>30s</code>, <code>15m</code>, <code>4h</code>). Any value from one second to one day.<br><br>Default <code>1d</code>.</td></tr><tr><td><code>slippage_ref</code></td><td>No</td><td>Reference price the depth levels are measured from: <code>mid_price</code> or <code>best</code> (the best bid on the bid side and the best ask on the ask side).<br><br>Default <code>mid_price</code>.</td></tr><tr><td><code>page_size</code></td><td>No</td><td>Number of rows per page. Default 10.<br><br>See <a data-mention href="https://docs.kaiko.com/rest-api/general/getting-started/pagination.md">Pagination</a><br><br><em>Automatically included in continuation tokens.</em></td></tr><tr><td><code>sort</code></td><td>No</td><td>Return the data in ascending (<code>asc</code>) or descending (<code>desc</code>) order.<br><br>Default <code>desc</code>.<br><br><em>Automatically included in continuation tokens.</em></td></tr><tr><td><code>continuation_token</code></td><td>No</td><td>See <a data-mention href="https://docs.kaiko.com/rest-api/general/getting-started/pagination.md">Pagination</a></td></tr></tbody></table>

### Fields

`{X}` is the depth level in basis points: 5, 10, 15, 20, 25, 50, 75 and 100, then every 25 bps up to 500 bps.

<table><thead><tr><th width="230">Field</th><th>Description</th></tr></thead><tbody><tr><td><code>poll_timestamp</code></td><td>Start of the interval, in Unix milliseconds.</td></tr><tr><td><code>bid_volume_{X}bps</code></td><td>Average size of the bids within X bps of the reference price, in the base asset.</td></tr><tr><td><code>ask_volume_{X}bps</code></td><td>Average size of the asks within X bps of the reference price, in the base asset.</td></tr><tr><td><code>bid_usd_million_{X}bps</code></td><td>Average value of the bids within X bps of the reference price, in millions of USD.</td></tr><tr><td><code>ask_usd_million_{X}bps</code></td><td>Average value of the asks within X bps of the reference price, in millions of USD.</td></tr><tr><td><code>bid_order_count_{X}bps</code></td><td>Average number of bids within X bps of the reference price.</td></tr><tr><td><code>ask_order_count_{X}bps</code></td><td>Average number of asks within X bps of the reference price.</td></tr></tbody></table>

### Request examples

{% tabs %}
{% tab title="cURL" %}
{% code overflow="wrap" %}

```url
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/cbse/spot/btc-usd/ob_aggregations/average_depth?interval=1h'
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import pandas as pd

api_key = "YOUR_API_KEY"
exchange = "cbse"
instrument_class = "spot"
instrument = "btc-usd"

url = f"https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{instrument}/ob_aggregations/average_depth"
headers = {"Accept": "application/json", "X-Api-Key": api_key}
params = {
    "start_time": "2026-11-01T00:00:00Z",
    "end_time": "2026-11-02T00:00:00Z",
    "interval": "1h",
    "sort": "desc",
    "page_size": 100,
}

rows = []
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
rows.extend(data.get("data", []))

# Follow next_url until every page is retrieved
while data.get("next_url"):
    res = requests.get(data["next_url"], headers=headers)
    res.raise_for_status()
    data = res.json()
    rows.extend(data.get("data", []))

df = pd.DataFrame(rows)
```

{% endtab %}
{% endtabs %}

### Response example

Shortened to the 5 and 10 bps levels.

```json
{
  "query": {
    "interval": "1h",
    "aggregation": "average_depth",
    "start_time": "2026-11-01T00:00:00.000Z",
    "start_timestamp": 1793491200000,
    "end_time": "2026-11-02T00:00:00.000Z",
    "end_timestamp": 1793577600000,
    "exchange": "cbse",
    "instrument_class": "spot",
    "instrument": "btc-usd",
    "slippage": 0,
    "slippage_ref": "mid_price",
    "sort": "desc",
    "page_size": 1,
    "request_time": "2026-11-09T17:46:30.159Z",
    "data_version": "v1",
    "commodity": "order_book_snapshots"
  },
  "time": "2026-11-09T17:46:30.159Z",
  "timestamp": 1794246390159,
  "data": [
    {
      "ask_order_count_10bps": 115,
      "ask_order_count_5bps": 60,
      "ask_usd_million_10bps": "2.048057455947647",
      "ask_usd_million_5bps": "0.8755807862070586",
      "ask_volume_10bps": "26.23096989633333",
      "ask_volume_5bps": "11.218931005666665",
      "bid_order_count_10bps": 97,
      "bid_order_count_5bps": 53,
      "bid_usd_million_10bps": "1.6396854407808823",
      "bid_usd_million_5bps": "0.7364674232675967",
      "bid_volume_10bps": "21.0234950725",
      "bid_volume_5bps": "9.441287722333335",
      "poll_timestamp": 1793574000000
    }
  ],
  "result": "success",
  "continuation_token": "QZwV7JsFEFbefeZfUui5...",
  "next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/cbse/spot/btc-usd/ob_aggregations/average_depth?continuation_token=..."
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kaiko.com/rest-api/cefi-spot-markets/market-data/order-book-aggregations/average-market-depth-by-level.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
