-
Notifications
You must be signed in to change notification settings - Fork 5
REST 成交历史数据
CoinTiger-API edited this page Jan 7, 2019
·
4 revisions
NOTE
替换$symbol$为tchbtc, ethbtc等相应币对
请求参数:
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
symbol | true | String | 交易对 | tchbtc, ethbtc,btcbitcny,eosbtc | |
size | false | Integer | 获取数量 | 1 | [1,2000] |
响应数据:
参数名称 | 是否必须 | 类型 | 描述 | 取值范围 |
---|---|---|---|---|
code | true | String | 请求处理状态 | 0成功 非0具体错误原因 |
msg | true | String | 具体错误描述or成功描述 | |
ch | true | String | 数据所属的 channel, 格式:market.$symbol$.trade.detail |
|
size | true | Integer | 获取数量 |
data 说明:
"trade_data": [
{
"id": 460760, //交易ID
"side": "SELL", //买卖方向buy,sell
"price": 49375.30927674, //单价
"vol": 0.0009, //数量
"amount": 44.43777834, //总额
"ts": 1521747240000, //数据产生时间
"ds": "2018-03-23 03:34:00" //格式化的数据产生时间
}
]
请求响应示例:
/* GET /api/market/history/trade?symbol=btcbitcny&size=200
{
"code": "0",
"msg": "suc",
"data": {
"trade_data": [
{
"id": 460760,
"side": "SELL",
"price": 49375.30927674,
"vol": 0.0009,
"amount": 44.43777834,
"ts": 1521747240000,
"ds": "2018-03-23 03:34:00"
},
{
"id": 460759,
"side": "SELL",
"price": 49380.2519515,
"vol": 0.001,
"amount": 49.38025195,
"ts": 1521747237000,
"ds": "2018-03-23 03:33:57"
}
],
"size": 2,
"ch": "market.btcbitcny_trade.detail"
}
}
/* GET /api/market/history/trade?symbol=btcbitcny&size=200
{
"code": "2",
"msg": "您已超出API调用次数限制",
"data": null
}
/* GET /api/market/history/trade?symbol=not-exist&size=200
{
"code": "2",
"msg": "symbol 不能为空",
"data": null
}
/* GET /api/market/history/trade?symbol=btcbitcny&size=3000
{
"code": "2",
"msg": "size 请求参数不合法", //参数范围: [1,2000]
"data": null
}
English Documents click here