technical-indicator
Technical Indicator Query
Calculates and returns historical data for common technical indicators like MACD, RSI, BOLL, etc., based on specified financial instrument contract code, K-line timeframe, and indicator parameters.
Usage Cost
5 coins/call
Quick Start
Use a unified response envelope and call directly from your backend.
https://openapi.toolkk.com/v1/aliyunmarket-cmapi029045-query-indicatorcURL Example
curl --request GET \
--url 'https://openapi.toolkk.com/v1/aliyunmarket-cmapi029045-query-indicator' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: YOUR_API_KEY' \
--data '{\n "symbol": "合约代码(参考连接 http://demo.konpn.com/symbols.shtml )。指标数据只输出最新的10个。计算数据可能因参数原因导致有误,请反...",\n "period": "周期取 15S(可能有),1M,3M,5M,10M,15M,30M,1H,2H,4H,D(W周,M月可能有)",\n "indkey": "指标Key,支持指标这里查询 map.konpn.com:10002/localrm/query/indicatorlist",\n "outputcount": "输出数量,最多500",\n "args": "指标参数,json的urlencode传入。对应指标参数格式这里查询 map.konpn.com:10002/localrm/query/indicatorge..."\n}'Python Example
import os
import requests
url = "https://openapi.toolkk.com/v1/aliyunmarket-cmapi029045-query-indicator"
payload = {
"symbol": "合约代码(参考连接 http://demo.konpn.com/symbols.shtml )。指标数据只输出最新的10个。计算数据可能因参数原因导致有误,请反...",
"period": "周期取 15S(可能有),1M,3M,5M,10M,15M,30M,1H,2H,4H,D(W周,M月可能有)",
"indkey": "指标Key,支持指标这里查询 map.konpn.com:10002/localrm/query/indicatorlist",
"outputcount": "输出数量,最多500",
"args": "指标参数,json的urlencode传入。对应指标参数格式这里查询 map.konpn.com:10002/localrm/query/indicatorge..."
}
headers = {
"Content-Type": "application/json",
"X-API-Key": os.getenv("TOOLKK_API_KEY", "YOUR_API_KEY"),
}
response = requests.get(url, headers=headers, params=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/aliyunmarket-cmapi029045-query-indicator"
payload := []byte("{\n \"symbol\": \"合约代码(参考连接 http://demo.konpn.com/symbols.shtml )。指标数据只输出最新的10个。计算数据可能因参数原因导致有误,请反...\",\n \"period\": \"周期取 15S(可能有),1M,3M,5M,10M,15M,30M,1H,2H,4H,D(W周,M月可能有)\",\n \"indkey\": \"指标Key,支持指标这里查询 map.konpn.com:10002/localrm/query/indicatorlist\",\n \"outputcount\": \"输出数量,最多500\",\n \"args\": \"指标参数,json的urlencode传入。对应指标参数格式这里查询 map.konpn.com:10002/localrm/query/indicatorge...\"\n}")
req, err := http.NewRequest("GET", 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\": \"合约代码(参考连接 http://demo.konpn.com/symbols.shtml )。指标数据只输出最新的10个。计算数据可能因参数原因导致有误,请反...\",\n \"period\": \"周期取 15S(可能有),1M,3M,5M,10M,15M,30M,1H,2H,4H,D(W周,M月可能有)\",\n \"indkey\": \"指标Key,支持指标这里查询 map.konpn.com:10002/localrm/query/indicatorlist\",\n \"outputcount\": \"输出数量,最多500\",\n \"args\": \"指标参数,json的urlencode传入。对应指标参数格式这里查询 map.konpn.com:10002/localrm/query/indicatorge...\"\n}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://openapi.toolkk.com/v1/aliyunmarket-cmapi029045-query-indicator"))
.method("GET", 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/aliyunmarket-cmapi029045-query-indicator';
$payload = "{\n \"symbol\": \"合约代码(参考连接 http://demo.konpn.com/symbols.shtml )。指标数据只输出最新的10个。计算数据可能因参数原因导致有误,请反...\",\n \"period\": \"周期取 15S(可能有),1M,3M,5M,10M,15M,30M,1H,2H,4H,D(W周,M月可能有)\",\n \"indkey\": \"指标Key,支持指标这里查询 map.konpn.com:10002/localrm/query/indicatorlist\",\n \"outputcount\": \"输出数量,最多500\",\n \"args\": \"指标参数,json的urlencode传入。对应指标参数格式这里查询 map.konpn.com:10002/localrm/query/indicatorge...\"\n}";
$ch = curl_init($endpoint);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
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
{
"code": "SUCCESS",
"message": "success",
"data": [
{
"Tick": 1624636800,
"Histogram": -405.5369,
"Macd": -1953.8285,
"Signal": -1751.06
},
{
"Tick": 1624723200,
"Histogram": -220.8641,
"Macd": -1889.1001,
"Signal": -1778.668
}
]
}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 | 合约代码(参考连接 http://demo.konpn.com/symbols.shtml )。指标数据只输出最新的10个。计算数据可能因参数原因导致有误,请反馈 | Unspecified |
| period | string | Yes | 周期取 15S(可能有),1M,3M,5M,10M,15M,30M,1H,2H,4H,D(W周,M月可能有) | Unspecified |
| indkey | string | Yes | 指标Key,支持指标这里查询 map.konpn.com:10002/localrm/query/indicatorlist | Unspecified |
| outputcount | int | No | 输出数量,最多500 | Unspecified |
| args | string | Yes | 指标参数,json的urlencode传入。对应指标参数格式这里查询 map.konpn.com:10002/localrm/query/indicatorget?indkey=macd/*指标key*/。输出的 Args 为该指标接受参数 | Unspecified |
Request Example
{
"symbol": "合约代码(参考连接 http://demo.konpn.com/symbols.shtml )。指标数据只输出最新的10个。计算数据可能因参数原因导致有误,请反...",
"period": "周期取 15S(可能有),1M,3M,5M,10M,15M,30M,1H,2H,4H,D(W周,M月可能有)",
"indkey": "指标Key,支持指标这里查询 map.konpn.com:10002/localrm/query/indicatorlist",
"outputcount": "输出数量,最多500",
"args": "指标参数,json的urlencode传入。对应指标参数格式这里查询 map.konpn.com:10002/localrm/query/indicatorge..."
}- 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
The fields below are derived from example JSON for integration reference only.
| Path | Type | Required | Description | Sample |
|---|---|---|---|---|
| code | string | Unspecified | Unspecified | SUCCESS |
| message | string | Unspecified | Unspecified | success |
| data | array | Unspecified | Unspecified | [{"Tick":1624636800,"Histogram":-405.5369,"Macd":-1953.8285,"Signal":-1751.06},{"Tick":1624723200,"Histogram":-220.8641,"Macd":-1889.1001,"Signal":-1778.668}] |
| data[] | object | Unspecified | Unspecified | {...} |
| data[].Tick | number | Unspecified | Unspecified | 1624636800 |
| data[].Histogram | number | Unspecified | Unspecified | -405.5369 |
| data[].Macd | number | Unspecified | Unspecified | -1953.8285 |
| data[].Signal | number | Unspecified | Unspecified | -1751.06 |
Response Example
{
"code": "SUCCESS",
"message": "success",
"data": [
{
"Tick": 1624636800,
"Histogram": -405.5369,
"Macd": -1953.8285,
"Signal": -1751.06
},
{
"Tick": 1624723200,
"Histogram": -220.8641,
"Macd": -1889.1001,
"Signal": -1778.668
}
]
}API overview
Capabilities, use cases, limitations, and frequently asked questions.
API Capabilities
This API is used to calculate and query technical indicator data for global financial instruments. It supports various mainstream technical indicators suchs as MACD, RSI, BOLL, EMA, KDJ, CCI, ATR, etc. Developers can specify the contract code, K-line timeframe, and specific indicator parameters to obtain the calculated indicator value sequences.
Request and Response
- Request Parameters: Must include
symbol(contract code),period(timeframe, e.g., 1M, 15M, 1H, D, etc.),indkey(indicator key, e.g., macd), andargs(indicator parameters, a URL-encoded JSON string). Optionally,outputcountcan be passed to control the number of outputs (max 500). - Response Result: Returns the indicator calculation results for the specified timeframe. For example, the MACD indicator will return values such as timestamp (Tick), histogram (Histogram), DIF (Macd), and DEA (Signal).
Use Cases
- Market Charting: Provide rich technical indicator data sources for frontend K-line chart components, assisting users with technical analysis.