Skip to main content
GET
/
gateway
/
v1
/
exchange
/
klines
Exchange OHLCV Candlesticks
curl --request GET \
  --url https://api.ask.surf/gateway/v1/exchange/klines
{
  "data": [
    {
      "candles": [
        {
          "close": 123,
          "high": 123,
          "low": 123,
          "open": 123,
          "timestamp": 123,
          "volume": 123
        }
      ],
      "count": 123,
      "exchange": "<string>",
      "interval": "<string>",
      "pair": "<string>",
      "period_end": "<string>",
      "period_high": 123,
      "period_low": 123,
      "period_start": "<string>",
      "period_volume": 123
    }
  ],
  "meta": {
    "cached": true,
    "credits_used": 123
  },
  "$schema": "<string>"
}

Query Parameters

pair
string
required

Trading pair (e.g. BTC/USDT)

Example:

"BTC/USDT"

type
enum<string>
default:spot

Market type: spot for spot trading, swap for perpetual contracts

Available options:
spot,
swap
Example:

"spot"

interval
enum<string>
default:1h

Candle interval

Available options:
1m,
3m,
5m,
15m,
30m,
1h,
2h,
4h,
6h,
8h,
12h,
1d,
3d,
1w,
1M
Example:

"1h"

from
string

Start of time range. Accepts Unix seconds or date string (YYYY-MM-DD, ISO8601)

Example:

"2026-03-01"

limit
integer<int64>
default:100

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.

Required range: 1 <= x <= 1000
Example:

100

exchange
enum<string>
default:binance

Exchange identifier

Available options:
binance,
okx,
bybit,
bitget,
coinbase,
kraken,
gate,
htx,
kucoin,
mexc,
upbit,
bitfinex,
bitstamp,
deribit,
bitmex,
bithumb
Example:

"binance"

Response

OK

data
object[] | null
required
meta
object
required
$schema
string<uri>

A URL to the JSON Schema for this object.

Example:

"https://example.com/schemas/SimpleListResponseExchangeKlineResponse.json"