Historical Candles

GET/gateway/v1/exchange/candles

Returns persisted OHLCV candles for a covered spot market.

Intervals: `5m`, `4h`, and `1w`. bitFlyer is currently reliable for weekly (`1w`) OHLCV only.

Pagination: use `from`/`to` to bound the time range and `limit` to cap returned candles. Results are ordered newest first.

Synthetic candles: `include_synthetic=true` by default, so carry-forward candles for no-trade intervals are included for continuous charts. Set `include_synthetic=false` for raw exchange-only candles.

Query Parameters

exchangeenum<string>required

Exchange identifier

Available options:bithumbupbithashkeybitflyer
Example: bithumb
pairstringrequired

Trading pair in base/quote form, e.g. BTC/KRW

Example: BTC/KRW
intervalenum<string>

Candle interval

Available options:5m4h1w
Example: 5m
fromstring

Start of time range. Accepts Unix seconds or date string

Example: 2026-06-24T09:00:00Z
tostring

End of time range. Accepts Unix seconds or date string

Example: 2026-06-24T10:00:00Z
include_syntheticboolean

Whether to include carry-forward candles for no-trade intervals. Defaults to true for continuous charts; set false for raw exchange-only candles.

Example: true
limitinteger

Max number of candles to return. Weekly candles allow up to 300 rows for a 5-year chart; intraday intervals are capped at 100.

Example: 100
offsetinteger

Pagination offset

Example: 0
Historical Candles
const options = {method: 'GET'};

fetch('https://api.asksurf.ai/gateway/v1/exchange/candles?exchange=bithumb&pair=BTC/KRW&interval=5m&from=2026-06-24T09:00:00Z&to=2026-06-24T10:00:00Z&include_synthetic=true&limit=100&offset=0', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
OK
{
  "$schema": "https://example.com/schemas/DataResponseExchangeCandleItem.json",
  "data": [
    {
      "close": 123,
      "close_time": 123,
      "exchange": "<string>",
      "high": 123,
      "interval": "<string>",
      "is_synthetic": true,
      "low": 123,
      "open": 123,
      "pair": "<string>",
      "region": "<string>",
      "timestamp": 123,
      "trade_count": 123,
      "volume_base": 123,
      "volume_quote": 123
    }
  ],
  "meta": {
    "cached": true,
    "credits_used": 123,
    "empty_reason": "<string>",
    "has_more": true,
    "limit": 123,
    "offset": 123,
    "total": 123,
    "watermark": 123
  }
}