跳转至

← 返回接口目录

F10-股票基础信息

作用

查询股票 F10 页面初始化信息,也可取主营构成报告期、题材 ID 等辅助数据。

项目 内容
股票信息 client.f10.stock_info(code)
主营报告期 client.f10.business_periods(code)
题材 ID client.f10.topic_ids(code)
底层 Entry CWServ.tdxf10_gg_comreq
返回模型 F10Response

示例

from eltdx import F10Client

f10 = F10Client(timeout=3)
info = f10.stock_info("000034")
periods = f10.business_periods("000034")
topics = f10.topic_ids("000034")

print(info.rows[:3])
print(periods.rows[:3])
print(topics.rows[:3])

拿个股全部题材

topic_ids() 适合先拿“这个股票属于哪些题材”。它返回的是题材 ID 和题材名称,通常比 hot_topics() 更完整;如果还要关联度、入选原因,再用 F10-热点题材.md 补详情。

from eltdx import F10Client

f10 = F10Client(timeout=3)
response = f10.topic_ids("000034")

topics = [
    {
        "topic_id": row["t001"],
        "topic_name": row["t002"],
    }
    for row in response.rows
]

print(len(topics))
print(topics[:5])

一次真实请求里,000034 返回过 43 个题材,结构类似:

[
    {"topic_id": "2945", "topic_name": "存储芯片"},
    {"topic_id": "3001", "topic_name": "AI手机PC"},
    {"topic_id": "2317", "topic_name": "云计算"},
]

参数

参数 含义
code 六位代码或带市场前缀代码,如 000034 / sz000034

请求对照

方法 Entry 请求体
stock_info("000034") CWServ.tdxf10_gg_comreq {"Params": ["gpquery", "000034"]}
business_periods("000034") CWServ.tdxf10_gg_comreq {"Params": ["zygcfx", "000034"]}
topic_ids("000034") CWServ.tdxf10_gg_comreq {"Params": ["rdtcgn", "000034"]}

返回示例

info.rows[0]
# {"T003": "神州数码", "T002": "000034", "sc": 0}

periods.rows[0]
# {"T002": 20251231}

topics.rows[0]
# {"t001": "2945", "t002": "存储芯片"}

字段对照

stock_info() 常用字段:

原生字段 中文含义
T003 证券简称
T002 六位证券代码
sc 市场代码,通常 0 深市、1 沪市、2 北交所

business_periods() 常用字段:

原生字段 中文含义
T002 主营构成报告期

topic_ids() 常用字段:

原生字段 中文含义
t001 题材 ID,查询题材内个股排序时要用
t002 题材名称

business_composition() 不传报告期时,会先调用 business_periods() 取最新报告期。topic_compare_first() 会先调用 topic_ids() 取第一个题材 ID。