Skip to content

获取历史成交

GET /api/v1.0/accounts/{acc_id}/fills_history

查询指定交易业务账户的历史成交列表。

路径参数

参数类型必填说明
acc_idstring业务账户 ID。

请求参数

参数类型位置必填说明
trd_marketstring查询交易市场。可选值参见 命名词典
codestring查询代码筛选。返回指定代码的数据,默认返回全部数据。
startuint64查询更新时间的起始时间,时间戳,单位微秒。
enduint64查询更新时间的结束时间,应在起始时间之后。时间戳,单位微秒。
page_flagstring查询翻页标记,首次请求填空字符串表示从头开始,之后填入服务端返回的 page_flag。
page_sizeuint32查询每页条数,默认 50,取值范围 10-50。

startend 的组合说明:

startend说明
>0>0startend 分别为指定日期。
0>0startend 之前 90 天。
>00endstart 之后 90 天。
00start 为当前日期之前 90 天,end 为当前日期。

响应参数

字段类型说明
order_fillslist[OrderFill]成交列表,默认每次返回 50 条,最新成交在前。
page_flagstring下次请求的翻页标记
completedbooltrue 表示所有成交记录已返回,客户端应停止翻页请求。

响应示例

json
{
  "s": "ok",
  "d": {
    "order_fills": [
      {
        "trd_side": "BUY",
        "deal_id": "F2024030100000001",
        "order_id": "2024030100000001",
        "code": "US.AAPL",
        "stock_name": "Apple Inc.",
        "qty": "100",
        "price": "180.000",
        "create_time": 1709251210000000,
        "updated_time": 1709251210000000,
        "counter_broker_id": 9999,
        "counter_broker_name": "Goldman Sachs",
        "status": "OK"
      }
    ],
    "page_flag": "",
    "completed": true
  }
}

失败响应:

json
{
  "s": "error",
  "errcode": -1200,
  "errmsg": "Error message."
}