跳到主要内容

获取历史K线数据

限速规则 20次/1s (IP)

描述

获取历史K线数据

HTTP请求

  • GET /api/v2/spot/market/history-candles
请求示例
curl "https://api.bitget.com/api/v2/spot/market/history-candles?symbol=BTCUSDT&granularity=1min&endTime=1659080270000&limit=100"

请求参数

参数名参数类型是否必须描述
symbolString交易对名称
granularityStringK线的时间间隔
分钟:1min,5min,15min,30min
小时:1h,4h,6h,12h
天:1day,3day
周:1week
月:1M
零时区小时线:6Hutc,12Hutc
零时区日线:1Dutc ,3Dutc
零时区周线:1Wutc
零时区月线:1Mutc
endTimeStringK线数据的时间终止点,即获取该时间戳以前的K线数据
Unix毫秒时间戳,例如1690196141868
limitString查询条数 默认100,最大200
返回示例
{
"code": "00000",
"msg": "success",
"requestTime": 1695799900330,
"data": [
[
"1646064000000",
"43500.8",
"48207.2",
"38516",
"46451.9",
"2581.4668",
"118062073.82644",
"118062073.82644"
],
[
"1648742400000",
"46451.9",
"55199.6",
"15522.1",
"38892.5",
"42331329.5473",
"1726993402150.991724",
"1726993402150.991724"
],
[
"1654012800000",
"38892.5",
"38892.5",
"38892.5",
"38892.5",
"0",
"0",
"0"
],
[
"1654012800000",
"39270.4",
"39270.4",
"37834.5",
"37834.5",
"42.444",
"1619934.779",
"1619934.779"
],
[
"1656604800000",
"37834.5",
"37849.5",
"37773.5",
"37773.5",
"428.3462",
"16198849.1079",
"16198849.1079"
]
]
}

返回参数

返回字段参数类型字段说明
index[0]String系统时间戳,Unix毫秒时间戳,例如1690196141868
index[1]String开盘价格
index[2]String最高价格
index[3]String最低价格
index[4]String收盘价格
index[5]String基础币成交量,如BTCUSDT交易对中的BTC
index[6]StringUSDT成交量
index[7]String计价币成交量,如BTCUSDT交易对中的USDT