# 分時

`WS` `request · cmd 18`

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

該接口用於獲取標的的當日分時數據。

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

message SecurityIntradayResponse {
  string symbol = 1;
  repeated Line lines = 2;
}
```

## Request Parameters

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

## Response Fields

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `symbol` | string | No | 標的代碼，例如：AAPL.US |
| `lines` | object[] | No | 分時數據 |
| `└ price` | string | No | 當前分鐘的收盤價格 |
| `└ timestamp` | int64 | No | 當前分鐘的開始時間 |
| `└ volume` | int64 | No | 成交量 |
| `└ turnover` | string | No | 成交額 |
| `└ avg_price` | string | No | 均價 |

## Response JSON Example

```json
{
  "symbol": "700.HK",
  "lines": [
    {
      "price": "330.400",
      "timestamp": 1651023000,
      "volume": 375870,
      "turnover": "123949699.000",
      "avg_price": "329.767470"
    }
  ]
}
```
