# Candlestick Channel

### Description

Get the candlestick data of the product

- When there are transactions in the K-line channel, data is pushed once per second.
- When there are no transactions, data is pushed once at the specified time granularity.

:::warning{title="Notes for Reality stock (rtoken) symbol subscription"}

- Only the market candlestick type is supported.
- Only the `1m`, `5m`, `15m`, `1H`, `4H`, `1D` intervals are supported.
- For the `1m` interval, `volume` and `turnover` are not included in the push data.

:::

<div className="api-aligning">

```json title="Request Example"
{
    "op": "subscribe",
    "args": [
        {
            "instType": "spot",
            "topic": "kline",
            "symbol": "BTCUSDT",
            "interval": "1D"
        }
    ]
}
```

### Request Parameters

| Parameter               | Type                | Required | Description                                                                                                                                  | 
|-------------------------|---------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------|
| op                      | String              | Yes      | Action <br/> `subscribe` Subscribe <br/> `unsubscribe` Unsubscribe                                                                           |
| args                    | List&lt;Object&gt;  | Yes      | Subscribed channel                                                                                                                           |
| &gt; instType           | String              | Yes      | Product type<br/>`spot` Spot trading<br/>`usdt-futures` USDT futures <br/> `coin-futures` Coin-M futures <br/> `usdc-futures` USDC futures   |
| &gt; topic              | String              | Yes      | Topic <br/> `kline` K-line channel                                                                                                           |
| &gt; symbol             | String              | Yes      | Symbol name <br/> e.g., `BTCUSDT`                                                                                                            |
| &gt; interval           | String              | Yes      | Interval <br/> `1m`, `3m`,`5m`, `15m`, `30m`, `1H`, `4H`,`6H`, `12H`, `1D`                                                                   |

</div>

<div className="api-br-10"></div>

<div className="api-aligning">

```json title="Response Example"
{
  "event": "subscribe",
  "arg": {
    "instType": "spot",
    "topic": "kline",
    "symbol": "BTCUSDT",
    "interval": "1D"
  },
  "connId": "xxxxxxxxxx"
}
```

### Response Parameters

| Parameters    | Type   | Description                                                                                                                                | 
|---------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------|
| event         | String | Action <br/> `subscribe` Subscribe <br/> `unsubscribe` Unsubscribe <br/> `error` Parameter error                                           |
| arg           | Object | Subscribed channel                                                                                                                         |
| &gt; instType | String | Product type<br/>`spot` Spot trading<br/>`usdt-futures` USDT futures <br/> `coin-futures` Coin-M futures <br/> `usdc-futures` USDC futures |
| &gt; topic    | String | Topic <br/> `kline` K-line channel                                                                                                         |
| &gt; symbol   | String | Symbol name <br/> e.g., `BTCUSDT`                                                                                                          |
| &gt; interval | String | Interval                                                                                                                                   |
| code          | String | Error code                                                                                                                                 |
| msg           | String | Error message                                                                                                                              |
| connId        | String | Connection ID                                                                                                                              |

</div>

<div className="api-br-10"></div>

<div className="api-aligning">

```json title="Push Data"
{
  "data": [
    {
      "volume": "0.423",
      "high": "400005",
      "low": "276670",
      "start": "1710518400000",
      "close": "400005",
      "turnover": "148190.38375",
      "open": "276670"
    }
  ],
  "arg": {
    "instType": "spot",
    "symbol": "BTCUSDT",
    "topic": "kline",
    "interval": "1D"
  },
  "action": "snapshot",
  "ts": 1736370735556
}
```

### Push Parameters

| Parameters      | Type               | Description                                                                                                                                 | 
|-----------------|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| arg             | Object             | Subscribed channel                                                                                                                          |
| &gt; instType   | String             | Product type<br/>`spot` Spot trading<br/>`usdt-futures` USDT futures <br/> `coin-futures` Coin-M futures <br/> `usdc-futures` USDC futures  |
| &gt; topic      | String             | Topic <br/> `kline`                                                                                                                         |
| &gt; symbol     | String             | Symbol name                                                                                                                                 |
| action          | String             | Push data action <br/> `snapshot` Full data <br/> `update` Incremental data                                                                 |
| data            | List&lt;Object&gt; | Subscribed data                                                                                                                             |
| &gt; start      | String             | The timestamp that the system generated the data <br/>A Unix timestamp in milliseconds                                                      |
| &gt; open       | String             | Open price                                                                                                                                  |
| &gt; close      | String             | Close price                                                                                                                                 |
| &gt; high       | String             | Highest price                                                                                                                               |
| &gt; low        | String             | Lowest price                                                                                                                                |
| &gt; volume     | String             | Trade Volume<br/>_The unit is base coin_                                                                                                    |
| &gt; turnover   | String             | Turnover<br/>_The unit is quote coin_                                                                                                        |

</div>
