A股指数成分股API接口

172 阅读1分钟

ced3d30573309f0a7fed9b7e72337cc1.jpg

# Restful API
https://tsanghi.com/api/fin/index/CHN/constituent?token={token}&ticker={ticker}

更新时间:收盘后3~4小时。

更新周期:每天。

请求方式:GET。

# 测试:返回不超过10条数据(2年历史)
https://tsanghi.com/api/fin/index/CHN/constituent?token=demo&ticker=000001

Request请求参数

参数名称参数类型参数选项参数说明
token字符串必选API Token。登录后获取。
ticker字符串必选指数代码。例如:000001(上证指数)。
fmt字符串可选输出格式。支持json和csv两种标准输出格式,默认:json。
columns字符串可选输出字段。支持自定义输出,多个字段以半角逗号分隔,默认:所有字段。

Response响应参数

参数名称参数类型参数说明
ticker字符串指数代码
constituent字符串成分股

Python示例

import requests

url = f"https://tsanghi.com/api/fin/index/CHN/constituent?token=demo&ticker=000001"
data = requests.get(url).json()
print(data)

Response示例

image.png

# 更多详情
https://tsanghi.com