---
title: "Exchange OHLCV Candlesticks"
method: GET
path: "/gateway/v1/exchange/klines"
tags: ["Exchange"]
---

# Exchange OHLCV Candlesticks

`GET /gateway/v1/exchange/klines`

Returns OHLCV candlestick data with period summary stats (high, low, total volume).

**Intervals:** 15 options from `1m` to `1M`.

**Pagination:** use `from` to set the start time and `limit` to control candle count. For longer ranges, pass the last returned candle's timestamp as the next `from` value. Exchange-side limits vary (200–1000 per request).

Set `type=swap` to query perpetual contract candles instead of spot.

## Query parameters

- `pair` string, required — Trading pair (e.g. BTC/USDT)
- `type` 'spot' | 'swap' | 'perpetual' | 'perp' — Market type: spot for spot trading, swap/perpetual/perp for perpetual contracts
- `interval` '1m' | '3m' | '5m' | '15m' | '30m' | '1h' | '2h' | '4h' | '6h' | '8h' | '12h' | '1d' | '3d' | '1w' | '1M' — Candle size — bucket duration for each returned OHLCV row. This endpoint uses `interval` only; it does NOT accept `time_range`. Use `from` + `limit` to control the window.
- `from` string — Start of time range. Accepts Unix seconds or date string (YYYY-MM-DD, ISO8601)
- `limit` integer — Max number of candles to return. Exchange may cap lower (e.g. 200-1000). For longer ranges, paginate using the last returned timestamp as the next from value.
- `exchange` 'binance' | 'okx' | 'bybit' | 'bitget' | 'coinbase' | 'kraken' | 'gate' | 'htx' | 'kucoin' | 'mexc' | 'upbit' | 'bitfinex' | 'bitstamp' | 'deribit' | 'bitmex' | 'bithumb' | 'hyperliquid' — Exchange identifier. Note: hyperliquid uses USDC-settled perps (e.g. BTC/USDC:USDC); pass USDC-quoted pairs when querying hyperliquid.

## Response `200`

OK

- SimpleListResponseExchangeKlineResponse
  - `$schema` string, uri — A URL to the JSON Schema for this object.
  - `data` ExchangeKlineResponse[], nullable, required
    - `candles` ExchangeKlineItem[], nullable, required — OHLCV candles
      - `close` number, double, required — Closing price
      - `high` number, double, required — Highest price during the interval
      - `low` number, double, required — Lowest price during the interval
      - `open` number, double, required — Opening price
      - `timestamp` integer, nullable, required — Candle open time in Unix seconds
      - `volume` number, double, required — Trading volume in base currency units
    - `count` integer, required — Number of candles
    - `exchange` string, required — Exchange identifier
    - `interval` string, required — Candle interval
    - `pair` string, required — Trading pair
    - `period_end` string, nullable, required — Last candle datetime
    - `period_high` number, double, nullable, required — Highest price in period
    - `period_low` number, double, nullable, required — Lowest price in period
    - `period_start` string, nullable, required — First candle datetime
    - `period_volume` number, double, nullable, required — Total volume in period
  - `meta` ObjectResponseMeta, required
    - `cached` boolean, required — Whether this response was served from cache
    - `credits_used` integer, required — Credits deducted for this request
    - `empty_reason` string — Hint explaining why the data array is empty, when applicable

## Other responses

- `default` — Error

---

[API](https://skmtc.dev/asksurf/apis/asksurf-public-rest-api.md) · [All operations](https://skmtc.dev/asksurf/apis/asksurf-public-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/asksurf/asksurf-public-rest-api/revisions/4153a9cb5145/schema)
