Skip to content

Get Kline ​

Rate Limit: 10 req/sec/ip

Description ​

Interface is used to get future kline history.

HTTP Request ​

  • GET /api/v1/futures/market/kline

Request Parameters ​

ParameterTypeRequiredDescription
symbolstringtrueTrading pair, based on the symbolName, i.e. BTCUSDT
endTimeint64falseExclusive end bound. Query limit klines before this time. Unix timestamp in milliseconds, e.g. 1672410000000. Best practice: align to the interval open time. If omitted, the current forming candle open time is used
intervalstringtruekline interval such as 1m 5m 15m 30m 1h 2h 4h 6h 8h 12h 1d 3d 1w 1M
limitintfalseNumber of klines to return, counting backward from endTime. Default: 100, maximum: 200
typestringfalseKline type, values: LAST_PRICE, MARK_PRICE; default: LAST_PRICE

Request Example

Query the 2 closed 15m candles before 2022-12-30 16:00:00 UTC. endTime is the 16:00 candle open time, so that candle is not included; the response is 15:30 and 15:45.

bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/futures/market/kline?symbol=BTCUSDT&interval=15m&endTime=1672410000000&limit=2'

Omit endTime to take the latest closed candles from the current interval open time:

bash
curl -X 'GET' --location 'https://fapi.bitunix.com/api/v1/futures/market/kline?symbol=BTCUSDT&interval=15m&limit=100'

Response Parameters ​

ParameterTypeDescription
openstringopen price
highstringhigh price
lowstringlow price
closestringclose price
quoteVolstringTrading amount (quote currency turnover) for the kline period
baseVolstringTrading volume (base coin) for the kline period
timeint64Candle open time, Unix timestamp in milliseconds. This is the open time, not the close time. Only closed candles are returned; the candle that is still forming is not included.

Response Example

json
{"code":0,"data":[{"open":"60000","high":"60001","close":"60000","low":"59989.2","time":111111,"quoteVol":"1","baseVol":"60000","type":"LAST_PRICE"}],"msg":"Success"}