Bitcoin指数:0.00 上证指数:0.00

BTC期货行情API

来源: btc-q 发布时间: 2014-10-16 17:19:27

BTC-Q期货行情API


1.获取当前合约(4个)
2.市场行情(买一卖一最高最低最新成交量)
3.市场深度(100条)
4.历史交易记录(100条)


当前合约:

获取当前在使用的合约(4个,本月下月以及随后两个季月)。
URL:https://www.btc-q.com/futuresApi/trans.do

返回值:
获取成功:["btc1407", "btc1408", "btc1409", "btc1412"]


市场行情:
获取市场行情,最新价,最高价,最低价,成交量,买一价和卖一价,1秒更新一次。
URL:https://www.btc-q.com/futuresApi/ticker.do
返回值:
获取成功: {"ticker":[{"vol":"0.00","last":"3587.00","buy":"0.00","sell":"0.00","bqCode":"btc1407","high":"0.00","low":"0.00"},{"vol":"0.00","last":"0.00","buy":"0.00","sell":"0.00","bqCode":"btc1408","high":"0.00","low":"0.00"},{"vol":"0.00","last":"0.00","buy":"0.00","sell":"0.00","bqCode":"btc1409","high":"0.00","low":"0.00"},{"vol":"0.00","last":"0.00","buy":"0.00","sell":"0.00","bqCode":"btc1412","high":"0.00","low":"0.00"}]}


参数说明:

high:最高价
low:最低价
buy:买一价
sell:卖一价
last:最新成交价
vol:成交量


市场深度:

获取市场深度(委托挂单),数量:100,1秒更新一次。Type为当前合约号, 参数小写
URL:https://www.btc-q.com/futuresApi/depth.do?type=btc1407

https://www.btc-q.com/futuresApi/depth.do?type=btc1408

https://www.btc-q.com/futuresApi/depth.do?type=btc1409

https://www.btc-q.com/futuresApi/depth.do?type=btc1412

参数值:type 合约号, 只能是当前的四个合约。例btc1407

返回值:
获取成功:{"asks":[["887.00","30"],["875.00","0.4"],...],"bids":[["758.09","0.1"],["758.08","6.16"],...]}


参数说明:

asks:委托卖单深度
bids:委托买单深度


交易记录:

获取历史成交记录,数量:100,1秒更新一次。
URL:https://www.btc-q.com/futuresApi/trades.do?type=btc1407

https://www.btc-q.com/futuresApi/trades.do?type=btc1408

https://www.btc-q.com/futuresApi/trades.do?type=btc1409

https://www.btc-q.com/futuresApi/trades.do?type=btc1412

参数值:type 合约号, 只能是当前的四个合约。例btc1407
返回值:
获取成功: [{"amount":"10.00","price":"3587.00","tid":17,"type":"sell","date":1407769382},{"amount":"10.00","price":"3587.00","tid":16,"type":"sell","date":1407769382} ,{"amount":"10.00","price":"3551.00","tid":9,"type":"buy","date":1407768997},……]


参数说明:
date:成交时间
price:成交价
amount:数量
type:交易方向
tid:交易号