Hong Kong Stock Quotes
Hong Kong Stock Quotes
Documentation
API Introduction
This API provides real-time market data query services for specified stocks in the Hong Kong stock market. By passing stock symbols, developers can obtain core financial indicators including the latest price, change amount, trading volume, trading value, bid/ask order book, today's high/low, and 52-week extremes. Data is returned in JSON format, supporting batch queries for multiple stocks in a single request, suitable for business scenarios requiring high-frequency or batch retrieval of basic Hong Kong stock market data.
Applicable Scenarios
- Financial News Applications: Provide real-time price refresh functionality for Hong Kong stock list pages in apps or websites.
- Quantitative Trading Assistance: Serve as a fundamental data source for strategy systems, monitoring price fluctuations and trading volume changes for specific targets.
- Investment Portfolio Management: Real-time calculation of portfolio market value and display of account profit/loss.
- Market Data Analysis: Collect real-time snapshots before historical minute-by-minute data, used for analyzing market sentiment and capital flows.
Request and Response Description
Request Method: POST Request Parameters:
symbol(Required, String): Hong Kong stock symbol, multiple codes separated by English commas, e.g.,08026,02203.
Response Results:
code: Business status code, 200 indicates success.data: A collection of objects containing details for each stock, with the stock symbol as the key.price: Real-time pricechange/changeRate: Change amount and change ratevolume/value: Trading volume and trading valuebid/ask: Bid 1 price and Ask 1 pricehigh/low: Today's highest/lowest price52week_high/52week_low: 52-week highest/lowest price- : Data update timestamp
Integration Suggestions
- Batch Query Optimization: It is recommended to combine stock symbols that need to be updated in the same batch into a single request to reduce network overhead and API call frequency.
- Caching Strategy: Data changes frequently during Hong Kong stock trading hours and is static during non-trading hours. It is recommended to determine data freshness based on
update_timeto avoid invalid polling. - Error Handling: Please check the returned
codefield instead of relying solely on HTTP status codes. If a stock is suspended or the symbol is incorrect, the corresponding key-value may be empty or return specific error messages, which need to be handled gracefully. - Time Zone Awareness: The returned timestamp is usually a Unix timestamp. When displaying on the front end, it needs to be converted to the user's local time zone or the Hong Kong stock trading time zone (HKT).
Integration Examples
Includes ready-to-use Shell, Python, Go, Java, and PHP examples for direct integration.
Request Example
{
"symbol": "品种代码,以英文逗号分割,如:08026,02203"
}Response Example
{
"msg": "成功",
"code": 200,
"taskNo": "202960247220113090298671",
"data": {
"08026": {
"change": "-0.015",
"enname": "CB GLOBAL",
"volume": "546000",
"high": "0.237",
"update_time": 1713763480,
"low": "0.211",
"pe": "0.000",
"price": "0.216",
"name": "朗华国际集团",
"ask": "0.219",
"52week_low": "0.173",
"preclose": "0.231",
"changeRate": "-6.494",
"bid": "0.213",
"value": "117030.000",
"open": "0.212",
"52week_high": "0.650"
},
"02203": {}
}
}Request Fields
The fields below are derived from example JSON for integration reference only.
| Path | Type | Sample |
|---|---|---|
| type | string | object |
| properties | object | {...} |
| properties.symbol | object | {...} |
| properties.symbol.type | string | string |
| properties.symbol.description | string | 品种代码,以英文逗号分割,如:08026,02203 |
| required | array | "symbol" |
| required[] | string | symbol |
Response Fields
The fields below are derived from example JSON for integration reference only.
| Path | Type | Sample |
|---|---|---|
| type | string | object |
| properties | object | {...} |
| properties.msg | object | {...} |
| properties.msg.type | string | string |
| properties.msg.example | string | 成功 |
| properties.msg.description | string | 接口返回码对应的描述信息 |
| properties.code | object | {...} |