获取指数价格 K 线
获取K线数据
(鉴权类型:NONE, 参见接口权限)
请求格式
GET https://api-cloud.bitmart.com/contract/v1/ifcontract/indexquote
请求限制
参见 速率限制详细
请求参数
参数 | 类型 | 是否必须 | 描述 |
---|---|---|---|
indexID | long | 是 | 指数 ID |
startTime | long | 是 | 开始时间 |
endTime | long | 是 | 结束时间 |
unit | int | 是 | 频率 |
resolution | string | 是 | 频率单位,M:分钟,H:小时,D:天 |
解释说明
请求示例
curl https://api-cloud.bitmart.com/contract/v1/ifcontract/indexquote?indexID=1&startTime=1584343602&endTime=1585343602&unit=5&resolution=M
响应详情
字段 | 类型 | 描述 |
---|---|---|
low | string | 最低价 |
high | string | 最高价 |
open | string | 开盘价 |
close | string | 收盘价 |
last_price | string | 最后一次交易价 |
avg_price | string | 均价 |
volume | string | 交易量 |
timestamp | string | 时间戳,单位秒 |
rise_fall_rate | string | 涨跌幅比例 |
rise_fall_value | string | 涨跌幅值 |
返回数据格式示例
{
"code": 1000,
"trace":"886fb6ae-456b-4654-b4e0-d681ac05cea1",
"message": "OK",
"data": [
{
"low": "130",
"high": "130",
"open": "130",
"close": "130",
"last_price": "130",
"avg_price": "130",
"volume": "0",
"timestamp": 1532610000,
"rise_fall_rate": "0",
"rise_fall_value": "0"
}
]
}