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

# k-line

> Subscribe to OHLC kline/candlestick updates for a symbol at configurable time intervals via WebSocket.

Get the latest klines (OHLC) updates of the subscribed symbol.

Please note that for symbols with low trading activity, the kline might be generated through the mid price of the orderbook in addition to any executed trades on the platform.

`{time}`: `1m`/`5m`/`15m`/`30m`/`1h`/`1d`/`1w`/`1M`

Push interval: 1s

```json theme={null}
{
  "id": "clientID6",
  "topic": "PERP_NEAR_USDC@kline_1m",
  "event": "subscribe"
}
```

**Parameters**

| Name  | Type   | Required | Description               |
| ----- | ------ | -------- | ------------------------- |
| id    | string | Y        | id generate by client     |
| event | string | Y        | `subscribe`/`unsubscribe` |
| topic | string | N        | `{symbol}@kline_{time}`   |

<RequestExample>
  ```json Response theme={null}
  {
    "id": "clientID6",
    "event": "subscribe",
    "success": true,
    "ts": 1609924478533
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Subscribed Message theme={null}
  {
    "topic": "PERP_NEAR_USDC@kline_1m",
    "ts": 1618822432146,
    "data": {
      "symbol": "PERP_NEAR_USDC",
      "type": "1m",
      "open": 15.97,
      "close": 14.76,
      "high": 16.97,
      "low": 14.06,
      "volume": 44.00947568,
      "amount": 2504584.9,
      "startTime": 1618822380000,
      "endTime": 1618822440000
    }
  }
  ```
</ResponseExample>
