# 实时成交明细（Trade）取消订阅

## API说明

展示如何在不断开Websocket连接的情况下，**全量取消**或者**只取消一部分**产品订阅           &#x20;

## 请求频率

同一个Websocket连接，所有的请求（订阅、取消订阅、心跳）限制为**1分钟60次**，如果超出请求频率限制将会自动断连。如果断连次数过多被系统判定为恶意请求将会封禁apikey。请在使用过程中注意调用逻辑。

## 错误码说明

参考[Websocket错误码说明](/getting-started/error-codes/websocket.md)

## 接口地址

请参考[Websocket订阅地址](/websocket-api/endpoints.md)

## 请求（协议号：11000）

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

***解释：入参data或者codes可以为null或者空。***

***如果获取不到codes的值，会进行全量取消，也就是说如果订阅了100个产品对的成交明细都会清除订阅数据，不会再进行推送；如果传了codes值，会根据所传的产品单独清除订阅数据，不会影响其他产品的数据推送***

| 参数名      | 类型      | 必填 | 描述             | 示例值                                |
| -------- | ------- | -- | -------------- | ---------------------------------- |
| `code`   | Integer | 是  | 请求的协议号         | 实时成交明细取消订阅协议号：`11000`              |
| `trace`  | String  | 是  | 可追溯ID（随机字符串）   | `423afec425004bd8a5e02e1ba5f9b2b0` |
| `data`   | JSON    | 否  | 取消订阅数据         |                                    |
| `＜codes` | String  | 否  | 取消订阅产品，多个用逗号分隔 | `BTCUSDT`                          |

## 应答（协议号：11010）

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

| 字段名     | 类型      | 必填 | 描述          | 示例值                                |
| ------- | ------- | -- | ----------- | ---------------------------------- |
| `code`  | Integer | 是  | 响应协议号       | 取消订阅实时成交明细响应协议号：`11010`            |
| `trace` | String  | 是  | 订阅传入参数可追溯id | `423afec425004bd8a5e02e1ba5f9b2b0` |
| `msg`   | String  | 是  | 响应          | `ok`                               |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.infoway.io/websocket-api/unsubscribe/trade-subscribe.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
