Global Precious Metals Candlestick Charts
Global Precious Metals Candlestick Charts
Documentation
API Introduction
This API provides historical K-line (candlestick) market data for international precious metals (including spot and futures). Developers can obtain a structured data array containing open, close, high, low prices, change percentage, trading volume, and timestamp by specifying the trading variety symbol (symbol) and K-line type (type).
Use Cases
- Financial News Applications: Display real-time trend charts for precious metals like gold and silver in apps or on websites.
- Quantitative Analysis Assistance: Provide basic historical price series data for trading strategies, used for technical indicator calculations.
- Investment Research Data Integration: Embed into internal enterprise analysis systems to monitor short-term or long-term price fluctuations of specific precious metal varieties.
Request and Response Details
Request Parameters:
symbol(Required): International precious metal variety code, must refer to specific spot or futures code tables.type(Required): K-line period type. Supports0(Daily K),1(1-minute),5(5-minute),30(30-minute),60(60-minute),120(120-minute),240(240-minute).limit(Optional): Number of data entries to return, defaults to 10.
Response Result:
data.lines: A two-dimensional array, where each sub-array corresponds to a K-line (candlestick) and its order matches the fields defined infields(e.g., open, close, high, low, change, changeRate, volume, tick_at).data.fields: An array defining fields, clarifying the specific meaning of values inlines.code/msg: Status code and description, 200 indicates success.
Integration Recommendations
- Variety Code Confirmation: Please ensure to consult the standard code tables for "International Precious Metal Spot" or "International Precious Metal Futures" to ensure the
symbolparameter is accurate. - Period Selection: Choose the appropriate
typebased on business requirements. Minute-level (1/5/30) is recommended for high-frequency trading monitoring, while Daily K (0) is suggested for trend analysis. - Data Parsing: The returned
linesis a pure numerical array; it needs to be mapped with thefieldsarray to avoid parsing errors caused by hardcoded indices. - Caching Strategy: Historical K-line data changes less frequently; it is recommended to implement appropriate caching on the client or server to reduce API calls and improve loading speed.
Integration Examples
Includes ready-to-use Shell, Python, Go, Java, and PHP examples for direct integration.
Request Example
{
"symbol": "国际贵金属品种,详见国际贵金属现货,详见国际贵金属期货",
"type": "k线类型 0:日k 1:1分钟 5:五分钟 30:30分钟 60:60分钟 120:120分钟 240:240分钟",
"limit": "返回条数 默认10"
}Response Example
{
"code": 200,
"msg": "成功",
"taskNo": "881490008152974143098955",
"data": {
"lines": [
[
2734.83,
2736,
2736.09,
2734.83,
1.17,
0.04,
55,
1732310100
],
[
2736,
2736.63,
2736.63,
2736,
0.63,
0.02,
42,
1732310400
]
],
"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 | 国际贵金属品种,详见国际贵金属现货,详见国际贵金属期货 |
| 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 | {...} |