賬戶列表
GET/api/v1.0/sim-trade/accounts獲取當前登入用戶的模擬交易業務賬戶列表。返回的 account_id 用於後續模擬交易介面的路徑參數。
請求參數
無入參。uid 由登入態 header 自動轉發。
請求示例
bash
curl -s "https://webapi.moomoo.com/api/v1.0/sim-trade/accounts" -H "Authorization: Bearer <AccessToken>" | jq響應欄位
返回 data.accounts[],每元素一個模擬賬戶。
| 欄位 | 類型 | 說明 |
|---|---|---|
account_id | int64 | 業務賬戶 ID(後續介面的 acc_id) |
broker_id | int64 | 券商 ID |
market_id | int64 | 市場 ID(由模擬交易賬戶服務返回) |
intra_account_id | int64 | 賬戶短號 |
account_type | string | 賬戶類型 |
account_title | string | 賬戶名稱 |
響應示例
json
{
"ret_code": 0,
"ret_msg": "success",
"data": {
"accounts": [
{
"account_id": 80303779,
"broker_id": 0,
"market_id": 1,
"intra_account_id": 0,
"account_type": "STOCK",
"account_title": "港股模擬賬戶"
}
]
}
}錯誤響應
HTTP 狀態仍為 200。請求失敗時返回非 0 的 ret_code 和 error 物件。
json
{
"ret_code": -3,
"ret_msg": "invalid request",
"error": {"code": "invalid_parameter", "message": "invalid request"}
}