接口详情
个股实时分时走势
- 接口 ID
- getstocktrendincremental-stockl2data
- 分组
- 行情K线
- 调用地址
- /v1/endpoints/getstocktrendincremental-stockl2data/call
可传参数
| 参数 | 名称 | 说明 | 必填 | 类型 | 示例值 |
|---|---|---|---|---|---|
| stock_code | 证券代码 | 股票、指数或板块代码。股票通常为 6 位代码,指数/板块按接口说明传入。 | 是 | string | 002278 |
| type | 类型 | 接口业务类型或分类值。不同接口含义不同,默认使用示例值。 | 否 | string | 1 |
在线测试
在线测试需要登录,会使用控制台中的默认 API Key 并计入用量。
响应结构
基于最近一次接口体检样本自动生成,仅展示主要字段。
| 字段路径 | 类型 | 样例值 |
|---|---|---|
| Name | string | 002278 |
| begin_px | number | 9.18 |
| code | string | 002278 |
| day | string | 20260529 |
| errcode | string | 0 |
| hprice | number | 9.24 |
| lprice | number | 8.82 |
| preclose_px | number | 9.17 |
| px_change_rate | number | -3.16 |
| time | string | 1780040765 |
| time2 | integer | 1780203007 |
| total_turnover | integer | 94749845 |
| ttag | number | 0.004348999999999936 |
调用示例
curl -X POST http://127.0.0.1:8080/v1/endpoints/getstocktrendincremental-stockl2data/call \
-H "X-API-Key: <api_key>" \
-H "Content-Type: application/json" \
-d '{"params":{"stock_code":"002278","type":"1"}}'import requests
resp = requests.post(
"http://127.0.0.1:8080/v1/endpoints/getstocktrendincremental-stockl2data/call",
headers={"X-API-Key": "<api_key>"},
json={"params": {"stock_code":"002278","type":"1"}},
)
print(resp.status_code)
print(resp.text)package main
import (
"bytes"
"fmt"
"net/http"
)
func main() {
body := []byte(`{"params":{"stock_code":"002278","type":"1"}}`)
req, _ := http.NewRequest("POST", "http://127.0.0.1:8080/v1/endpoints/getstocktrendincremental-stockl2data/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)
}