OHLCV Candlesticks

You can also get OHLCV Candlesticks from the Trade Count, OHLCV Candlesticks & VWAP endpoint.

What is this endpoint for?

This endpoint retrieves the OHLCV history for an instrument on an exchange.

Endpoint

https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{instrument}/aggregations/ohlcv

Parameters

ParameterRequiredDescription

exchange

Yes

instrument_class

Yes

instrument

Yes

end_time

No

Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.

continuation_token

No

interval

No

The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, hours or days, respectively. 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 s (second), m (minute), h (hour) and d (day). Default 1d.

page_size

No

(min: 1, default: 100, max: 100000). See Pagination Automatically included in continuation tokens.

start_time

No

Starting time in ISO 8601 (inclusive).

sort

No

Return the data in ascending (asc) or descending (desc) order. Default desc Automatically included in continuation tokens.

Fields

FieldDescription

timestamp

Timestamp at which the interval begins.

open

Opening price of interval. null when no trades reported.

high

Highest price during interval. null when no trades reported.

low

Lowest price during interval. null when no trades reported.

close

Closing price of interval. null when no trades reported.

volume

Volume traded in interval. 0 when no trades reported.

Request examples

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-usd/aggregations/ohlcv'

Response example

{
    "query": {
        "page_size": 100,
        "exchange": "cbse",
        "instrument_class": "spot",
        "instrument": "btc-usd",
        "interval": "1d",
        "sort": "desc",
        "aggregation": "ohlcv",
        "data_version": "v1",
        "commodity": "trades",
        "request_time": "2020-05-26T17:25:56.221Z"
    },
    "time": "2020-05-26T17:26:00.160Z",
    "timestamp": 1590513960160,
    "data": [
        {
            "timestamp": 1590451200000,
            "open": "8900.0",
            "high": "9016.99",
            "low": "8694.23",
            "close": "8811.36",
            "volume": "9014.60281966"
        },
        {
            "timestamp": 1590364800000,
            "open": "8715.69",
            "high": "8977.0",
            "low": "8632.93",
            "close": "8899.31",
            "volume": "12091.06145914"
        },
  /* ... */
  ],
  "result": "success",
  "continuation_token": "rbd2bcDp35GmDscQbvZ9YzQHZJkT3jdeFx9fSBDdVmcCZaHvQRTCTfmfQ6QCrvDNp5ciRRuGPTedVL5LMZv1qmSXhRpZFbpvBW2uA62RSYpfJ1hVykJKZfhtmXXrxz",
  "next_url": "https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/krkn/spot/btc-usd/aggregations/ohlcv?continuation_token=rbd2bcDp35GmDqdfaz3fZJkT3jdeFx9fSBDdVmcCZaHvQRTCTfmfQ6QCrvDNp5ciRRuGPTedVL5LMZv1qmSXhRpZFbpvBW2uA62RSYpfJ1hVykJKZfhtmXXrxz",
  "access": {
    "access_range": {
      "start_timestamp": null,
      "end_timestamp": null
    },
    "data_range": {
      "start_timestamp": null,
      "end_timestamp": null
    }
  }
}

Last updated