Skip to main content
GET
/
v1
/
quant
/
quotes
/
kline
Get kline data
curl --request GET \
  --url https://api.reportify.cn/v1/quant/quotes/kline \
  --header 'Authorization: Bearer <token>'
{
  "datas": [
    {}
  ],
  "metadata": {}
}
获取单只股票的 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>"

请求参数

symbol
string
required
股票代码
kline_type
string
default:"1D"
K 线周期类型:
  • 1M - 1 分钟线
  • 5M - 5 分钟线
  • 15M - 15 分钟线
  • 30M - 30 分钟线
  • 60M - 60 分钟线
  • 1D - 日线(默认)
  • 1W - 周线
  • 1MO - 月线
market
string
default:"cn"
股票市场:cn(A股), hk(港股), us(美股)
stock_type
string
default:"stock"
股票类型:stock(股票), etf(ETF), index(指数), sw(申万指数)
start_datetime
string
开始时间,格式:YYYY-MM-DD HH:MM:SS(可选,不传时按 kline_type 自动推算)
end_datetime
string
结束时间,格式:YYYY-MM-DD HH:MM:SS(可选,默认当前时间)

默认时间范围

不传 start_datetime 时,根据 kline_type 自动向前推算:
kline_type默认范围
1M1 天
5M / 15M3 天
30M / 60M5 天
1D30 天
1W180 天
1MO365 天

响应参数

datas
array
K 线数据列表
metadata
object
查询元数据,包含 symbol, kline_type, start_datetime, end_datetime, count

响应示例

{
  "datas": [
    {
      "date": "2026-01-02",
      "symbol": "000001",
      "open": 12.15,
      "high": 12.30,
      "low": 12.10,
      "close": 12.25,
      "volume": 45678900
    },
    {
      "date": "2026-01-03",
      "symbol": "000001",
      "open": 12.25,
      "high": 12.45,
      "low": 12.20,
      "close": 12.40,
      "volume": 52345678
    }
  ],
  "metadata": {
    "symbol": "000001",
    "kline_type": "1D",
    "start_datetime": "2026-01-01 00:00:00",
    "end_datetime": "2026-01-31 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

Authorization
string
header
required

Enter your Bearer token

Query Parameters

symbol
string
required

Stock code (e.g., 600519, 00700, AAPL)

kline_type
enum<string>
default:1D

Kline period type

Available options:
1M,
5M,
15M,
30M,
60M,
1D,
1W,
1MO
market
enum<string>
default:cn

Stock market identifier

Available options:
cn,
hk,
us
stock_type
enum<string>
default:stock

Stock type identifier

Available options:
stock,
etf,
index,
sw
start_datetime
string<date-time> | null

Start datetime (YYYY-MM-DD HH:MM:SS)

end_datetime
string<date-time> | null

End datetime (YYYY-MM-DD HH:MM:SS)

Response

Successful Response

Kline data response.

datas
Datas · object[]
required

Kline data list

metadata
Metadata · object
required

Query metadata (symbol, kline_type, start_datetime, end_datetime, count)