China A-Share Quotes
China A-Share Quotes
Documentation
API Introduction
This API provides real-time quote data for China's A-share market (including Shanghai, Shenzhen, and Beijing Stock Exchanges). Developers can obtain detailed market information, such as the latest price, change, change rate, trading volume, trading value, and bid/ask order book (top five bids/asks), by passing stock symbols. The data coverage is comprehensive, suitable for applications requiring real-time monitoring of stock market dynamics.
Applicable Scenarios
- Financial News Applications: Provide real-time stock price display for stock trading software and financial news portals.
- Quantitative Analysis Systems: Serve as a fundamental data source for strategy backtesting or real-time signal triggering.
- Enterprise Monitoring Dashboards: Used internally by listed companies or investment institutions to monitor the market performance of their holdings or watchlist stocks.
- Personal Investment Assistants: Integrated into WeChat mini-programs or apps to provide users with convenient individual stock inquiry services.
Request and Response Description
Request Method: POST Request Parameters:
symbol(Required, string): Instrument code, supports multiple codes separated by English commas. The format must include the exchange prefix, e.g.,sz000002(Shenzhen),sh600000(Shanghai),bj430047(Beijing Stock Exchange).
Response Results:
code: Business status code, 200 indicates success.data: Core data object, where the key is the stock symbol and the value is the detailed object for that stock, including:name: Stock nameprice: Real-time pricechange/changeRate: Change amount and change ratehigh/low: Today's highest/lowest pricevolume/value: Trading volume and trading valuebid1_vol~bid5_vol/ask1_vol~ask5_vol: Bid 1 to Bid 5, Ask 1 to Ask 5 volumes
Integration Suggestions
- Code Format Specification: Ensure that the
symbolpassed includes the correct exchange prefix (sh/sz/bj); otherwise, it may lead to query failure or data errors. - Batch Query Optimization: The API supports querying multiple stocks separated by commas. It is recommended to combine multiple stocks on the same page into a single request to reduce network overhead and improve loading speed.
- Caching Strategy: Although real-time data is provided, considering front-end display frequency, it is recommended to set a second-level cache in non-high-frequency trading scenarios to avoid excessively frequent calls.
- Error Handling: Always check the returned
codefield. Only parse thedatacontent when the code is 200, and properly handle network timeouts or service unavailability.
Integration Examples
Includes ready-to-use Shell, Python, Go, Java, and PHP examples for direct integration.
Request Example
{
"symbol": "品种代码,以英文逗号分割,如:sz000002,bj430047"
}Response Example
{
"msg": "成功",
"code": 200,
"taskNo": "202960247220113090298671",
"data": {
"sh688193": {
"name": "仁度生物",
"bid1_vol": "3850",
"high": "28.670",
"update_time": 1713336733,
"low": "26.710",
"price": "27.910",
"ask1_vol": "454",
"bid2_vol": "700",
"changeRate": "4.6887",
"ask5_vol": "600",
"value": "8457252.000",
"bid4_vol": "40",
"change": "1.2500",
"bid3_vol": "1400",
"ask2_vol": "843",
"volume": "303488",
"bid5_vol": "1400",
"ask4_vol": "2064",
"ask5": "28.160",
"ask2": "28.010",
"ask1": "28.000",
"bid5": "27.780",
"ask4": "28.130",
"ask3": "28.020",
"ask": "28.000",
"bid3": "27.840",
"bid4": "27.830",
"bid1": "27.900",
"bid2": "27.850",
"preclose": "26.660",
"bid": "27.900",
"open": "26.880",
"ask3_vol": "1400"
}
}
}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 | 品种代码,以英文逗号分割,如:sz000002,bj430047 |
| 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 | {...} |