ticker
, trades
, depth
;用户 API 包括 info
, orders
, order
, transactions
, trade
, cancel
{'status': xxx, 'message': 'xxx', 'result': xxx}
During a normal request, status is 200 and result returns the content. When there is a request error, status is not 200, message will return a specific error message
API | Identity Verification Required | Function |
---|---|---|
/ticker/ | - | Get the latest quotes |
/trades/ | - | Get the latest transaction list |
/depth/ | - | Get the latest depth |
/info/ | 获取用户资产 | |
/orders/ | 获取用户委托列表 | |
/order/ | 获取单个委托 | |
/transactions/ | 获取用户成交列表 | |
/trade/ | 下单 | |
/cancel/ | Cancel |
/ticker/
{
"status": 200,
"message": "ok",
"result": {
"last": "600",
"sell": "610.77",
"buy": "590",
"high": "650",
"low": "550",
"vol": "9",
}
}
/trades/
{
"status": 200,
"message": "ok",
"result": [
{
"date": 1407694316,
"amount": "38.9998",
"price": "2",
"id": 3355
},
{
"date": 1406813788,
"amount": "0.1",
"price": "582.6",
"id": 3205
}
]
}
/depth/
{
"status": 200,
"message": "ok",
"result": {
"bids": [
[
3.0,
1.2345
],
[
1.0,
82.99
]
],
"asks": [
[
4.0,
1.2345
]
]
}
}
/info/
{
"status": 200,
"message": "ok",
"result": {
"wallet": {
"usd": {
"avail": "1171.16",
"lock": "8830.54"
},
"btc": {
"avail": "38.99984835",
"lock": "61"
},
"cny": {
"avail": "0",
"lock": "0"
}
},
"fund": {
"arbitrage": {
"usd": {
"avail": "0",
"last_income": "0",
"last_earn": "0"
},
"btc": {
"avail": "0",
"last_income": "0",
"last_earn": "0"
}
}
}
}
}
wallet 是用户钱包,avail 为可用余额,lock 为冻结;fund 是用户基金,arbitrage 是套利宝,last_income 和 last_earn 表示昨日收益及昨日奖励
/orders/
{
"status": 200,
"message": "ok",
"result": [
{
"status": 3,
"created_at": "2014/08/10 18:14:57",
"money_deal": "0",
"amount_deal": "0",
"updated_at": "2014/08/10 18:14:57",
"id": 4317,
"catalog": 0,
"order_type": 0,
"avg_price": "0",
"market": "btc_usdt",
"fee": "0",
"price": "3",
"amount": "1.2345"
},
{
"status": 0,
"created_at": "2014/08/10 18:13:12",
"money_deal": "90",
"amount_deal": "1",
"updated_at": "2014/08/10 18:13:12",
"id": 4316,
"catalog": 0,
"order_type": 1,
"market": "btc_usdt",
"fee": "0",
"avg_price": "90",
"amount": "1"
}
]
}
created_at 是下单时间;updated_at 是最后更新时间(有交易或撤单了);order_type 是挂单类型(0:限价单,1:市价单);price 和 amount_total 是下单时指定的价格和数量(限价单才有);money_deal 是成交金额;amount_done 是成交数量;avg_price 是平均成交价;mo_amount 是总金额或卖出量(市价单才有)
/order/
{
"status": 200,
"message": "ok",
"result": {
"status": 3,
"created_at": "2014/08/10 18:14:57",
"money_deal": "0",
"amount_done": "0",
"updated_at": "2014/08/10 18:14:57",
"id": 4317,
"catalog": 0,
"order_type": 0,
"avg_price": "0",
"price": "3",
"amount_total": "1.2345"
}
}
/transactions/
{
"status": 200,
"message": "ok",
"result": [
{
"amount": "38.9998",
"type": "bid",
"price": "2",
"id": 3355
},
{
"amount": "38.9998",
"type": "bid",
"price": "2",
"id": 3354
}
]
}
/trade/
{
"status": 200,
"message": "ok",
"result": {
"status": 0,
"created_at": "2014/08/10 19:15:17",
"money_deal": 0,
"amount_done": 0,
"updated_at": "2014/08/10 19:15:17",
"id": 4318,
"catalog": 0,
"order_type": 0,
"avg_price": 0,
"price": "3",
"amount_total": "2"
}
}
/cancel/
{
"status": 200,
"message": "ok",
"result": "OK"
}