> 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/market-depth-in-basis-points-snapshot.md).

# Market depth in basis points (snapshot)

{% hint style="info" %}
"Snapshots" show a point-in-time view. At least one snapshot per minute. "Aggregations" show an aggregation of all snapshots from the period requested.
{% endhint %}

{% 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]

*CeFi Spot ticker packs.*

*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 market depth of **one snapshot per interval**, measured in basis points from the best bid and the best ask.

The depth is measured on 24 bands from the best price of each side, in basis points: 5, 10, 15, 20, 25, then 50 to 500 in steps of 25. Each band is cumulative: the 50 bps band holds everything from the best price down to 0.50% below it on the bid side, and up to 0.50% above it on the ask side. For each band and side the endpoint returns the volume in base asset, the notional in millions of quote asset, and the number of price levels.

{% hint style="warning" %}
A band that the collected order book does not reach is `null` for its volume, notional and level count, rather than repeating the totals of the truncated book. An interval with no snapshot is returned with every band `null` rather than omitted, so a page always holds `page_size` rows.

History is kept for 30 days. Rows before that are not returned and no error is raised.
{% endhint %}

### Endpoint

{% code overflow="wrap" %}

```http
https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/spot/{instrument}/ob_aggregations/volume_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><p>Exchange <code>code.</code></p><p><br>See</p></td></tr><tr><td><code>instrument_class</code></td><td>Yes</td><td>Instrument <code>class</code>.<br><br>See</td></tr><tr><td><code>instrument</code></td><td>Yes</td><td>Instrument <code>code</code>.<br><br>See</td></tr></tbody></table>

### Query Parameters

<table><thead><tr><th>Parameter</th><th width="99">Required</th><th>Description</th></tr></thead><tbody><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>continuation_token</code></td><td>No</td><td>See</td></tr><tr><td><code>interval</code></td><td>No</td><td>The interval parameter is suffixed with <code>s</code>, <code>m</code>, <code>h</code> or <code>d</code> to specify seconds, minutes, hours or days, respectively.<br><br>Any arbitrary value between one second and one day can be used, as long as it sums up to a maximum of 1 day. The suffixes are <code>s</code> (second), <code>m</code> (minute), <code>h</code> (hour) and <code>d</code> (day).<br><br>Default <code>1h</code>.</td></tr><tr><td><code>page_size</code></td><td>No</td><td>Number of intervals to return data for. (default: 10, max: 100).<br><br>See<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. Default desc<br><br><em>Automatically included in continuation tokens.</em></td></tr><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></tbody></table>

### Fields

Replace `{n}` with one of the 24 bands: `5`, `10`, `15`, `20`, `25`, `50`, `75`, `100`, `125`, `150`, `175`, `200`, `225`, `250`, `275`, `300`, `325`, `350`, `375`, `400`, `425`, `450`, `475` or `500`. For example `bid_volume_50bps`.

<table><thead><tr><th width="260">Field</th><th>Description</th></tr></thead><tbody><tr><td><code>poll_timestamp</code></td><td>The timestamp at which the interval begins.</td></tr><tr><td><code>bid_volume_{n}bps</code></td><td>The volume of bids placed within 0 and n basis points below the best bid, in base asset.</td></tr><tr><td><code>ask_volume_{n}bps</code></td><td>The volume of asks placed within 0 and n basis points above the best ask, in base asset.</td></tr><tr><td><code>bid_usd_million_{n}bps</code></td><td>The notional of the bids within the band, in millions of quote asset (sum of amount × price). No FX conversion is applied: on a pair not quoted in USD, the value is in the quote asset.</td></tr><tr><td><code>ask_usd_million_{n}bps</code></td><td>The notional of the asks within the band, in millions of quote asset. Same unit note as the bid side.</td></tr><tr><td><code>bid_order_count_{n}bps</code></td><td>The number of bid price levels within the band. Price levels, not exchange orders.</td></tr><tr><td><code>ask_order_count_{n}bps</code></td><td>The number of ask price levels within the band. Price levels, not exchange orders.</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/krkn/spot/btc-usd/ob_aggregations/volume_depth?interval=1h&page_size=10&start_time=2026-11-03T00:00:00Z&end_time=2026-11-04T00:00:00Z'
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code overflow="wrap" %}

```python
##### 1. Import dependencies #####
import requests
import pandas as pd

##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "krkn"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation

# ---- Optional parameters ---- #
interval = "1h"
sort = "desc"
page_size = 100
start_time = "2026-11-03T00:00:00Z"
end_time = "2026-11-04T00:00:00Z"

# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"

##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #

def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
    headers = {'Accept': 'application/json', 'X-Api-Key': api_key}

    url = f'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{pair}/ob_aggregations/volume_depth'
    params = {
        "start_time": start_time,
        "end_time": end_time,
        "interval": interval,
        "sort": sort,
        "page_size": page_size
    }

    try:
        res = requests.get(url, headers=headers, params=params)
        res.raise_for_status()
        data = res.json()
        if 'data' not in data:
            print("No data returned.")
            return pd.DataFrame()
        df = pd.DataFrame(data['data'])

        # Handle pagination with next_url
        while data.get('next_url'):
            res = requests.get(data['next_url'], headers=headers)
            res.raise_for_status()
            data = res.json()
            if 'data' in data:
                df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
        return df

    except requests.exceptions.RequestException as e:
        print(f"API request error: {e}")
        return pd.DataFrame()

# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time, interval=interval, sort=sort, page_size=int(page_size))
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Response example

{% tabs %}
{% tab title="JSON" %}

```json
{
    "query": {
        "interval": "1h",
        "aggregation": "volume_depth",
        "start_time": "2026-11-03T00:00:00.000Z",
        "start_timestamp": 1793664000000,
        "end_time": "2026-11-04T00:00:00.000Z",
        "end_timestamp": 1793750400000,
        "exchange": "krkn",
        "instrument_class": "spot",
        "instrument": "btc-usd",
        "slippage": 0,
        "slippage_ref": "mid_price",
        "sort": "desc",
        "page_size": 10,
        "request_time": "2026-11-05T13:20:30.774Z",
        "data_version": "v1",
        "commodity": "order_book_snapshots"
    },
    "time": "2026-11-05T13:20:30.774Z",
    "timestamp": 1793884830774,
    "data": [
        {
            "poll_timestamp": 1793667600000,
            "bid_volume_5bps": "21.348000000000013",
            "bid_usd_million_5bps": "1.6434191192",
            "bid_order_count_5bps": 48,
            "bid_volume_10bps": "72.61700000000002",
            "bid_usd_million_10bps": "5.588512953999999",
            "bid_order_count_10bps": 100,
            "bid_volume_15bps": "107.54200000000003",
            "bid_usd_million_15bps": "8.2749086291",
            "bid_order_count_15bps": 129,
            "bid_volume_20bps": "142.31400000000005",
            "bid_usd_million_20bps": "10.9478278036",
            "bid_order_count_20bps": 146,
            "bid_volume_25bps": "186.43900000000005",
            "bid_usd_million_25bps": "14.3378413316",
            "bid_order_count_25bps": 154,
            "bid_volume_50bps": "250.3110000000002",
            "bid_usd_million_50bps": "19.23681240950001",
            "bid_order_count_50bps": 206,
            "bid_volume_75bps": "258.5450000000001",
            "bid_usd_million_75bps": "19.866946559900004",
            "bid_order_count_75bps": 271,
            "bid_volume_100bps": "267.55899999999923",
            "bid_usd_million_100bps": "20.55518946350001",
            "bid_order_count_100bps": 334,
            "bid_volume_125bps": "273.3309999999985",
            "bid_usd_million_125bps": "20.994642987800017",
            "bid_order_count_125bps": 419,
            "bid_volume_150bps": null,
            "bid_usd_million_150bps": null,
            "bid_order_count_150bps": null,
            "bid_volume_175bps": null,
            "bid_usd_million_175bps": null,
            "bid_order_count_175bps": null,
            "bid_volume_200bps": null,
            "bid_usd_million_200bps": null,
            "bid_order_count_200bps": null,
            "bid_volume_225bps": null,
            "bid_usd_million_225bps": null,
            "bid_order_count_225bps": null,
            "bid_volume_250bps": null,
            "bid_usd_million_250bps": null,
            "bid_order_count_250bps": null,
            "bid_volume_275bps": null,
            "bid_usd_million_275bps": null,
            "bid_order_count_275bps": null,
            "bid_volume_300bps": null,
            "bid_usd_million_300bps": null,
            "bid_order_count_300bps": null,
            "bid_volume_325bps": null,
            "bid_usd_million_325bps": null,
            "bid_order_count_325bps": null,
            "bid_volume_350bps": null,
            "bid_usd_million_350bps": null,
            "bid_order_count_350bps": null,
            "bid_volume_375bps": null,
            "bid_usd_million_375bps": null,
            "bid_order_count_375bps": null,
            "bid_volume_400bps": null,
            "bid_usd_million_400bps": null,
            "bid_order_count_400bps": null,
            "bid_volume_425bps": null,
            "bid_usd_million_425bps": null,
            "bid_order_count_425bps": null,
            "bid_volume_450bps": null,
            "bid_usd_million_450bps": null,
            "bid_order_count_450bps": null,
            "bid_volume_475bps": null,
            "bid_usd_million_475bps": null,
            "bid_order_count_475bps": null,
            "bid_volume_500bps": null,
            "bid_usd_million_500bps": null,
            "bid_order_count_500bps": null,
            "ask_volume_5bps": "51.521",
            "ask_usd_million_5bps": "3.968347868600001",
            "ask_order_count_5bps": 74,
            "ask_volume_10bps": "94.64000000000006",
            "ask_usd_million_10bps": "7.291267063700004",
            "ask_order_count_10bps": 112,
            "ask_volume_15bps": "115.87800000000009",
            "ask_usd_million_15bps": "8.929055878000007",
            "ask_order_count_15bps": 131,
            "ask_volume_20bps": "157.84700000000007",
            "ask_usd_million_20bps": "12.166482296300007",
            "ask_order_count_20bps": 150,
            "ask_volume_25bps": "196.88600000000005",
            "ask_usd_million_25bps": "15.179438942700008",
            "ask_order_count_25bps": 169,
            "ask_volume_50bps": "200.05400000000023",
            "ask_usd_million_50bps": "15.424324578900006",
            "ask_order_count_50bps": 226,
            "ask_volume_75bps": "242.45100000000042",
            "ask_usd_million_75bps": "18.708967383099996",
            "ask_order_count_75bps": 273,
            "ask_volume_100bps": "251.49400000000063",
            "ask_usd_million_100bps": "19.411842045699995",
            "ask_order_count_100bps": 303,
            "ask_volume_125bps": "257.7070000000006",
            "ask_usd_million_125bps": "19.895589949399994",
            "ask_order_count_125bps": 330,
            "ask_volume_150bps": "259.79500000000036",
            "ask_usd_million_150bps": "20.058473725599995",
            "ask_order_count_150bps": 348,
            "ask_volume_175bps": "275.43600000000015",
            "ask_usd_million_175bps": "21.282539137",
            "ask_order_count_175bps": 368,
            "ask_volume_200bps": "276.00299999999976",
            "ask_usd_million_200bps": "21.327019808999996",
            "ask_order_count_200bps": 396,
            "ask_volume_225bps": "277.1279999999997",
            "ask_usd_million_225bps": "21.41550535379999",
            "ask_order_count_225bps": 420,
            "ask_volume_250bps": "305.22199999999924",
            "ask_usd_million_250bps": "23.628961655199987",
            "ask_order_count_250bps": 461,
            "ask_volume_275bps": null,
            "ask_usd_million_275bps": null,
            "ask_order_count_275bps": null,
            "ask_volume_300bps": null,
            "ask_usd_million_300bps": null,
            "ask_order_count_300bps": null,
            "ask_volume_325bps": null,
            "ask_usd_million_325bps": null,
            "ask_order_count_325bps": null,
            "ask_volume_350bps": null,
            "ask_usd_million_350bps": null,
            "ask_order_count_350bps": null,
            "ask_volume_375bps": null,
            "ask_usd_million_375bps": null,
            "ask_order_count_375bps": null,
            "ask_volume_400bps": null,
            "ask_usd_million_400bps": null,
            "ask_order_count_400bps": null,
            "ask_volume_425bps": null,
            "ask_usd_million_425bps": null,
            "ask_order_count_425bps": null,
            "ask_volume_450bps": null,
            "ask_usd_million_450bps": null,
            "ask_order_count_450bps": null,
            "ask_volume_475bps": null,
            "ask_usd_million_475bps": null,
            "ask_order_count_475bps": null,
            "ask_volume_500bps": null,
            "ask_usd_million_500bps": null,
            "ask_order_count_500bps": null
        }
      /* ... */
    ],
    "result": "success",
    "continuation_token": "<token>",
    "next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/ob_aggregations/volume_depth?continuation_token=<token>",
    "access": {
        "access_range": {
            "start_timestamp": 1654041600000,
            "end_timestamp": 1901311200000
        },
        "data_range": {
            "start_timestamp": 1654041600000,
            "end_timestamp": 1901311200000
        }
    }
}
```

{% endtab %}
{% endtabs %}


---

# 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/market-depth-in-basis-points-snapshot.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.
