China Precious Metals Candlestick Charts
China Precious Metals Candlestick Charts
Documentation
API Introduction
This API provides historical K-line market data for major domestic precious metal varieties. It supports spot products from the Shanghai Gold Exchange (e.g., AUTD, AGTD) and futures monthly contracts. Developers can obtain structured data including open, close, high, low, and volume by specifying the product code and time period.
Use Cases
- Financial News Applications: Provides real-time updated precious metal trend chart data sources for apps or websites.
- Quantitative Strategy Backtesting: Obtain historical minute-level or daily-level data for validating trading models.
- Investment Analysis Tools: Build personal investment portfolio monitoring dashboards to display asset price fluctuation trends.
Request and Response Description
Core Request Parameters:
symbol(Required): Precious metal product code, only supports spot (e.g., AUTD, AGTD) and specific futures contracts.type(Required): K-line period type. 0 represents daily K-line, while 1/5/30/60/120/240 correspond to K-lines of respective minute periods.limit(Optional): Number of data entries to return, defaults to 10.
Response Result: The response data includes a lines array and fields field definition. Each sub-array in lines is ordered according to the fields definition, typically including: open price (open), close price (close), high price (high), low price (low), change amount (change), change rate (changeRate), trading volume (volume), and timestamp (tick_at).
Integration Suggestions
- Product Validation: Please ensure that the
symbolpassed is within the supported list of spot or futures products to avoid invalid queries. - Period Selection: For high-frequency trading scenarios, 1-minute or 5-minute K-lines are recommended; for long-term trend analysis, using daily K-lines (
type=0) is suggested to reduce data volume. - Data Parsing: Since the response uses a compact array format to improve transmission efficiency, please make sure to read the
fieldsfield first to determine the index meanings before parsing thelinesdata.
Integration Examples
Includes ready-to-use Shell, Python, Go, Java, and PHP examples for direct integration.
Request Example
{
"symbol": "国内贵金属品种,仅支持现货AUTD,AGTD和期货的月份合约,详见国内贵金属现货,详见国内贵金属期货",
"type": "k线类型 0:日k 1:1分钟 5:五分钟 30:30分钟 60:60分钟 120:120分钟 240:240分钟",
"limit": "返回条数 默认10"
}Response Example
{
"code": 200,
"msg": "成功",
"taskNo": "089625202232146663243632",
"data": {
"lines": [
[
621.5,
624.78,
625.7,
620.32,
3.28,
0.53,
34402,
1730044800
]
],
"fields": [
"open",
"close",
"high",
"low",
"change",
"changeRate",
"volume",
"tick_at"
]
}
}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 | 国内贵金属品种,仅支持现货AUTD,AGTD和期货的月份合约,详见国内贵金属现货,详见国内贵金属期货 |
| properties.type | object | {...} |
| properties.type.type | string |
Response Fields
The fields below are derived from example JSON for integration reference only.
| Path | Type | Sample |
|---|---|---|
| type | string | object |
| properties | object | {...} |
| properties.code | object | {...} |
| properties.code.type | string | number |
| properties.code.example | number | 200 |
| properties.code.description | string | 返回码对应描述 |
| properties.msg | object | {...} |