跳轉到內容

獲取當日成交明細

該接口用於獲取當日訂單的成交明細。

Request

HTTP MethodGET
HTTP URL/v1/trade/execution/today

Parameters

Content-Type: application/json; charset=utf-8

NameTypeRequiredDescription
symbolstringNO股票代碼,使用 ticker.region 格式,例如:AAPL.US
order_idstringNO訂單 ID,用於指定訂單 ID 查詢,例如:701276261045858304

Request Example

python
from longport.openapi import TradeContext, Config

config = Config.from_env()
ctx = TradeContext(config)

resp = ctx.today_executions(symbol = "700.HK")
print(resp)

Response

Response Headers

  • Content-Type: application/json

Response Example

json
{
  "code": 0,
  "message": "success",
  "data": {
    "trades": [
      {
        "order_id": "693664675163312128",
        "price": "388",
        "quantity": "100",
        "symbol": "700.HK",
        "trade_done_at": "1648611351",
        "trade_id": "693664675163312128-1648611351433741210"
      }
    ]
  }
}

Response Status

StatusDescriptionSchema
200查詢成功None
400查詢失敗,請求參數錯誤。None

Response Schema

Schemas

today_executions_rsp

NameTypeRequiredDescription
tradesobject[]false成交明細信息
∟ order_idstringtrue訂單 ID
∟ trade_idstringtrue成交 ID
∟ symbolstringtrue股票代碼,使用 ticker.region 格式,例如:AAPL.US
∟ trade_done_atstringtrue成交時間,格式為時間戳 (秒)
∟ quantitystringtrue成交數量
∟ pricestringtrue成交價格