買賣盤
POST/api/v1.0/quote/order-book獲取標的的實時買賣盤擺盤。返回檔數與盤口形態由用戶行情權限檔(LV1/LV2/LV3)與品類共同決定,網關按權限自動選擇拉取方式與檔數。
請求參數
| 參數 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
code | string | 請求體 | 是 | 標的代碼,格式 <MARKET>.<SYMBOL>,如 HK.00700。 |
num | int | 請求體 | 否 | 返回檔數上限,範圍 1~60;不傳則返回權限允許的最大檔數。 |
請求示例
bash
curl -s -X POST "https://webapi.moomoo.com/api/v1.0/quote/order-book" \
-H "Content-Type: application/json" \
-H "X-Futu-Client-Nnid: 76879657" \
-d '{"code":"HK.00700","num":3}' | jq響應字段
返回 data[](單 code 也為數組,含 1 個元素);每個元素含 code/name 與 books[] 盤口數組。美股 LV3 按交易所返回多個 book(如 NASDAQ + ARCA),其它品類為單元素 book。
頂層字段
| 字段 | 類型 | 說明 |
|---|---|---|
| code | string | 標的代碼 |
| name | string | 英文名 |
| sc_name | string | 簡體中文名 |
| tc_name | string | 繁體中文名 |
| books | array | 盤口數組,每元素為一個交易所/品種的擺盤 |
books[] 元素結構
| 字段 | 類型 | 說明 |
|---|---|---|
| exchange | string | 交易所/品種標識;美股 LV3 為 NASDAQ / ARCA,其它品類為空串 |
| bid_flag | int | 買盤有效標誌,1=有買盤數據 / 0=無 |
| ask_flag | int | 賣盤有效標誌,1=有賣盤數據 / 0=無 |
| exchange_data_time_ms | int64 | 交易所數據生成時間(毫秒時間戳) |
| server_send_to_client_time_ms | int64 | 服務端下發時間(毫秒時間戳) |
| order_volume_precision | int | 訂單數量精度(n 表示 volume 放大 10^n;0 表示整數) |
| difference | double | 外匯差價(僅特定品類有值,普通股票為 0) |
| bid_list | array | 買盤列表,按價降序,每檔含 price/volume/order_count |
| ask_list | array | 賣盤列表,按價升序,結構同 bid_list |
bid_list[] / ask_list[] 元素結構
| 字段 | 類型 | 說明 |
|---|---|---|
| price | double | 該檔價格 |
| volume | int64 | 該檔總數量(單位見 order_volume_precision) |
| order_count | int | 該檔訂單數(部分市場不下發,為 0) |
限制範圍
- code 必須是已開通行情前綴必須落在下表 5 個市場內,否則返回
invalid_symbol。 - 返回檔數 = min(num, 權限檔給出的上限);權限不足 / HK 全盤(SF) 一律降級為默認 1 檔。
支持的市場前綴與品類:
| 前綴 | 市場 | 支持品類 |
|---|---|---|
| HK | 香港 | 正股 / 信託 / REIT / 窩輪 / 牛熊證 / 界內證 / 指數 / 板塊 / ETF / 期權 |
| US | 美國 | 正股 / ETF / 指數 |
| SH | 上海 | 正股 / ETF / 指數 / 板塊 |
| SZ | 深圳 | 正股 / ETF / 指數 / 板塊 |
| BJ | 北京 | 正股 / 指數 |
錯誤碼
| ret_code | error.code | 觸發條件 | 處理建議 |
|---|---|---|---|
| 0 | — | 成功 | — |
| -3 | invalid_parameter | 缺 code / num 超出 1~60 範圍 / 字段類型錯 | 校正請求體後重試 |
| -4 | internal_error | 網關構造後端請求失敗 | 重試;持續失敗請聯繫網關側 |
| -6 | internal_error | 網關響應轉換失敗 | 重試;持續失敗請聯繫網關側 |
| -7 | invalid_symbol | code 無法解析(前綴不支持 / 代碼不存在) | 檢查市場前綴是否在限制範圍內;通過 search 接口確認代碼合法性 |
響應示例
json
{
"ret_code": 0,
"ret_msg": "success",
"data": [
{
"code": "HK.00700",
"name": "TENCENT",
"sc_name": "腾讯控股",
"tc_name": "騰訊控股",
"books": [
{
"exchange": "",
"bid_flag": 1,
"ask_flag": 1,
"exchange_data_time_ms": 1780378533000,
"server_send_to_client_time_ms": 1780378533768,
"order_volume_precision": 0,
"difference": 0,
"ask_list": [
{ "price": 473.6, "volume": 21400, "order_count": 23 },
{ "price": 473.8, "volume": 7900, "order_count": 21 },
{ "price": 474.0, "volume": 29000, "order_count": 48 }
],
"bid_list": [
{ "price": 473.4, "volume": 28300, "order_count": 42 },
{ "price": 473.2, "volume": 22800, "order_count": 26 },
{ "price": 473.0, "volume": 21500, "order_count": 39 }
]
}
]
}
]
}