> 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/trade-metrics/trade-frequency.md). Agents can also search and read this documentation through its [MCP server](https://docs.kaiko.com/~gitbook/mcp).

# Trade frequency

{% hint style="info" %}

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

* **Level 1 & Level 2 Data** \[Level 1 Aggregations Tier]
* **Level 1 & Level 2 Data** \[Level 1 Tick-Level Tier]
* **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 trade statistics for a spot pair per interval: the number of trades, buy and sell counts and volumes, total volume in the base asset and in USD, the average trade size and the interval's prices. Buy and sell are measured by aggressor side.

### Endpoint

{% code overflow="wrap" %}

```http
https://{region}.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{instrument}/aggregations/trade_stats
```

{% 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>.</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>, for example <code>btc-usd</code>.</td></tr></tbody></table>

### Query Parameters

<table><thead><tr><th width="241">Parameter</th><th width="97">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>Interval of each row: <code>1m</code>, <code>1h</code> or <code>1d</code>. Default <code>1d</code>.</td></tr><tr><td><code>page_size</code></td><td>No</td><td>Rows per page. Default 100.<br><br>See <a data-mention href="https://docs.kaiko.com/rest-api/general/getting-started/pagination.md">Pagination</a></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 <code>desc</code>.</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

<table><thead><tr><th width="233">Field</th><th>Description</th></tr></thead><tbody><tr><td><code>timestamp</code></td><td>Start of the interval, in Unix milliseconds.</td></tr><tr><td><code>count</code></td><td>Number of trades in the interval.</td></tr><tr><td><code>open</code></td><td>First trade price of the interval.</td></tr><tr><td><code>high</code></td><td>Highest trade price of the interval.</td></tr><tr><td><code>low</code></td><td>Lowest trade price of the interval.</td></tr><tr><td><code>close</code></td><td>Last trade price of the interval.</td></tr><tr><td><code>volume</code></td><td>Total volume, in the base asset.</td></tr><tr><td><code>volume_usd</code></td><td>Total volume, converted to USD.</td></tr><tr><td><code>price</code></td><td>VWAP (volume-weighted average price) of the interval.</td></tr><tr><td><code>buy_count</code></td><td>Number of buy-aggressor trades.</td></tr><tr><td><code>sell_count</code></td><td>Number of sell-aggressor trades.</td></tr><tr><td><code>buy_volume</code></td><td>Buy-aggressor volume, in the base asset.</td></tr><tr><td><code>sell_volume</code></td><td>Sell-aggressor volume, in the base asset.</td></tr><tr><td><code>average_trade_size_usd</code></td><td>Average trade size in USD (<code>volume_usd</code> / <code>count</code>).</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/trades.v1/exchanges/cbse/spot/btc-usdt/aggregations/trade_stats?interval=1d'
```

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

### Response example

```json
{
  "query": {
    "interval": "1d",
    "aggregation": "trade_stats",
    "exchange": "cbse",
    "instrument_class": "spot",
    "instrument": "btc-usdt",
    "sort": "desc",
    "page_size": 100,
    /* ... */
  },
  "data": [
    {
      "timestamp": 1793577600000,
      "count": 440,
      "open": "78389.2",
      "high": "78832.25",
      "low": "77635.04",
      "close": "77666.28",
      "volume": "2.5879071899999984",
      "volume_usd": "202170.7621765902",
      "price": "78223.3153257396",
      "buy_count": 344,
      "sell_count": 96,
      "buy_volume": "1.8568125800000026",
      "sell_volume": "0.7310946100000002",
      "average_trade_size_usd": "459.4790049467959"
    },
    /* ... */
  ],
  "result": "success",
  /* ... */
}
```


---

# 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/trade-metrics/trade-frequency.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.
