接口详情
个股历史分时走势
- 接口 ID
- getstocktrend-stockl2history
- 分组
- 行情K线
- 调用地址
- /v1/endpoints/getstocktrend-stockl2history/call
可传参数
| 参数 | 名称 | 说明 | 必填 | 类型 | 示例值 |
|---|---|---|---|---|---|
| trade_date | 交易日期 | 交易日期,格式通常为 YYYY-MM-DD 或 YYYYMMDD,按接口说明传入。 | 否 | string | 20250708 |
| stock_code | 证券代码 | 股票、指数或板块代码。股票通常为 6 位代码,指数/板块按接口说明传入。 | 是 | string | 300322 |
在线测试
在线测试需要登录,会使用控制台中的默认 API Key 并计入用量。
响应结构
基于最近一次接口体检样本自动生成,仅展示主要字段。
| 字段路径 | 类型 | 样例值 |
|---|---|---|
| begin_px | integer | 15 |
| code | string | 300322 |
| day | string | 20250708 |
| errcode | string | 0 |
| hprice | number | 15.46 |
| lprice | number | 14.9 |
| preclose_px | number | 14.94 |
| px_change_rate | number | 3.28 |
| time | integer | 1751960391 |
| total_turnover | integer | 556110897 |
| ttag | number | 0.0006749999999999812 |
调用示例
curl -X POST http://127.0.0.1:8080/v1/endpoints/getstocktrend-stockl2history/call \
-H "X-API-Key: <api_key>" \
-H "Content-Type: application/json" \
-d '{"params":{"stock_code":"300322","trade_date":"20250708"}}'import requests
resp = requests.post(
"http://127.0.0.1:8080/v1/endpoints/getstocktrend-stockl2history/call",
headers={"X-API-Key": "<api_key>"},
json={"params": {"stock_code":"300322","trade_date":"20250708"}},
)
print(resp.status_code)
print(resp.text)package main
import (
"bytes"
"fmt"
"net/http"
)
func main() {
body := []byte(`{"params":{"stock_code":"300322","trade_date":"20250708"}}`)
req, _ := http.NewRequest("POST", "http://127.0.0.1:8080/v1/endpoints/getstocktrend-stockl2history/call", bytes.NewReader(body))
req.Header.Set("X-API-Key", "<api_key>")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
fmt.Println(resp.StatusCode, err)
}