批量查询 K线数据
curl --request GET \
--url https://api.tickflow.org/v1/klines/batch \
--header 'x-api-key: <api-key>'import requests
url = "https://api.tickflow.org/v1/klines/batch"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.tickflow.org/v1/klines/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tickflow.org/v1/klines/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tickflow.org/v1/klines/batch"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tickflow.org/v1/klines/batch")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickflow.org/v1/klines/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {}
}{
"code": "INVALID_PERIOD",
"message": "Invalid period: 2d",
"details": "<unknown>"
}{
"code": "INVALID_PERIOD",
"message": "Invalid period: 2d",
"details": "<unknown>"
}{
"code": "INVALID_PERIOD",
"message": "Invalid period: 2d",
"details": "<unknown>"
}常用 API
批量查询 K线数据
GET
/
v1
/
klines
/
batch
批量查询 K线数据
curl --request GET \
--url https://api.tickflow.org/v1/klines/batch \
--header 'x-api-key: <api-key>'import requests
url = "https://api.tickflow.org/v1/klines/batch"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.tickflow.org/v1/klines/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tickflow.org/v1/klines/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tickflow.org/v1/klines/batch"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tickflow.org/v1/klines/batch")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickflow.org/v1/klines/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {}
}{
"code": "INVALID_PERIOD",
"message": "Invalid period: 2d",
"details": "<unknown>"
}{
"code": "INVALID_PERIOD",
"message": "Invalid period: 2d",
"details": "<unknown>"
}{
"code": "INVALID_PERIOD",
"message": "Invalid period: 2d",
"details": "<unknown>"
}授权
查询参数
标的代码,逗号分隔, 例如 "600000.SH,000001.SZ"
周期 K线周期
可用选项:
1m, 5m, 10m, 15m, 30m, 60m, 1d, 1w, 1M, 1Q, 1Y 返回的K线数量 (默认100, 最大10000)
必填范围:
x >= 0开始时间(毫秒时间戳)
结束时间(毫秒时间戳)
复权类型
可用选项:
forward, backward, forward_additive, backward_additive, none 响应
查询成功
Show child attributes
Show child attributes
⌘I
