> For the complete documentation index, see [llms.txt](https://docs-cn.multimarkets.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-cn.multimarkets.org/client-api/bao-jia-jie-kou/ding-yue-jie-kou/shi-shi-bao-jia-ding-yue.md).

# 实时报价订阅

## 接口说明

该接口特性为对于每一个websocket连接，每发送一次该请求，后台会默认覆盖上一次订阅请求。订阅成功后会进行推送数据。

## 请求-协议号：14000

### 数据格式:json

### 数据结构

#### data定义

| 字段           | 名称   | 类型    | 必填项 | 说明              |
| ------------ | ---- | ----- | --- | --------------- |
| symbol\_list | 产品列表 | array | 是   | 具体格式见下面symbol定义 |

#### symbol定义

| 字段          | 名称   | 类型     | 必填项 | 说明                           |
| ----------- | ---- | ------ | --- | ---------------------------- |
| symbol\_id  | 产品ID | uint64 | 是   |                              |
| trade\_type | 交易类型 | uint32 | 是   | 1:全仓合约,2:逐仓合约,3:杠杆,5:现货,6:股票 |
| trade\_mode | 交易模式 | uint32 | 是   | 1:MM,2:蝴蝶MM,3:撮合,4:聚合        |

### 请求示例

```json
{
    "cmd_id":14000,
    "seq_id":123,
    "ext":"3baaa938-f92c-4a74-a228-fd49d5e2f8bc-1678419657806",
    "data":{
        "symbol_list": [
            {
                "symbol_id": 112312,
                "trade_type": 1,
                "trade_mode": 1,
            }
        ],
    }
}
```

## 应答-协议号：14001

### 数据格式:json

### 数据结构

#### data定义

| 字段         | 名称       | 类型    | 说明            |
| ---------- | -------- | ----- | ------------- |
| tick\_list | tick快照数据 | array | 具体格式见下面tick定义 |

#### tick定义

| 字段                      | 名称        | 类型     | 说明                           |
| ----------------------- | --------- | ------ | ---------------------------- |
| symbol\_id              | 产品ID      | uint64 |                              |
| trade\_type             | 交易类型      | uint32 | 1:全仓合约,2:逐仓合约,3:杠杆,5:现货,6:股票 |
| trade\_mode             | 交易模式      | uint32 | 1:MM,2:蝴蝶MM,3:撮合,4:聚合        |
| seq                     | 报价序号      | uint64 |                              |
| tick\_time              | 报价时间戳     | uint64 |                              |
| price\_digits           | 价格小数位     | uint32 |                              |
| price                   | 最新成交价     | string |                              |
| tick\_deep              | 深度报价      | array  | 该深度只会带一档报价信息见下面tick\_deep定义  |
| open\_price             | 最近一天日K开盘价 | string |                              |
| close\_price            | 最近一天日K收盘价 | string |                              |
| high\_price             | 最近一天日K最高价 | string |                              |
| low\_price              | 最近一天日K最低价 | string |                              |
| yesterday\_close\_price | 最近一天日K昨收价 | string |                              |

#### tick\_deep定义

| 字段          | 名称       | 类型     | 说明 |
| ----------- | -------- | ------ | -- |
| price\_bid  | 买一价，买盘价格 | string |    |
| price\_ask  | 卖一价，卖盘价格 | string |    |
| volume\_bid | 买一量，买盘量  | string |    |
| volume\_ask | 卖一量，卖盘量  | string |    |

### 应答示例

```json
{
    "ret":200,
    "msg":"ok",
    "cmd_id":14001,
    "seq_id":123,
    "ext":"3baaa938-f92c-4a74-a228-fd49d5e2f8bc-1678419657806",
    "data":{
        "tick_list":[
            {
                "symbol_id": 123,
                "trade_type": 1,
                "trade_mode": 0,
                "seq": 1605509068000001,
                "tick_time": 1605509068,
                "price_digits": 2,
                "price": "651.12",
                "tick_deep": [
                    {
                        "price_bid": "9.12",
                        "price_ask": "147.12",
                        "volume_bid": "9.12",
                        "volume_ask": "147.12",
                    },
                ],
                "open_price": "651.12",
                "close_price": "623.12",
                "high_price": "674.12",
                "low_price": "619.12",
                "yesterday_close_price": "623.12",
            },
        ]
    }    
}
```

## 推送数据

### 说明

该报价推送主要带成交和一档深度的报价，是一种综合的报价推送，数据内容为字符串，目前一次推送一条报价 请求者发送了实时报价订阅请求，后台服务才会对其推送该数据

### 字段解释

p(产品ID，报价交易类型，成交模式，报价序号，报价时间戳，当前价，第一档bid价，第一档ask价, 第一档bid量, 第一档ask量); “p(symbol\_id,trade\_type,trade\_mode,seq,tick\_time,price,price\_bid1,price\_ask1,volume\_bid1,volume\_ask1);” trade\_type的值含义 1:全仓合约,2:逐仓合约,3:杠杆,5:现货,6:股票 trade\_mode的值含义 1:MM,2:蝴蝶MM,3:撮合,4:聚合

### 推送数据示例

p(1123,1,0,1232312,34545435345,6.23,6.23,6.24,123,234);


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs-cn.multimarkets.org/client-api/bao-jia-jie-kou/ding-yue-jie-kou/shi-shi-bao-jia-ding-yue.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
