Skip to content

"Vibe-Trading: Your Personal Trading Agent"

2.7 KB
Raw Blame

券商研报 + 一致预期 EPS(Research Reports)

工具:get_research_reports(src.tools.research_reports_tool.ResearchReportsTool) 描述:两路免费免鉴权披露拼成一个信封:

  • 东财 reportapi —— A 股滚动券商研报列表:标题、发布机构、分析师、发布日、机构评级标签、该机构的分年度 EPS / PE 预测。主源,驱动 reports 块。
  • 同花顺(THS, basic.10jqka.com.cn) —— 市场一致预期 EPS(分析师估计均值),按前瞻财年。THS 拒绝裸 requests UA,故调用带桌面 UA + Referer,走独立 ths host bucket 节流。该块为 best-effort:THS 失败时 consensus_eps 降级为空列表,不中断研报抓取。 市场:仅 A 股(.SH / .SZ / .BJ)。 限速:东财经 eastmoney bucket、THS 经 ths bucket,均 per-host 节流。

端点

块 端点 URL
reports(东财) https://reportapi.eastmoney.com/report/list
consensus_eps(THS) https://basic.10jqka.com.cn/api/stock/profit_forecast/

输入参数(工具入参)

名称 类型 必选 描述
code str Y <code>.<exchange>,后缀 SH / SZ / BJ(如 600519.SH)。
limit int N 返回最近研报数上限(1–50,默认 20)。

端点查询参数

reportapi:code=<裸代码>、qType=0(个股研报)、pageSize=<limit>、pageNo=1。 THS:code=<裸代码>;headers 带 User-Agent(桌面 UA)+ Referer: https://basic.10jqka.com.cn/。


返回字段

reports(源字段 → 输出键):

源字段 输出键 描述
title title 研报标题
orgSName / orgName brokerage 发布机构(简称优先)
researcher analyst 分析师
publishDate publish_date 发布日(取 YYYY-MM-DD)
emRatingName / sRatingName rating 机构评级
predictThisYearEps / predictNextYearEps eps_forecast.this_year / .next_year 分年度 EPS 预测
predictThisYearPe / predictNextYearPe pe_forecast.this_year / .next_year 分年度 PE 预测

consensus_eps(THS,字段名多变,按 alias 探测):

输出键 来源 alias 描述
fiscal_year year / fiscal_year / report_year 前瞻财年
consensus_eps eps / avg_eps / predict_eps / forecast_eps 一致预期 EPS(均值)

无 title 且无 publish_date 的研报行被丢弃。信封:{"ok": true, "market": "CN", "source": "eastmoney+ths", "data": {"code","reports":[...],"consensus_eps":[...]}}。


调用范例

from src.tools.research_reports_tool import ResearchReportsTool

print(ResearchReportsTool().execute(code="600519.SH", limit=10))