Wanying API

指数/行业类实体

指数基本信息/指数日线/成分权重/行业分类/行业成分,共 5 个实体

注意:index_basicindex_daily 的指数代码列名为 ts_code,其余实体为 index_code。行业链路:index_classify → index_member → index_daily

index_basic — 指数基本信息

无主日期列(全量) · 支持 market

指数清单:名称、市场、发布方、类别、基日、基点。

当前 market 仅有 SSE / SZSE / CSI 三种取值,其他市场筛选会返回空结果。

GET /api/v1/entities/index_basic

参数

参数类型说明
marketstring市场筛选。

字段(8 个)

字段类型说明
ts_codestring指数代码
namestring指数名称
marketstring市场
publisherstring发布方
categorystring类别
base_datestring基日
base_pointfloat64基点
list_datestring上市日

数据样例

{
  "entity": "index_basic",
  "data_version": "2026-08-14T22:50:21+00:00",
  "columns": [{"name": "ts_code", "dtype": "string"}, {"name": "name", "dtype": "string"}, {"name": "market", "dtype": "string"}, {"name": "publisher", "dtype": "string"}, {"name": "category", "dtype": "string"}, {"name": "base_date", "dtype": "string"}, {"name": "base_point", "dtype": "float64"}, {"name": "list_date", "dtype": "string"}],
  "rows": [["000001.SH", "上证指数", "SSE", "中证指数有限公司、上海证券交易所", "综合指数", "19901219", 100.0, "19910715"]],
  "count": 1,
  "truncated": false,
  "next_cursor": null
}

Python 示例

import requests
r = requests.get(f"{BASE}/api/v1/entities/index_basic",
                 params={"limit": 10},
                 headers={"Authorization": f"Bearer {TOKEN}"})
d = r.json()
print(d["columns"], d["rows"][0])

index_daily — 指数日线

主日期列 trade_date

全市场指数日线(含行业指数),基准对比与行业指数行情。

GET /api/v1/entities/index_daily

参数

无特有参数,通用参数见总览·通用协议

字段(11 个)

字段类型说明
ts_codestring指数代码
trade_datestring交易日期 YYYYMMDD
closefloat64收盘点位
openfloat64开盘点位
highfloat64最高点位
lowfloat64最低点位
pre_closefloat64昨收点位
changefloat64涨跌点
pct_chgfloat64涨跌幅(%)
volfloat64成交量
amountfloat64成交额

数据样例

{
  "entity": "index_daily",
  "data_version": "2026-08-14T22:50:21+00:00",
  "columns": [{"name": "ts_code", "dtype": "string"}, {"name": "trade_date", "dtype": "string"}, {"name": "close", "dtype": "float64"}, {"name": "open", "dtype": "float64"}, {"name": "high", "dtype": "float64"}, {"name": "low", "dtype": "float64"}, {"name": "pre_close", "dtype": "float64"}, {"name": "change", "dtype": "float64"}, {"name": "pct_chg", "dtype": "float64"}, {"name": "vol", "dtype": "float64"}, {"name": "amount", "dtype": "float64"}],
  "rows": [["000001.SH", "20090105", 1880.716, 1849.02, 1880.716, 1844.094, 1820.805, 59.911, 3.2904, 67136715.0, 46100959.083]],
  "count": 1,
  "truncated": false,
  "next_cursor": null
}

Python 示例

import requests
r = requests.get(f"{BASE}/api/v1/entities/index_daily",
                 params={"limit": 10},
                 headers={"Authorization": f"Bearer {TOKEN}"})
d = r.json()
print(d["columns"], d["rows"][0])

index_weight — 成分权重快照

主日期列 trade_date

宽基成分权重(宽基每日/行业周五更新)。

GET /api/v1/entities/index_weight

参数

无特有参数,通用参数见总览·通用协议

字段(4 个)

字段类型说明
index_codestring指数代码
con_codestring成分股代码
trade_datestring交易日期
weightfloat64权重

数据样例

{
  "entity": "index_weight",
  "data_version": "2026-08-14T22:50:21+00:00",
  "columns": [{"name": "index_code", "dtype": "string"}, {"name": "con_code", "dtype": "string"}, {"name": "trade_date", "dtype": "string"}, {"name": "weight", "dtype": "float64"}],
  "rows": [["000016.SH", "600000.SH", "20090430", 5.02]],
  "count": 1,
  "truncated": false,
  "next_cursor": null
}

Python 示例

import requests
r = requests.get(f"{BASE}/api/v1/entities/index_weight",
                 params={"limit": 10},
                 headers={"Authorization": f"Bearer {TOKEN}"})
d = r.json()
print(d["columns"], d["rows"][0])

index_classify — 行业分类

无主日期列(全量) · 支持 level

申万 L1/L2/L3 行业分类体系。

GET /api/v1/entities/index_classify

参数

参数类型说明
levelstring行业级别(L1/L2/L3)。

字段(7 个)

字段类型说明
index_codestring行业代码
industry_namestring行业名称
levelstring级别(L1/L2/L3)
industry_codestring行业代码
is_pubstring是否发布
parent_codestring父级代码
srcstring来源

数据样例

{
  "entity": "index_classify",
  "data_version": "2026-08-14T22:50:21+00:00",
  "columns": [{"name": "index_code", "dtype": "string"}, {"name": "industry_name", "dtype": "string"}, {"name": "level", "dtype": "string"}, {"name": "industry_code", "dtype": "string"}, {"name": "is_pub", "dtype": "string"}, {"name": "parent_code", "dtype": "string"}, {"name": "src", "dtype": "string"}],
  "rows": [["801010.SI", "农林牧渔", "L1", "110000", "1", "0", "SW2021"]],
  "count": 1,
  "truncated": false,
  "next_cursor": null
}

Python 示例

import requests
r = requests.get(f"{BASE}/api/v1/entities/index_classify",
                 params={"limit": 10},
                 headers={"Authorization": f"Bearer {TOKEN}"})
d = r.json()
print(d["columns"], d["rows"][0])

index_member — 行业成分进出场

主日期列 in_date · 支持 as_of

成分股进出场记录,行业中性化/持仓行业暴露基础。

GET /api/v1/entities/index_member

参数

参数类型说明
as_ofYYYYMMDDpoint-in-time 锚点:只返回 公告日 <= as_of 的行,防未来函数(强烈建议显式传)。

字段(5 个)

字段类型说明
index_codestring行业指数代码
con_codestring成分股代码
in_datestring纳入日期
out_datestring剔除日期(空表示仍为成分)
is_newstring是否新纳入

数据样例

{
  "entity": "index_member",
  "data_version": "2026-08-14T22:50:21+00:00",
  "columns": [{"name": "index_code", "dtype": "string"}, {"name": "con_code", "dtype": "string"}, {"name": "in_date", "dtype": "string"}, {"name": "out_date", "dtype": "string"}, {"name": "is_new", "dtype": "string"}],
  "rows": [["801010.SI", "000019.SZ", "20211213", null, "Y"]],
  "count": 1,
  "truncated": false,
  "next_cursor": null
}

Python 示例

import requests
r = requests.get(f"{BASE}/api/v1/entities/index_member",
                 params={"limit": 10},
                 headers={"Authorization": f"Bearer {TOKEN}"})
d = r.json()
print(d["columns"], d["rows"][0])