帳戶
鑑權
簽名方式:每個請求用 App Key / Secret 簽名。請求頭如下:
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
Authorization | string · header | 必填 | OpenAPI 後台 上的賬戶 Access Token,作為原始 token 傳入(不帶 Bearer 前綴),並參與簽名計算。 |
X-Api-Key | string · header | 必填 | 你的 App Key。 |
X-Timestamp | string · header | 必填 | 請求時間戳,單位秒(Unix 時間)。 |
X-Api-Signature | string · header | 必填 | HMAC-SHA256 簽名。格式:HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=。 |
獲取賬戶盈虧匯總,包含總資產、總盈虧和收益率指標。
請求
查詢參數
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
start_date | string | 可選 | 分析開始日期,格式 `YYYY-MM-DD` |
end_date | string | 可選 | 分析結束日期,格式 `YYYY-MM-DD` |
響應
響應欄位
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
updated_at | string | 可選 | 最後更新時間戳 |
sum_profit | string | 可選 | 總盈虧 |
sum_profit_rate | string | 可選 | 總盈虧率 |
profits | object | 可選 | 按類型分解的盈虧 |
└ stock | string | 可選 | 股票基本信息 |
└ fund | string | 可選 | 資金標誌/金額。 |
└ mmf | string | 可選 | 維持保證金系數。 |
└ other | string | 可選 | 其他值/數量。 |
└ summary_info | object[] | 可選 | 摘要信息。 |
└ ∟ profit_max | string | 可選 | 最大盈利金額。 |
└ ∟ loss_max | string | 可選 | 最大虧損金額。 |
└ ∟ profit_max_name | string | 可選 | 最大盈利標的名稱。 |
└ ∟ loss_max_name | string | 可選 | 最大虧損標的名稱。 |
└ ∟ asset_type | string | 可選 | 本組的元素類型(持倉 / 地區 / 資產類別 / 行業) |
└ ipo_subscription | integer | 可選 | IPO 認購次數。 |
└ ipo_hit | integer | 可選 | IPO 中籤次數。 |
└ cumulative_transaction_amount | string | 可選 | 累計成交額。 |
└ crypto | string | 可選 | 加密貨幣標誌。 |
└ trade_order_num | string | 可選 | 交易訂單數。 |
└ trade_stock_num | string | 可選 | 交易標的數。 |
is_traded | boolean | 可選 | 是否有交易紀錄 |
currency | string | 可選 | 貨幣 |
total_simple_earning_yield | string | 可選 | 總簡單收益率。 |
total_time_earning_yield | string | 可選 | 總時間加權收益率。 |
invest_amount | string | 可選 | 總投入金額 |
initial_asset_value | string | 可選 | 初始資產價值 |
ending_asset_value | string | 可選 | 期末資產價值 |
current_total_asset | string | 可選 | 當前總資產 |
start_time | string | 可選 | 統計開始時間戳 |
end_time | string | 可選 | 統計結束時間戳 |
trade_update_time | string | 可選 | 交易數據更新時間。 |
updated_date | string | 可選 | 最後更新日期 |
start_date | string | 可選 | 統計開始日期 |
end_date | string | 可選 | 統計結束日期 |
trade_update_date | string | 可選 | 交易數據更新日期。 |
trade_stock_num | string | 可選 | 交易標的數。 |
響應 JSON 示例
{
"code": 0,
"message": "success",
"data": {
"summary": {
"currency": "USD",
"sum_profit": "62905.97",
"sum_profit_rate": "0.6128",
"invest_amount": "102659.74",
"current_total_asset": "165565.71",
"initial_asset_value": "0.00",
"ending_asset_value": "165565.71",
"is_traded": true,
"start_date": "2025-10-17",
"start_time": "1760659200",
"end_date": "2026-05-14",
"end_time": "1778731947",
"profits": {
"stock": "66370.84",
"crypto": "0",
"fund": null,
"ipo": null,
"mmf": null,
"other": null,
"cumulative_transaction_amount": "1244920.28"
}
},
"sublist": {
"start": "2025-10-17",
"start_date": "2025-10-17",
"end": "2026-05-14",
"end_date": "2026-05-14",
"updated_at": "1778731947",
"updated_date": "2026-05-14",
"items": [
{
"symbol": "AAPL.US",
"name": "Apple",
"market": "US",
"currency": "USD",
"profit": "100.00",
"profit_rate": "0.05",
"holding_period": "180",
"clearance_times": 0,
"is_holding": true,
"item_type": "Stock",
"isin": "",
"security_code": "AAPL",
"underlying_profit": "100.00",
"derivatives_profit": "0.00",
"order_profit": null
}
]
}
}
}錯誤碼
參見錯誤碼文檔。