查询有成交的历史订单
类型: GET
描述: /future/trade/v1/order/trade-history
限流规则
200/s/apikey
请求参数
| 名称 | 类型 | 必填 | 默认值 | 描述 | 范围 |
|---|---|---|---|---|---|
| limit | integer | FALSE | 10 | 数量 | 最大为500 |
| startTime | integer | FALSE | N/A | 开始时间 | 默认查询90天前 |
| endTime | integer | FALSE | N/A | 结束时间 | |
| symbol | string | TRUE | N/A | 交易对 |
请求示例
curl -G "https://fapi.xt.com/future/trade/v1/order/trade-history" \
-H "validate-appkey: $APPKEY" \ # 必须
-H "validate-timestamp: $TIMESTAMP" \ # 必须
-H "validate-singature: $SIGNATURE" \ # 必须
-H "Content-Type: application/x-www-form-urlencoded" \ # 必须
-d "symbol=btc_usdt" \
-d "limit=10" \
-d "startTime=1762074200000" \
-d "endTime=1762074242467" \
响应示例
{
"error": {
"code": "",
"msg": ""
},
"msgInfo": "",
"result": {
[ // 数据列表
{
"symbol": "BTCUSDT", // string,交易对
"orderSide": "BUY", // string,"BUY" 或 "SELL"
"avgPrice": "67234.50", // string!BigDecimal 序列化后是字符串,防止精度丢失
"origQty": "0.012", // string,委托数量(张或币)
"executedQty": "0.012", // string,已成交数量
"updatedTime": 1735698765000 // number,毫秒时间戳(long 类型,Java 返回时通常不转字符串)
}
]
},
"returnCode": 0
}
错误码
| Error code | Desc |
|---|---|
| invalid_symbol | 交易对不存在 |