Get kline data
curl --request GET \
--url https://api.reportify.cn/v1/quant/quotes/kline \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.reportify.cn/v1/quant/quotes/kline"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.reportify.cn/v1/quant/quotes/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://api.reportify.cn/v1/quant/quotes/kline",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.reportify.cn/v1/quant/quotes/kline"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.reportify.cn/v1/quant/quotes/kline")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reportify.cn/v1/quant/quotes/kline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"datas": [
{}
],
"metadata": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}行情数据
K 线数据
获取单只股票的 K 线数据,支持分钟线、日线、周线、月线
GET
/
v1
/
quant
/
quotes
/
kline
Get kline data
curl --request GET \
--url https://api.reportify.cn/v1/quant/quotes/kline \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.reportify.cn/v1/quant/quotes/kline"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.reportify.cn/v1/quant/quotes/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://api.reportify.cn/v1/quant/quotes/kline",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.reportify.cn/v1/quant/quotes/kline"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.reportify.cn/v1/quant/quotes/kline")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reportify.cn/v1/quant/quotes/kline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"datas": [
{}
],
"metadata": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}获取单只股票的 K 线数据,通过
kline_type 参数支持多种周期:1分钟、5分钟、15分钟、30分钟、60分钟、日线、周线、月线。
curl "https://api.reportify.cn/v1/quant/quotes/kline?symbol=000001&kline_type=1D&market=cn" \
-H "Authorization: Bearer <token>"
import requests
response = requests.get(
"https://api.reportify.cn/v1/quant/quotes/kline",
headers={"Authorization": "Bearer <token>"},
params={
"symbol": "000001",
"kline_type": "1D",
"market": "cn",
"start_datetime": "2026-01-01 00:00:00",
"end_datetime": "2026-01-31 00:00:00"
}
)
print(response.json())
const response = await fetch('https://api.reportify.cn/v1/quant/quotes/kline?symbol=000001&kline_type=1D&market=cn', {
method: 'GET',
headers: {
'Authorization': 'Bearer <token>'
}
});
const data = await response.json();
请求参数
string
required
股票代码
string
default:"1D"
K 线周期类型:
1M- 1 分钟线5M- 5 分钟线15M- 15 分钟线30M- 30 分钟线60M- 60 分钟线1D- 日线(默认)1W- 周线1MO- 月线
string
default:"cn"
股票市场:
cn(A股), hk(港股), us(美股)string
default:"stock"
股票类型:
stock(股票), etf(ETF), index(指数), sw(申万指数)string
开始时间,格式:
YYYY-MM-DD HH:MM:SS(可选,不传时按 kline_type 自动推算)string
结束时间,格式:
YYYY-MM-DD HH:MM:SS(可选,默认当前时间)默认时间范围
不传start_datetime 时,根据 kline_type 自动向前推算:
| kline_type | 默认范围 |
|---|---|
1M | 1 天 |
5M / 15M | 3 天 |
30M / 60M | 5 天 |
1D | 30 天 |
1W | 180 天 |
1MO | 365 天 |
响应参数
array
object
查询元数据,包含
symbol, kline_type, start_datetime, end_datetime, count响应示例
{
"datas": [
{
"market": "cn",
"date": "2026-04-01",
"symbol": "000001",
"open": 10.98,
"high": 11.02,
"low": 10.93,
"close": 11.0,
"volume": 17744106,
"amount": 194464864.8,
"chg_percent": 0.1821,
"turnover_rate": 0.0004
},
{
"market": "cn",
"date": "2026-04-02",
"symbol": "000001",
"open": 11.0,
"high": 11.15,
"low": 10.96,
"close": 11.08,
"volume": 21356890,
"amount": 236512345.6,
"chg_percent": 0.7273,
"turnover_rate": 0.0005
}
],
"metadata": {
"symbol": "000001",
"kline_type": "1D",
"start_datetime": "2026-04-01 00:00:00",
"end_datetime": "2026-04-30 00:00:00",
"count": 2
}
}
使用示例
获取日线数据(默认)
import requests
response = requests.get(
"https://api.reportify.cn/v1/quant/quotes/kline",
headers={"Authorization": "Bearer <token>"},
params={
"symbol": "000001",
"kline_type": "1D",
"start_datetime": "2026-01-01 00:00:00",
"end_datetime": "2026-03-31 00:00:00"
}
)
data = response.json()
for row in data["datas"]:
print(f"{row['date']}: 收{row['close']} 量{row['volume']}")
获取 5 分钟 K 线
response = requests.get(
"https://api.reportify.cn/v1/quant/quotes/kline",
headers={"Authorization": "Bearer <token>"},
params={
"symbol": "000001",
"kline_type": "5M",
"start_datetime": "2026-04-09 09:30:00",
"end_datetime": "2026-04-09 15:00:00"
}
)
获取周线数据
response = requests.get(
"https://api.reportify.cn/v1/quant/quotes/kline",
headers={"Authorization": "Bearer <token>"},
params={
"symbol": "600519",
"kline_type": "1W",
"market": "cn"
}
)
获取 ETF 数据
response = requests.get(
"https://api.reportify.cn/v1/quant/quotes/kline",
headers={"Authorization": "Bearer <token>"},
params={
"symbol": "510300",
"kline_type": "1D",
"stock_type": "etf"
}
)
Authorizations
Enter your Bearer token
Query Parameters
Stock code (e.g., 600519, 00700, AAPL)
Kline period type
Available options:
1M, 5M, 15M, 30M, 60M, 1D, 1W, 1MO Stock market identifier
Available options:
cn, hk, us, global Stock type identifier
Available options:
stock, etf, index, sw Start datetime (YYYY-MM-DD HH:MM:SS)
End datetime (YYYY-MM-DD HH:MM:SS)
