> ## Documentation Index
> Fetch the complete documentation index at: https://developer.wooxpro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 【公共】K 线频道

获取交易对的 K 线数据

### 推送规则

1. 无需用户登录
2. 当前一秒内有新成交时，每秒推送一次；否则仅在同一根 K 线内出现新成交时推送
3. K 线收盘时会再推送一次最终数据，即使该 K 线内没有成交

### 请求

> 请求

```json theme={null}
{
  "id": "1",
  "cmd": "SUBSCRIBE",
  "params": ["kline@PERP_BTC_USDT@1m"]
}
```

Topic 格式:

`kline@<symbol>@<interval>`

* symbol: 交易对，如 `PERP_BTC_USDT`
* interval: K 线周期，支持 `1m` `3m` `5m` `15m` `30m` `1h` `2h` `4h` `6h` `12h` `1d` `3d` `1w` `1M`

### 返回

> 返回

```json theme={null}
{
  "topic": "kline@PERP_BTC_USDT@1m",
  "ts": 1618822432146,
  "data": {
    "s": "PERP_BTC_USDT",
    "t": "1m",
    "o": "56948.97",
    "c": "56891.76",
    "h": "56948.97",
    "l": "56889.06",
    "v": "44.00947568",
    "a": "2504584.9",
    "st": 1618822380000,
    "et": 1618822440000,
    "ts": 1614152260000,
    "tts": 1614152250000
  }
}
```

返回数据说明:

| 字段 | 类型 | 描述 |
| :- | :- | :- |
| s | String | 交易对 |
| t | String | K 线周期 |
| o | String | 开盘价 |
| c | String | 收盘价 |
| h | String | 最高价 |
| l | String | 最低价 |
| v | String | 成交量（币种数量） |
| a | String | 成交额（USDT） |
| st | Long | 起始时间（毫秒） |
| et | Long | 结束时间（毫秒） |
| ts | Long | 生成时间（毫秒） |
| tts | Long | 最后一笔成交时间（毫秒） |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.