# 2.2. Topics

<table data-header-hidden><thead><tr><th width="180.272705078125"></th><th></th></tr></thead><tbody><tr><td>Stock Info</td><td>plaintext/quotes/stock/SI/<strong>{symbol}</strong></td></tr><tr><td>Top Price</td><td>plaintext/quotes/stock/TP/<strong>{symbol}</strong></td></tr><tr><td>Session</td><td>plaintext/quotes/session/<strong>{exchangeCode}</strong></td></tr><tr><td>Market Index</td><td>plaintext/quotes/index/MI/<strong>{marketID}</strong></td></tr><tr><td>OHLC</td><td>plaintext/quotes/<strong>{type}</strong>/OHLC/<strong>{resolution}</strong>/<strong>{symbol}</strong></td></tr><tr><td>Tick</td><td>plaintext/quotes/stock/tick/<strong>{symbol}</strong></td></tr></tbody></table>

| Field        | Type   | Description                                                                                                                |
| ------------ | ------ | -------------------------------------------------------------------------------------------------------------------------- |
| symbol       | String | Mã chứng khoán                                                                                                             |
| exchangeCode | String | <p>Mã sàn:</p><ul><li>HSX: Sàn HCM</li><li>HNX: Sàn HN</li><li>UPCOM: Sàn Upcom</li></ul>                                  |
| marketID     | String | <p>Mã Index:</p><ul><li>VN30</li><li>VNALLSHARE</li><li>VNINDEX</li><li>HNX30</li></ul>                                    |
| type         | String | <p>Loại OHLC:</p><ul><li>stock: mã CK cơ sở</li><li>index: chỉ số thị trường</li><li>derivative: mã CK phái sinh</li></ul> |
| resolution   | String | <p>Resolution của OHLC:</p><ul><li>1: Phút</li><li>1H: Giờ</li><li>1D: Ngày</li><li>W: Tuần</li></ul>                      |

Cấu trúc message được nhận qua WebSocket. Định dạng JSON

| Type             | Payload     | Mô tả                         | Topic MQTT   |
| ---------------- | ----------- | ----------------------------- | ------------ |
| MARKET\_INDEX    | MarketIndex | Chứa thông tin chỉ số         | Market Index |
| STOCK\_INFO      | StockInfo   | Chứa thông tin giá của mã     | Stock Info   |
| TOP\_PRICE       | TopPrice    | Chứa thông tin Bid/Offer      | Top Price    |
| TRADING\_SESSION | Session     | Chứa thông tin thay đổi phiên | Session      |
| OHLC             | OHLC        | Thông tin nến                 | OHLC         |
| TICK             | Tick        | Thông tin khớp lệnh           | Tick         |

Chi tiết message xem tại file **1. DNSE MDDS System.xlsx** đính kèm.

{% file src="/files/IasqypJy1lkPTDklnGBo" %}

(MQTT X client dùng để test kết nối: <https://www.emqx.com/en/try?product=MQTTX>)

* Examples: <https://github.com/emqx/MQTT-Client-Examples>
* DNSE Python Example: theo file **2. json\_sub\_wss\_v5.py** đính kèm.

{% file src="/files/epiFh1iVTQmc4pwkZc7e" %}

Chi tiết message xem tại file **1. DNSE MDDS System.xlsx** đính kèm.

{% file src="/files/aSvlcJ68hT6CrxjXI2mI" %}

(MQTT X client dùng để test kết nối: <https://www.emqx.com/en/try?product=MQTTX>)

* Examples: <https://github.com/emqx/MQTT-Client-Examples>
* DNSE Python Example: theo file **2. json\_sub\_wss\_v5.py** đính kèm.

{% file src="/files/a3FT47uz3R8MCtYyN8YQ" %}


---

# 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://hdsd.dnse.com.vn/san-pham-dich-vu/lightspeed-api-truoc-krx/iii.-market-data/2.-dac-ta-thong-tin-cac-message/2.2.-topics.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.
