# 盤口

`WS` `request · cmd 14`

> **行情權限要求 · 免費**
> 美股：預設免費贈送 US LV1 一檔買賣盤報價（含盤前、盤中、盤後、夜盤全時段）。
> 港股：預設贈送 LV1 一檔買賣盤報價；十檔買賣盤需購買「LV2 高級行情 - Plus (OpenAPI)」行情卡。
> 美股期權：預設無權限，需購買「OPRA 美股期權行情 (OpenAPI)」行情卡。
> _OpenAPI 行情權限獨立於 App/Web 行情權限_

該接口用於獲取標的的盤口數據。

```protobuf
message SecurityRequest {
  string symbol = 1;
}

message SecurityDepthResponse {
  string symbol = 1;
  repeated Depth ask = 2;
  repeated Depth bid = 3;
}
```

## Request Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `symbol` | string | Yes | 標的代碼，使用 ticker.region 格式，例如：700.HK |

## Response Fields

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `symbol` | string | No | 標的代碼 |
| `ask` | object[] | No | 賣盤 |
| `└ position` | int32 | No | 檔位 |
| `└ price` | string | No | 價格 |
| `└ volume` | int64 | No | 掛單量 |
| `└ order_num` | int64 | No | 訂單數量 |
| `bid` | object[] | No | 買盤 |
| `└ position` | int32 | No | 檔位 |
| `└ price` | string | No | 價格 |
| `└ volume` | int64 | No | 掛單量 |
| `└ order_num` | int64 | No | 訂單數量 |

## Response JSON Example

```json
{
  "symbol": "700.HK",
  "ask": [
    {
      "position": 1,
      "price": "335.000",
      "volume": 500,
      "order_num": 1
    }
  ],
  "bid": [
    {
      "position": 1,
      "price": "334.800",
      "volume": 69400,
      "order_num": 13
    }
  ]
}
```
