![](https://i-blog.csdnimg.cn/blog_migrate/c804ab2d5ae2e4944ab09cd1b95b18f2.jpeg)
# 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示例
# 更多详情
https://tsanghi.com