> For the complete documentation index, see [llms.txt](https://docs.infoway.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infoway.io/en-docs/websocket/websocket-unsubscribe-method/unsubscribe-from-real-time-candlestick-k-line-data.md).

# Unsubscribe from Real-Time Candlestick (K-Line) Data

Cancel all or part of a candlestick subscription without closing the WebSocket.

### Request frequency

Subscribe + unsubscribe + heartbeat on one connection: 60 per minute. See [WebSocket Limitation](/en-docs/getting-started/api-limitation/websocket-limitation.md).

### Error codes

See [WebSocket Error Codes](/en-docs/getting-started/error-codes/websocket-error-codes.md). An invalid `klineTypes` value returns `506`.

### Address

See [Endpoints](/en-docs/getting-started/endpoints.md).

### Request (protocol 11002)

Drop 1-minute candles only and keep daily:

```json
{
    "code": 11002,
    "trace": "423afec425004bd8a5e02e1ba5f9b2b0",
    "data": {
        "codes": "BTCUSDT",
        "klineTypes": "1"
    }
}
```

Drop every interval for that symbol:

```json
{
    "code": 11002,
    "trace": "423afec425004bd8a5e02e1ba5f9b2b0",
    "data": {
        "codes": "BTCUSDT"
    }
}
```

| Parameter    | Type    | Required | Description                                                                                                | Example                            |
| ------------ | ------- | -------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| `code`       | Integer | Yes      | Unsubscribe protocol `11002`                                                                               | `11002`                            |
| `trace`      | String  | Yes      | Trace id                                                                                                   | `423afec425004bd8a5e02e1ba5f9b2b0` |
| `data`       | JSON    | No       | Scope. Omit or use `null` to clear every kline symbol on this connection                                   |                                    |
| `codes`      | String  | No       | Comma-separated. Omit or use `null` for every kline symbol on this connection; do not send an empty string | `BTCUSDT`                          |
| `klineTypes` | String  | No       | Comma-separated `1`–`12`. **Omit = drop every interval for those symbols**                                 | `1,8`                              |

To unsubscribe all, omit `data`. Do not substitute empty strings for omitted `codes` or `klineTypes`; an empty `klineTypes` string is not a valid interval.

To drop one interval only, send `klineTypes`. Omitting it unsubscribes 1-minute through yearly.

Interval ids match subscribe: `1` 1m … `8` day … `12` year.

### Response (protocol 11010)

```json
{
    "code": 11010,
    "trace": "423afec425004bd8a5e02e1ba5f9b2b0",
    "msg": "ok"
}
```

Trade, depth, and kline unsubscribes all ack with `11010`.
