接口详情
个股日K线
- 接口 ID
- getklineday-w14-stocklinedata
- 分组
- 行情K线
- 调用地址
- /v1/endpoints/getklineday-w14-stocklinedata/call
可传参数
| 参数 | 名称 | 说明 | 必填 | 类型 | 示例值 |
|---|---|---|---|---|---|
| page_offset | 分页起点 | 分页偏移量。第一页通常为 0,后续页按接口的分页步长递增。 | 否 | string | 0 |
| include_intraday | 包含分时 | 是否包含分时相关数据,默认使用示例值。 | 否 | string | 1 |
| stock_code | 证券代码 | 股票、指数或板块代码。股票通常为 6 位代码,指数/板块按接口说明传入。 | 是 | string | 302132 |
| period | K线周期 | K线周期。默认 d 表示日 K。 | 否 | string | d |
在线测试
在线测试需要登录,会使用控制台中的默认 API Key 并计入用量。
响应结构
基于最近一次接口体检样本自动生成,仅展示主要字段。
| 字段路径 | 类型 | 样例值 |
|---|---|---|
| StockID | string | 302132 |
| Time | integer | 1780203007 |
| errcode | string | 0 |
| firstPre | integer | 0 |
| name | string | |
| ttag | number | 0.002923000000000009 |
调用示例
curl -X POST http://127.0.0.1:8080/v1/endpoints/getklineday-w14-stocklinedata/call \
-H "X-API-Key: <api_key>" \
-H "Content-Type: application/json" \
-d '{"params":{"include_intraday":"1","page_offset":"0","period":"d","stock_code":"302132"}}'import requests
resp = requests.post(
"http://127.0.0.1:8080/v1/endpoints/getklineday-w14-stocklinedata/call",
headers={"X-API-Key": "<api_key>"},
json={"params": {"include_intraday":"1","page_offset":"0","period":"d","stock_code":"302132"}},
)
print(resp.status_code)
print(resp.text)package main
import (
"bytes"
"fmt"
"net/http"
)
func main() {
body := []byte(`{"params":{"include_intraday":"1","page_offset":"0","period":"d","stock_code":"302132"}}`)
req, _ := http.NewRequest("POST", "http://127.0.0.1:8080/v1/endpoints/getklineday-w14-stocklinedata/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)
}