Data Format
WebSocket quote push uses JSON messages. The client should first distinguish message types by the top-level type field, then parse the specific quote data by symbol and data.
INFO
Under different markets, categories, and quote permissions, fields may be omitted, set to 0, be empty strings, or only return part of an array. The client should parse compatibly: ignore unknown fields, null-check optional fields, and do not assume all messages contain the same set of fields.
Common Message Structure
Most symbol-level quote pushes use the following structure:
{
"type": "QUOTE",
"symbol": "US.AAPL",
"data": {}
}| Field | Type | Description |
|---|---|---|
type | string | Push message type, e.g. QUOTE, ORDER_BOOK, TICKER, KLINE. |
symbol | string | Symbol code in the format {market}.{code}, e.g. HK.00700, US.AAPL. Some market-level messages do not have this field. |
data | object | Push data body. The structure differs by type. |
Recommended dispatch flow for the client:
Receive WebSocket message
-> JSON decode
-> switch message.type
-> QUOTE: parse basic quote
-> ORDER_BOOK: parse order book
-> TICKER: parse ticker
-> KLINE: parse K-line
-> BROKER_QUEUE: parse broker queue
-> MARKET_STATE: parse market state
-> default: log and ignoreMessage Types
| type | Description | Symbol-bound |
|---|---|---|
QUOTE | Basic quote. | Yes |
ORDER_BOOK | Order book. | Yes |
TICKER | Ticker. | Yes |
KLINE | Current K-line. | Yes |
BROKER_QUEUE | Broker queue. | Yes |
MARKET_STATE | Market state. | No |
BROKER_QUEUE and MARKET_STATE are usually pushed by the server based on the subscribed symbols, market, and permissions; the client does not need to pass in the corresponding subscription field separately.
Time and Values
| Type | Convention |
|---|---|
| Timestamp | When a field name ends with _ms, it usually represents a Unix millisecond timestamp. |
| Price | Uses decimal numeric values. For display, handle precision according to market conventions. |
| Volume | Uses numeric types. Units may differ across markets; display according to market rules. |
| Amount | Turnover and trade amount fields use numeric types. |
| Boolean | e.g. suspension indicates whether trading is suspended. |
| Enum | e.g. direction, type, status use string enums. |
QUOTE Basic Quote
Basic quote pushes the real-time price and status information of a symbol.
Example
{
"type": "QUOTE",
"symbol": "US.AAPL",
"data": {
"data_time_ms": 1710000000000,
"last_price": 180.12,
"open_price": 178.5,
"high_price": 181.2,
"low_price": 177.9,
"prev_close_price": 179.66,
"volume": 12345678,
"turnover": 2223456789.12,
"suspension": false,
"sec_status": "NORMAL"
}
}Field Description
| Field | Type | Description |
|---|---|---|
data.data_time_ms | integer | Quote data time, Unix millisecond timestamp. |
data.last_price | number | Last price. |
data.open_price | number | Open price. |
data.high_price | number | High price. |
data.low_price | number | Low price. |
data.prev_close_price | number | Previous close price. |
data.volume | number | Volume. |
data.turnover | number | Turnover. |
data.suspension | boolean | Whether trading is suspended. |
data.sec_status | string | Security status. |
data.option_data | object | Option-related fields. Only applies to option categories. |
data.pre_market | object | Pre-market quote fields. Only returned in applicable markets and sessions. |
data.after_market | object | After-market quote fields. Only returned in applicable markets and sessions. |
data.overnight | object | Overnight session quote fields. Only returned in applicable markets and sessions. |
data.future_data | object | Futures-related fields. Only applies to futures categories. |
TIP
QUOTE fields are semantically aligned with the Quote basic quote of the REST Real-time Quote. To obtain the complete current state in one call, use the REST API for backfill.
ORDER_BOOK Order Book
Order book pushes the real-time order book list of a symbol. The number of levels returned is determined jointly by the market, category, and the user's quote permission level (LV1/LV2/LV3).
Example
{
"type": "ORDER_BOOK",
"symbol": "HK.00700",
"data": {
"data_time_ms": 1710000000000,
"ask_list": [
{
"price": 320.2,
"volume": 1000,
"order_count": 3
}
],
"bid_list": [
{
"price": 320.0,
"volume": 800,
"order_count": 2
}
]
}
}Field Description
| Field | Type | Description |
|---|---|---|
data.data_time_ms | integer | Order book data time, Unix millisecond timestamp. |
data.ask_list | object[] | Ask list, sorted by level. |
data.bid_list | object[] | Bid list, sorted by level. |
data.ask_list[].price | number | Ask price. |
data.ask_list[].volume | number | Ask volume. |
data.ask_list[].order_count | number | Number of orders at this level. |
data.ask_list[].mpid | string | Market maker or broker identifier. Only returned for some markets or depth quotes. |
data.bid_list[].price | number | Bid price. |
data.bid_list[].volume | number | Bid volume. |
data.bid_list[].order_count | number | Number of orders at this level. |
data.bid_list[].mpid | string | Market maker or broker identifier. Only returned for some markets or depth quotes. |
INFO
Both regular and depth order books use the ORDER_BOOK message type. The client should determine the display based on the actual returned levels, fields, and user permissions.
TICKER Ticker
Ticker pushes the trade details of a symbol. The server may merge multiple trades into the ticker_list of the same message.
Example
{
"type": "TICKER",
"symbol": "US.AAPL",
"data": {
"ticker_list": [
{
"time_ms": 1710000000123,
"sequence": 123456,
"direction": "BUY",
"price": 180.12,
"volume": 100,
"turnover": 18012,
"type": "NORMAL"
}
]
}
}Field Description
| Field | Type | Description |
|---|---|---|
data.ticker_list | object[] | Ticker list. |
data.ticker_list[].time_ms | integer | Trade time, Unix millisecond timestamp. |
data.ticker_list[].sequence | integer | Trade sequence. Can be used for deduplication or sorting. |
data.ticker_list[].direction | string | Trade direction. Common values: BUY, SELL, NEUTRAL. |
data.ticker_list[].price | number | Trade price. |
data.ticker_list[].volume | number | Trade volume. |
data.ticker_list[].turnover | number | Turnover. |
data.ticker_list[].type | string | Trade type, e.g. NORMAL, AUTO_MATCH, ODD_LOT, AUCTION. |
TIP
Do not assume a TICKER message contains only a single trade. Highly active symbols may push multiple trades in a batch; for rendering, the client is recommended to throttle and merge increments.
KLINE Current K-line
K-line pushes updates for the current period. The subscription dimension is determined by symbol + period + adjust.
Example
{
"type": "KLINE",
"symbol": "US.AAPL",
"data": {
"period": "1m",
"adjust": "none",
"kl_list": [
{
"time_ms": 1710000000000,
"open_price": 180.0,
"high_price": 180.5,
"low_price": 179.8,
"close_price": 180.12,
"volume": 12345,
"turnover": 2223456.78
}
]
}
}Field Description
| Field | Type | Description |
|---|---|---|
data.period | string | K-line period, e.g. 1m, 5m, 1D. |
data.adjust | string | Adjustment method, e.g. none, forward_exclude_dividend. |
data.kl_list | object[] | K-line list. Usually contains the currently updated K-line. |
data.kl_list[].time_ms | integer | K-line time, Unix millisecond timestamp. |
data.kl_list[].open_price | number | Open price. |
data.kl_list[].high_price | number | High price. |
data.kl_list[].low_price | number | Low price. |
data.kl_list[].close_price | number | Close price or current last price. |
data.kl_list[].volume | number | Volume. |
data.kl_list[].turnover | number | Turnover. |
data.kl_list[].settle_price | number | Settlement price. Only returned for some categories such as futures. |
Common Periods
| Period | Description |
|---|---|
1m | 1 minute |
3m | 3 minutes |
5m | 5 minutes |
10m | 10 minutes |
15m | 15 minutes |
30m | 30 minutes |
60m | 60 minutes |
120m | 120 minutes |
180m | 180 minutes |
240m | 240 minutes |
1D | Daily K |
1W | Weekly K |
1M | Monthly K |
1Q | Quarterly K |
1Y | Yearly K |
Some markets or categories may support extended periods such as pre/post-market, dark pool, or overnight sessions. Availability is subject to the actual subscription response and permissions.
BROKER_QUEUE Broker Queue
Broker queue is mainly used in some Hong Kong Stock order book scenarios and represents the broker queue corresponding to the order book.
Example
{
"type": "BROKER_QUEUE",
"symbol": "HK.00700",
"data": {
"data_time_ms": 1710000000000,
"ask_brokers": [
{
"rank": 1,
"broker_id": "8465",
"broker_name": "Broker A"
}
],
"bid_brokers": [
{
"rank": 1,
"broker_id": "8465",
"broker_name": "Broker A"
}
]
}
}Field Description
| Field | Type | Description |
|---|---|---|
data.data_time_ms | integer | Data time, Unix millisecond timestamp. |
data.ask_brokers | object[] | Ask broker queue. |
data.bid_brokers | object[] | Bid broker queue. |
data.ask_brokers[].rank | integer | Rank. |
data.ask_brokers[].broker_id | string | Broker ID. |
data.ask_brokers[].broker_name | string | Broker name; may be omitted. |
data.bid_brokers[].rank | integer | Rank. |
data.bid_brokers[].broker_id | string | Broker ID. |
data.bid_brokers[].broker_name | string | Broker name; may be omitted. |
BROKER_QUEUE is not passed in as a regular subscription request field; it is usually returned at the server's discretion based on the subscribed order book capability, market, and permissions.
MARKET_STATE Market State
Market state is a market-level message and is not bound to a single symbol, so it usually has no symbol field.
Example
{
"type": "MARKET_STATE",
"data": {
"market": "US",
"status": "OPEN",
"trade_date": "2024-03-08"
}
}Field Description
| Field | Type | Description |
|---|---|---|
data.market | string | Market identifier, e.g. US, HK. |
data.status | string | Market trading status. |
data.trade_date | string | Trade date. |
Upon receiving MARKET_STATE, the client can use it to update market open/close status, trade date hints, or subscription data availability hints on the page.
Compatibility Recommendations
- Dispatch by
type: Different message structures vary significantly; do not parse all pushes with a single strongly-typed model. - Ignore unknown fields: The server may add fields; the client should remain forward-compatible.
- Tolerate unknown
type: Log and skip to avoid breaking connection handling when new message types are introduced. - Null-check optional fields: Option, futures, pre/post-market, overnight, and broker queue fields are only returned in applicable scenarios.
- Treat arrays as possibly empty:
ask_list,bid_list,ticker_list,kl_list, and other arrays may be empty. - Backfill after disconnect: Push is for real-time updates. After a disconnect, reconnect, or parse failure, use the REST real-time quote API to retrieve the latest state.