獲取標的盤口
該接口用於獲取標的的盤口數據。
SDK Links
Python |
Rust |
Go |
Node.js |
資訊
業務指令:14
Request
Parameters
Name | Type | Required | Description |
---|---|---|---|
symbol | string | 是 | 標的代碼,使用 ticker.region 格式,例如:700.HK |
Protobuf
message SecurityRequest {
string symbol = 1;
}
Request Example
# 獲取標的盤口
# https://open.longportapp.com/docs/quote/pull/depth
# 運行前請訪問“開發者中心“確保賬戶有正確的行情權限。
# 如沒有開通行情權限,可以通過“LongPort”手機客戶端,並進入“我的 - 我的行情 - 行情商城”購買開通行情權限。
from longport.openapi import QuoteContext, Config
config = Config.from_env()
ctx = QuoteContext(config)
resp = ctx.depth("700.HK")
print(resp)
Response
Response Properties
Name | Type | Description |
---|---|---|
symbol | string | 標的代碼 |
ask | object[] | 賣盤 |
∟ position | int32 | 檔位 |
∟ price | string | 價格 |
∟ volume | int64 | 掛單量 |
∟ order_num | int64 | 訂單數量 |
bid | object[] | 買盤 |
∟ position | int32 | 檔位 |
∟ price | string | 價格 |
∟ volume | int64 | 掛單量 |
∟ order_num | int64 | 訂單數量 |