Stock Batch K-Line Query
curl --request POST \
--url https://quote.alltick.co/quote-stock-b-api/batch-kline \
--header 'Content-Type: application/json' \
--data '
{
"trace": "abc-123",
"data": {
"data_list": [
{
"code": "700.HK",
"kline_type": 1,
"kline_timestamp_end": 0,
"query_kline_num": 2,
"adjust_type": 0
},
{
"code": "AAPL.US",
"kline_type": 8,
"kline_timestamp_end": 0,
"query_kline_num": 2,
"adjust_type": 0
}
]
}
}
'import requests
url = "https://quote.alltick.co/quote-stock-b-api/batch-kline"
payload = {
"trace": "abc-123",
"data": { "data_list": [
{
"code": "700.HK",
"kline_type": 1,
"kline_timestamp_end": 0,
"query_kline_num": 2,
"adjust_type": 0
},
{
"code": "AAPL.US",
"kline_type": 8,
"kline_timestamp_end": 0,
"query_kline_num": 2,
"adjust_type": 0
}
] }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
trace: 'abc-123',
data: {
data_list: [
{
code: '700.HK',
kline_type: 1,
kline_timestamp_end: 0,
query_kline_num: 2,
adjust_type: 0
},
{
code: 'AAPL.US',
kline_type: 8,
kline_timestamp_end: 0,
query_kline_num: 2,
adjust_type: 0
}
]
}
})
};
fetch('https://quote.alltick.co/quote-stock-b-api/batch-kline', 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://quote.alltick.co/quote-stock-b-api/batch-kline",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'trace' => 'abc-123',
'data' => [
'data_list' => [
[
'code' => '700.HK',
'kline_type' => 1,
'kline_timestamp_end' => 0,
'query_kline_num' => 2,
'adjust_type' => 0
],
[
'code' => 'AAPL.US',
'kline_type' => 8,
'kline_timestamp_end' => 0,
'query_kline_num' => 2,
'adjust_type' => 0
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://quote.alltick.co/quote-stock-b-api/batch-kline"
payload := strings.NewReader("{\n \"trace\": \"abc-123\",\n \"data\": {\n \"data_list\": [\n {\n \"code\": \"700.HK\",\n \"kline_type\": 1,\n \"kline_timestamp_end\": 0,\n \"query_kline_num\": 2,\n \"adjust_type\": 0\n },\n {\n \"code\": \"AAPL.US\",\n \"kline_type\": 8,\n \"kline_timestamp_end\": 0,\n \"query_kline_num\": 2,\n \"adjust_type\": 0\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://quote.alltick.co/quote-stock-b-api/batch-kline")
.header("Content-Type", "application/json")
.body("{\n \"trace\": \"abc-123\",\n \"data\": {\n \"data_list\": [\n {\n \"code\": \"700.HK\",\n \"kline_type\": 1,\n \"kline_timestamp_end\": 0,\n \"query_kline_num\": 2,\n \"adjust_type\": 0\n },\n {\n \"code\": \"AAPL.US\",\n \"kline_type\": 8,\n \"kline_timestamp_end\": 0,\n \"query_kline_num\": 2,\n \"adjust_type\": 0\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://quote.alltick.co/quote-stock-b-api/batch-kline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"trace\": \"abc-123\",\n \"data\": {\n \"data_list\": [\n {\n \"code\": \"700.HK\",\n \"kline_type\": 1,\n \"kline_timestamp_end\": 0,\n \"query_kline_num\": 2,\n \"adjust_type\": 0\n },\n {\n \"code\": \"AAPL.US\",\n \"kline_type\": 8,\n \"kline_timestamp_end\": 0,\n \"query_kline_num\": 2,\n \"adjust_type\": 0\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"ret": 123,
"msg": "<string>",
"trace": "<string>",
"data": {
"kline_list": [
{
"code": "<string>",
"kline_type": 123,
"kline_data": [
{
"timestamp": "<string>",
"open_price": "<string>",
"close_price": "<string>",
"high_price": "<string>",
"low_price": "<string>",
"volume": "<string>",
"turnover": "<string>"
}
]
}
]
}
}接口调试
POST /batch-kline 调试模块
POST /batch-kline 调试模块
POST
/
quote-stock-b-api
/
batch-kline
Stock Batch K-Line Query
curl --request POST \
--url https://quote.alltick.co/quote-stock-b-api/batch-kline \
--header 'Content-Type: application/json' \
--data '
{
"trace": "abc-123",
"data": {
"data_list": [
{
"code": "700.HK",
"kline_type": 1,
"kline_timestamp_end": 0,
"query_kline_num": 2,
"adjust_type": 0
},
{
"code": "AAPL.US",
"kline_type": 8,
"kline_timestamp_end": 0,
"query_kline_num": 2,
"adjust_type": 0
}
]
}
}
'import requests
url = "https://quote.alltick.co/quote-stock-b-api/batch-kline"
payload = {
"trace": "abc-123",
"data": { "data_list": [
{
"code": "700.HK",
"kline_type": 1,
"kline_timestamp_end": 0,
"query_kline_num": 2,
"adjust_type": 0
},
{
"code": "AAPL.US",
"kline_type": 8,
"kline_timestamp_end": 0,
"query_kline_num": 2,
"adjust_type": 0
}
] }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
trace: 'abc-123',
data: {
data_list: [
{
code: '700.HK',
kline_type: 1,
kline_timestamp_end: 0,
query_kline_num: 2,
adjust_type: 0
},
{
code: 'AAPL.US',
kline_type: 8,
kline_timestamp_end: 0,
query_kline_num: 2,
adjust_type: 0
}
]
}
})
};
fetch('https://quote.alltick.co/quote-stock-b-api/batch-kline', 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://quote.alltick.co/quote-stock-b-api/batch-kline",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'trace' => 'abc-123',
'data' => [
'data_list' => [
[
'code' => '700.HK',
'kline_type' => 1,
'kline_timestamp_end' => 0,
'query_kline_num' => 2,
'adjust_type' => 0
],
[
'code' => 'AAPL.US',
'kline_type' => 8,
'kline_timestamp_end' => 0,
'query_kline_num' => 2,
'adjust_type' => 0
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://quote.alltick.co/quote-stock-b-api/batch-kline"
payload := strings.NewReader("{\n \"trace\": \"abc-123\",\n \"data\": {\n \"data_list\": [\n {\n \"code\": \"700.HK\",\n \"kline_type\": 1,\n \"kline_timestamp_end\": 0,\n \"query_kline_num\": 2,\n \"adjust_type\": 0\n },\n {\n \"code\": \"AAPL.US\",\n \"kline_type\": 8,\n \"kline_timestamp_end\": 0,\n \"query_kline_num\": 2,\n \"adjust_type\": 0\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://quote.alltick.co/quote-stock-b-api/batch-kline")
.header("Content-Type", "application/json")
.body("{\n \"trace\": \"abc-123\",\n \"data\": {\n \"data_list\": [\n {\n \"code\": \"700.HK\",\n \"kline_type\": 1,\n \"kline_timestamp_end\": 0,\n \"query_kline_num\": 2,\n \"adjust_type\": 0\n },\n {\n \"code\": \"AAPL.US\",\n \"kline_type\": 8,\n \"kline_timestamp_end\": 0,\n \"query_kline_num\": 2,\n \"adjust_type\": 0\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://quote.alltick.co/quote-stock-b-api/batch-kline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"trace\": \"abc-123\",\n \"data\": {\n \"data_list\": [\n {\n \"code\": \"700.HK\",\n \"kline_type\": 1,\n \"kline_timestamp_end\": 0,\n \"query_kline_num\": 2,\n \"adjust_type\": 0\n },\n {\n \"code\": \"AAPL.US\",\n \"kline_type\": 8,\n \"kline_timestamp_end\": 0,\n \"query_kline_num\": 2,\n \"adjust_type\": 0\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"ret": 123,
"msg": "<string>",
"trace": "<string>",
"data": {
"kline_list": [
{
"code": "<string>",
"kline_type": 123,
"kline_data": [
{
"timestamp": "<string>",
"open_price": "<string>",
"close_price": "<string>",
"high_price": "<string>",
"low_price": "<string>",
"volume": "<string>",
"turnover": "<string>"
}
]
}
]
}
}
