# 盤口訂閱

`WS` `push · cmd 102`

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

訂閱標的的實時盤口數據。

```protobuf
message PushDepth {
  string symbol = 1;
  int64 sequence = 2;
  repeated Depth ask = 3;
  repeated Depth bid = 4;
}
```

## Push Fields

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `symbol` | string | No | 標的代碼，例如：AAPL.US |
| `sequence` | int64 | 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",
  "sequence": 160808750000000,
  "ask": [
    {
      "position": 1,
      "price": "335.000",
      "volume": 500,
      "order_num": 1
    }
  ],
  "bid": [
    {
      "position": 1,
      "price": "334.800",
      "volume": 69400,
      "order_num": 13
    }
  ]
}
```
