> 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/general/getting-started-new-api.md).

# Getting started - New API

All New API endpoints share one host, one authentication method and one response format. This section covers the rules they have in common. Each endpoint's page then lists its own parameters and fields.

|                  |                                                                                                                                                    |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Base URL         | `https://api.kaiko.io`                                                                                                                             |
| Method           | `GET` on every endpoint                                                                                                                            |
| Authentication   | `X-Api-Key` header. See [Authentication](https://docs.kaiko.com/rest-api/general/getting-started-new-api/authentication.md).                       |
| Parameters       | Query string only. See [Requests](https://docs.kaiko.com/rest-api/general/getting-started-new-api/requests.md).                                    |
| Success response | JSON with `data` and `meta`. See [Responses](https://docs.kaiko.com/rest-api/general/getting-started-new-api/responses.md).                        |
| Error response   | `application/problem+json` with a stable `code`. See [Errors](https://docs.kaiko.com/rest-api/general/getting-started-new-api/errors.md).          |
| Versioning       | `api_version` query parameter, as a date. See [API versioning](https://docs.kaiko.com/rest-api/general/getting-started-new-api/api-versioning.md). |

### Your first request

This request returns hourly OHLCV candles for BTC-USD and ETH-USD on Coinbase:

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

```bash
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://api.kaiko.io/market-data/trades/batch-ohlcv?exchange=cbse&class=spot&instrument=btc-usd,eth-usd&interval=1h&start_time=2026-11-01T00:00:00Z&end_time=2026-11-01T02:00:00Z'
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}

```python
import requests

response = requests.get(
    "https://api.kaiko.io/market-data/trades/batch-ohlcv",
    headers={"Accept": "application/json", "X-Api-Key": "YOUR_API_KEY"},
    params={
        "exchange": "cbse",
        "class": "spot",
        "instrument": "btc-usd,eth-usd",
        "interval": "1h",
        "start_time": "2026-11-01T00:00:00Z",
        "end_time": "2026-11-01T02:00:00Z",
    },
)
response.raise_for_status()
print(response.json()["data"])
```

{% endtab %}
{% endtabs %}

The response (shortened to the first two rows):

```json
{
  "data": [
    {
      "close": "77586.09",
      "high": "77635.91",
      "instrument": "btc-usd",
      "low": "77503.11",
      "open": "77533.78",
      "timestamp": "2026-11-01T01:00:00.000Z",
      "volume": "52.32883571000001"
    },
    {
      "close": "2266.86",
      "high": "2269.19",
      "instrument": "eth-usd",
      "low": "2258.77",
      "open": "2259.15",
      "timestamp": "2026-11-01T01:00:00.000Z",
      "volume": "2179.464944500002"
    }
  ],
  "meta": {
    "api_version": "2026-10-01",
    "count": 4,
    "next_url": null,
    "url": "https://api.kaiko.io/market-data/trades/batch-ohlcv?exchange=cbse&class=spot&instrument=btc-usd,eth-usd&interval=1h&start_time=2026-11-01T00:00:00Z&end_time=2026-11-01T02:00:00Z&api_version=2026-10-01"
  }
}
```


---

# 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/general/getting-started-new-api.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.
