finance-a-kline-restoration
A-Share Adjusted Candlestick Chart
A-Share Adjusted Candlestick Chart
Usage Cost
5 coins/call
Quick Start
Use a unified response envelope and call directly from your backend.
https://openapi.toolkk.com/v1/finance-a-kline-restorationcURL Example
curl --request POST \
--url 'https://openapi.toolkk.com/v1/finance-a-kline-restoration' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: YOUR_API_KEY' \
--data '{\n "symbol": "品种代码,如:sh688193",\n "type": "1:1分钟K线;5:5分钟K线;15:15分钟K线; 30:30分钟K线;60:60分钟K线;101:日K线;102:周K线;103:月K线; 104:季度K线...",\n "limit": "返回条数,默认10",\n "fuquan": "复权状态,0不复权,1前复权,2后复权"\n}'Python Example
import os
import requests
url = "https://openapi.toolkk.com/v1/finance-a-kline-restoration"
payload = {
"symbol": "品种代码,如:sh688193",
"type": "1:1分钟K线;5:5分钟K线;15:15分钟K线; 30:30分钟K线;60:60分钟K线;101:日K线;102:周K线;103:月K线; 104:季度K线...",
"limit": "返回条数,默认10",
"fuquan": "复权状态,0不复权,1前复权,2后复权"
}
headers = {
"Content-Type": "application/json",
"X-API-Key": os.getenv("TOOLKK_API_KEY", "YOUR_API_KEY"),
}
response = requests.request("POST", url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.json())Go Example
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
endpoint := "https://openapi.toolkk.com/v1/finance-a-kline-restoration"
payload := []byte("{\n \"symbol\": \"品种代码,如:sh688193\",\n \"type\": \"1:1分钟K线;5:5分钟K线;15:15分钟K线; 30:30分钟K线;60:60分钟K线;101:日K线;102:周K线;103:月K线; 104:季度K线...\",\n \"limit\": \"返回条数,默认10\",\n \"fuquan\": \"复权状态,0不复权,1前复权,2后复权\"\n}")
req, err := http.NewRequest("POST", endpoint, bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}Java Example
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class ToolkkExample {
public static void main(String[] args) throws Exception {
String payload = "{\n \"symbol\": \"品种代码,如:sh688193\",\n \"type\": \"1:1分钟K线;5:5分钟K线;15:15分钟K线; 30:30分钟K线;60:60分钟K线;101:日K线;102:周K线;103:月K线; 104:季度K线...\",\n \"limit\": \"返回条数,默认10\",\n \"fuquan\": \"复权状态,0不复权,1前复权,2后复权\"\n}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://openapi.toolkk.com/v1/finance-a-kline-restoration"))
.method("POST", HttpRequest.BodyPublishers.ofString(payload))
.header("Content-Type", "application/json")
.header("X-API-Key", "YOUR_API_KEY")
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}PHP Example
<?php
$endpoint = 'https://openapi.toolkk.com/v1/finance-a-kline-restoration';
$payload = "{\n \"symbol\": \"品种代码,如:sh688193\",\n \"type\": \"1:1分钟K线;5:5分钟K线;15:15分钟K线; 30:30分钟K线;60:60分钟K线;101:日K线;102:周K线;103:月K线; 104:季度K线...\",\n \"limit\": \"返回条数,默认10\",\n \"fuquan\": \"复权状态,0不复权,1前复权,2后复权\"\n}";
$ch = curl_init($endpoint);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-API-Key: YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;Response Example
[
{
"volume": 34239,
"high_px": 22.06,
"change": 0.07,
"close_px": 22.03,
"low_px": 21.93,
"changeRate": 0.32,
"value": 75339657,
"day": "2024-04-19 14:30",
"open": 21.96
}
]Examples illustrate the response structure. Actual results depend on the API response.
- Authentication
- Send X-API-Key in request headers
- Rate limit
- 60 req/min
- Timeout
- 5000 ms
Send your API Key in the X-API-Key header from your backend.
Check both HTTP status and business fields before treating a call as successful.
Use retries and backoff together with rate limits in high-frequency scenarios.
Request Fields
Send requests from your server with the key in the X-API-Key header.
Request Fields
Fields are read from the API schema. Missing descriptions and examples are marked as unspecified.
| Path | Type | Required | Description | Sample |
|---|---|---|---|---|
| symbol | string | Yes | 品种代码,如:sh688193 | Unspecified |
| type | string | Yes | 1:1分钟K线;5:5分钟K线;15:15分钟K线; 30:30分钟K线;60:60分钟K线;101:日K线;102:周K线;103:月K线; 104:季度K线;105:半年K线;106:年K线 | Unspecified |
| limit | string | No | 返回条数,默认10 | Unspecified |
| fuquan | string | Yes | 复权状态,0不复权,1前复权,2后复权 | Unspecified |
Request Example
{
"symbol": "品种代码,如:sh688193",
"type": "1:1分钟K线;5:5分钟K线;15:15分钟K线; 30:30分钟K线;60:60分钟K线;101:日K线;102:周K线;103:月K线; 104:季度K线...",
"limit": "返回条数,默认10",
"fuquan": "复权状态,0不复权,1前复权,2后复权"
}- Authentication
- Send X-API-Key in request headers
- Rate limit
- 60 req/min
- Timeout
- 5000 ms
Response Fields
Examples illustrate the response structure. Actual results depend on the API response.
Response Fields
Fields are read from the API schema. Missing descriptions and examples are marked as unspecified.
| Path | Type | Required | Description | Sample |
|---|---|---|---|---|
| [] | object | Unspecified | Unspecified | Unspecified |
| [].volume | number | No | 成交量 | 34239 |
| [].high_px | number | No | 最高价 | 22.06 |
| [].change | number | No | 涨跌额 | 0.07 |
| [].close_px | number | No | 收盘价 | 22.03 |
| [].low_px | number | No | 最低价 | 21.93 |
| [].changeRate | number | No | 涨跌率 | 0.32 |
| [].value | number | No | 成交额 | 75339657 |
| [].day | string | No | 数据时间,具体到分钟 | 2024-04-19 14:30 |
| [].open | number | No | 开盘价 | 21.96 |
Response Example
[
{
"volume": 34239,
"high_px": 22.06,
"change": 0.07,
"close_px": 22.03,
"low_px": 21.93,
"changeRate": 0.32,
"value": 75339657,
"day": "2024-04-19 14:30",
"open": 21.96
}
]API overview
Capabilities, use cases, limitations, and frequently asked questions.
API Introduction
This API provides K-line historical data query services for A-share market stocks, with the core capability of supporting ex-dividend adjustment. Developers can obtain a complete market data array, including open price, close price, high price, low price, trading volume, trading value, and change information, by specifying the stock symbol, K-line period (from 1-minute to yearly K), and adjustment type (forward adjustment, backward adjustment, or no adjustment).
Applicable Scenarios
- Quantitative Trading Strategy Backtesting: Use forward-adjusted data to eliminate the impact of ex-dividend and ex-rights, ensuring price series continuity and improving backtesting accuracy.
- Financial Chart Display: Provide standardized K-line data for stock trading software or financial websites, supporting users to switch and view trends under different adjustment statuses.
- Technical Pattern Analysis: Calculate moving averages, MACD, and other technical indicators based on continuous price data, avoiding data discontinuities caused by dividends and rights issues.
Request and Response Description
Request Parameters:
symbol(Required): Instrument code, e.g.,sh688193.