Domestic Futures Candlestick Chart
Domestic Futures Candlestick Charts
Documentation
API Introduction
This API provides historical K-line data query services for the domestic futures market. It supports obtaining market data for specified periods via futures product codes, covering core indicators such as open, close, high, low, and trading volume. Data is returned in an array format, facilitating front-end chart rendering or back-end quantitative calculations.
Use Cases
- Quantitative Trading Strategy Backtesting: Obtain historical minute-level or daily data for strategy validation.
- Financial Terminal Development: Provide real-time or historical K-line chart data sources for apps or web clients.
- Market Trend Monitoring: Monitor the volatility of specific futures products to assist investment decisions.
Request and Response Description
Request Method: POST Key Parameters:
symbol(Required): Futures product code, must refer to the standard code table.type(Required): K-line type, supports 0 (Daily K), 1 (1-minute), 5 (5-minute), 30/60/120/240 minutes, etc.limit(Optional): Number of data entries to return, defaults to 10.
Response Structure:
data.lines: Two-dimensional array, each item represents a K-line, ordered corresponding to fields defined infields(e.g., open, close, high, low, change, changeRate, volume, tick_at).data.fields: Field definition array, clarifying the specific meaning of each value inlines.code: Status code, 200 indicates success.
Integration Suggestions
- Code Mapping: Please ensure that the
symbolpassed is consistent with the exchange's standard code to avoid query failures. - Period Selection: Choose the appropriate
typebased on business needs; minute-level data is recommended for high-frequency trading, and daily K-lines for trend analysis. - Data Parsing: The returned K-line data is in a compact array format and needs to be parsed with key-value mapping using the
fieldsarray to improve transmission efficiency.
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
{
"msg": "成功",
"taskNo": "075556736233047430019762",
"code": 200,
"data": {
"lines": [
[
552.44,
552.82,
553.2,
552.36,
0.38,
0.07,
2516,
1717178400
]
],
"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.msg | object | {...} |
| properties.msg.type | string | string |
| properties.msg.example | string | 成功 |
| properties.msg.description | string | 返回码对应描述 |
| properties.taskNo | object | {...} |