a-stock-data is a free, open source ai development platforms project written in Python and released under Apache-2.0. It has 9,928 GitHub stars, 1,814 forks and 5 open issues, and was last pushed 30 hours ago. On this registry it ranks #59 of 116 tracked projects in AI Development Platforms, with 5 head-to-head comparisons available.

What is a-stock-data?

a-stock-data is a self-contained AI Skill file, published under Apache-2.0, that consolidates raw China A-share market data from 22 sources into 60 endpoints an AI coding assistant can call directly, and it is aimed at quantitative researchers, investment analysts and developers who want A-share data inside an LLM workflow without writing their own scraping and authentication code.

What it is

The project is a single skill file that combines structured Markdown with embedded Python. It lives in the ecosystem of AI coding assistants rather than in the ecosystem of Python data libraries: the README states that it is compatible with Claude Code, Codex and OpenClaw, and that any assistant supporting context injection can use it. The file organises its coverage as a twelve-layer architecture at version V3.8.0, spanning quotes, research reports, signals, fund flows and chip distribution, news, fundamentals, announcements, limit-up boards, options, investor sentiment, macro data and index calendars, and it counts 60 endpoints made up of 55 main entries plus 5 fallbacks.

It solves a concrete integration problem. The README frames the work it removes as memorising mootdx K-line parameters, the Eastmoney PDF Referer header, and iwencai X-Claw authentication. Rather than stitching sources together per project, the skill exposes them behind named endpoints, prioritises sources that do not block by IP such as mootdx and Tencent, restricts Eastmoney to data only it provides with built-in rate limiting, and ships a fallback source quick-reference and degradation strategy for when a primary source is blocked.

Key capabilities

  • Twelve-layer quote and fundamentals coverage combining mootdx, Tencent, Baidu K-line, Sina K-line with MA5/MA10/MA20, order book, PE/PB, market capitalisation, indices, ETFs and qfq/hfq adjustment factors.
  • 60 endpoints documented in the README, with an explicit counting convention: 55 main entries plus 5 fallbacks, where the Eastmoney industry report and individual report share one endpoint distinguished by the qType parameter.
  • Fund-flow and chip data, including 120-day daily net inflow by order size and locally computed CYQ chip distribution returning profit ratio, average cost, the 90-70 cost range and chip peaks.
  • A board-trading layer built on Eastmoney push2ex and 同花顺, covering the limit-up pool, failed limit-ups, limit-downs, prior-day limit-ups, reasons for limit-ups, and the consecutive-board ladder.
  • Announcement coverage across all Shanghai, Shenzhen and Beijing exchange filings through cninfo, alongside a news layer combining Eastmoney, Cailianshe telegraph and 7×24 global news.
  • A macro layer drawing on the People's Bank of China and the National Bureau of Statistics for monthly social financing increments across twelve columns and PMI series for manufacturing, non-manufacturing, composite and firms by size.
  • An options layer that returns Sina ETF option T-quote data with greeks and implied volatility, plus an index calendar with constituents, weights, PE and dividend yield and the official trading calendar.

Who uses it and how

  • Claude Code users install the file to ~/.claude/skills/a-stock-data and activate it by asking a natural-language question, such as requesting a valuation check on ticker 688017.
  • Codex and OpenClaw users paste the contents of SKILL.md into a system prompt or a project context file, where the embedded Python can be executed directly.
  • Quantitative finance and investment research teams use it to pull research report lists, EPS forecasts and PDF downloads from Eastmoney, 同花顺 and iwencai without implementing per-source authentication.
  • Analysts working with volatile upstream sources rely on the fallback quick-reference, which covers substitutes for the dragon-tiger list, fund flows and announcements, plus official margin trading data and Beijing Stock Exchange quotes and order book fallbacks.

Getting started

The README gives a three-step, two-minute install: create ~/.claude/skills/a-stock-data, download SKILL.md from the repository's raw URL into it, then run pip install mootdx requests pandas stockstats numpy baostock xlrd openpyxl. Since V3.0 the akshare dependency is no longer required.

How it compares

Among the libraries named in the facts, akshare was a former dependency that V3.0 dropped, while mootdx, baostock and stockstats remain pip dependencies that expose raw data access. This project sits above them as a packaging layer, wrapping 22 sources behind 60 endpoints and removing the need to recall per-source parameters.

When to use it — and when not to

A self-hoster installs only a skill file and a set of Python packages, with no database, storage or mail service to operate, and the zero-authentication design means no keys to manage. Limits are documented rather than hidden: the valuation history endpoint does not support the Beijing Stock Exchange, Shenzhen Connect northbound disclosure has been tightened so that stream is reference-only with HKEX as the authoritative fallback, and every layer depends on third-party upstream sources that can throttle or change. Anyone who needs a vendor with a contractual service level, licensed redistribution rights or Beijing Stock Exchange valuation history should look elsewhere.

project readme (upstream, from github) — read inline

简体中文 | English

a-stock-data

A 股全栈数据工具包 — 12 层架构 · 60 个端点 · 22 个数据源 · 零鉴权

License Python Stars
Layers Endpoints Sources Zero Auth

架构 · 快速开始 · 端点清单 · 使用示例 · FAQ · 更新日志

一个自包含的 Skill 文件,把分散在 22 个数据源里的 A 股原始数据整合成 AI 编程助手直接能用的工具集。你不用再背 mootdx 的 K 线参数、东财的 PDF Referer 头、iwencai 的 X-Claw 鉴权——全部封装好了。主源被封还有「备用源速查」可降级。

兼容 Claude Code · Codex · OpenClaw

Skill 文件本质是结构化 Markdown + 内嵌 Python,任何支持上下文注入的 AI 编程助手都能用。


架构

A 股全栈数据 · 十二层架构 · V3.8.0
│  (优先级:mootdx/腾讯 不封IP 优先用;东财仅用于独有数据,已内置限流防封)
├── 行情层    mootdx + 腾讯 + 百度K线 + 新浪  K线(带MA5/10/20) + 五档盘口 + PE/PB/市值 + 指数/ETF
│                                           + 复权因子 qfq/hfq  ★V3.7
├── 研报层    东财 reportapi + 同花顺 + iwencai  个股研报 / 行业研报 / PDF下载 / 一致预期 / NL搜索
├── 信号层    同花顺 + 东财                  强势股 + 题材归因 + 北向资金 + 板块归属
│                                           + 资金流向(push2) + 龙虎榜 + 全市场龙虎榜 + 解禁 + 行业对比 + 板块资金流
├── 资金面    东财 datacenter + push2        融资融券 + 大宗交易 + 股东户数 + 分红送转 + 资金流(分钟+120日)
│   /筹码     本地计算                       筹码分布 CYQ:获利比例 / 平均成本 / 成本区间 / 筹码峰  ★V3.7
├── 新闻层    东财 + 财联社                  个股新闻 / 财联社电报(✅V3.4复活) / 全球资讯(互备)
├── 基础数据  mootdx + 东财 + 新浪           季报37字段 / F10九大类 / 财报三表
│           + baostock + 申万                估值历史(PE/PB/PS+换手率+停牌+ST) / 上市退市日 / 申万行业变迁史  ★V3.7
├── 公告层    巨潮 cninfo + mootdx           沪深北全量公告
├── 打板层    东财 push2ex + 同花顺          涨停池 / 炸板 / 跌停 / 昨涨停 / 涨停原因题材 / 连板梯队
│                                           + 重点监控池 + 日内异动池  ★V3.6
├── 期权层    新浪 hq.sinajs                ETF期权 T型报价 / 希腊字母 / 隐含波动率 IV  ★V3.3
├── 舆情互动  巨潮互动易 + 同花顺 + 东财     互动易问答 / 同花顺热榜 / 东财人气榜 / 概念命中  ★V3.3
├── 宏观层    人民银行 + 国家统计局          社会融资规模增量(月度12列) / PMI(制造业·非制造业·综合·大中小型)
└── 指数日历  中证指数 + 国证指数 + 深交所    指数成分 / 权重 / PE与股息率 / 官方交易日历

十二层之外另附备用源速查 & 降级策略:龙虎榜/资金流/公告备胎,以及沪深官方两融、北交所当前行情与五档备胎。使用范围和真实数据日期见 SKILL.md 对应章节。


快速开始

3 步,2 分钟。

# 1. 创建 skill 目录
mkdir -p ~/.claude/skills/a-stock-data

# 2. 把 SKILL.md 放进去
curl -o ~/.claude/skills/a-stock-data/SKILL.md \
  https://raw.githubusercontent.com/simonlin1212/a-stock-data/main/SKILL.md

# 3. 安装依赖(V3.0 不再需要 akshare)
pip install mootdx requests pandas stockstats numpy baostock xlrd openpyxl

启动 Claude Code,说一句「帮我看看 688017 的估值」,自动激活。

Codex / OpenClaw 用户: 把 SKILL.md 的内容贴入你的系统 prompt 或项目上下文文件即可,内嵌的 Python 代码可直接执行。


60 个端点能力清单

共 55 个主入口、5 个备胎。沿用能力入口计数:同一函数的中证/国证或沪深路由不重复计数,辅助函数与仅列入候选的项目不计入。

计数口径: 下方清单共 61 行,按能力入口计 60 个——「东财 行业研报」与「东财 reportapi」为同一端点(仅 qType 参数不同)、「同花顺北向(历史)」为本地自缓存(非独立端点),两行不计入;「东财日内异动池」一行含 list / count 两个端点,多计 1 个。61 − 1 − 1 + 1 = 60。

行情层(实时,不封 IP)

端点 数据
mootdx 行情 K线(多周期) + 五档盘口 + 逐笔成交 + 实时报价 46 字段
腾讯财经 PE(TTM) / PB / 总市值 / 流通市值 / 换手率 / 涨跌停价 / 指数 / ETF
百度K线 日K线 + MA5/MA10/MA20 均价直接返回(V3.0 新增)
新浪复权因子 qfq / hfq 因子序列 + 套用到不复权 K 线(V3.7 新增)

研报层

端点 数据
东财 reportapi 个股研报列表 + 评级 + 三年 EPS 预测
东财 行业研报 行业研报列表(qType=1,同端点)+ 行业名/行业码 + 评级(V3.2.3 新增)
东财 PDF 下载 完整研报 PDF(个股/行业通用,已处理 Referer 鉴权)
同花顺一致预期 机构一致预期 EPS(直连 basic.10jqka.com.cn)
iwencai NL 搜索 自然语言跨主题研报检索

信号层

端点 数据
同花顺热点 当日强势股 + 题材归因 reason tags(编辑部人工标注)
同花顺北向(实时) 沪股通分钟级流向(深股通近期上游披露收紧仅供参考,权威北向见 HKEX 备胎)
同花顺北向(历史) 本地自缓存日级历史
东财板块归属 个股所属全部板块(行业/概念/地域混合)+ BK码 + 当日涨跌幅 + 龙头股(V3.2.2 替换百度 PAE,一次请求拿全)
东财资金流向 主力 / 大单 / 中单 / 小单 / 超大单分钟级净流入(V3.1 替换百度 PAE)
龙虎榜席位 上榜记录 + 买卖席位 TOP5 + 机构动向
全市场龙虎榜 每日全市场上榜股票 + 净买额排名 + 上榜原因
限售解禁日历 历史解禁 + 未来 90 天待解禁预警
行业板块排名 东财行业涨跌/上涨下跌家数(V3.0 替换同花顺,零鉴权)
板块资金流向 行业/概念/地域 × 今日/5日/10日 主力净流入额/净占比 + 超大/大/中/小单四档 + 领涨股(V3.5 新增,与行业排名同源)

资金面 / 筹码层(V3.0 新增)

端点 数据
融资融券明细 日级融资余额/买入/偿还 + 融券余额/卖出/偿还
大宗交易 成交价/量 + 买卖方营业部 + 溢价率
股东户数变化 季度股东数 + 环比变化 + 户均持股(筹码集中度)
分红送转历史 每股派息/送股/转增 + 进度状态
个股资金流120日 主力/大单/中单/小单日级净流入
筹码分布 CYQ 获利比例 / 平均成本 / 90-70 成本区间与集中度 / 筹码峰(本地计算,V3.7 新增)

新闻层

端点 数据
个股新闻 东财个股新闻流(直连 search-api-web)
财联社电报 全市场实时快讯(v1 API + 本地签名零 key,✅V3.4.0 复活,与全球资讯互备)
全球资讯 东财全球财经资讯(直连 np-weblist,7×24)

基础数据 + 公告

端点 数据
季报快照 37 字段(EPS / ROE / 净利润 / 主营收入...)
F10 公司资料 9 大类文本(截断优化,-70% token)
东财个股信息 行业/总股本/流通股/市值/上市日期(直连 push2)
新浪财报三表 资产负债表/利润表/现金流量表(直连 quotes.sina.cn)
巨潮公告 沪深北交所全量公告
估值历史 日频 PE/PB/PS/PCF + 换手率 + 停牌 + ST(可回溯至 2016;不支持北交所,V3.7 新增)
上市/退市日 ipoDate / outDate / 状态(唯一零鉴权退市日源,V3.7 新增)
申万行业变迁史 每只股票历次行业调整(消除前视偏差;仅代码无中文名,V3.7 新增)

打板层(V3.3 新增)

端点 数据
东财涨停池 连板数 / 几天几板 / 封板资金 / 炸板次数 / 首末封板时间 / 所属行业
东财炸板池 曾涨停后开板 + 振幅 / 涨速
东财跌停池 封单资金 / 连续跌停天数 / 开板次数 / 板上成交额
东财昨日涨停池 昨涨停今表现(自算晋级率 / 赚钱效应)
同花顺涨停揭秘 涨停原因题材 / 封板成功率 / 一字·换手·T字板 / 封单额
东财重点监控池 交易所风险警示 / 重点监控名单 + 生效时间窗(V3.6 新增)
东财日内异动池 严重异常波动明细 + 按标的聚合异动统计 + 12 条异动规则解释(V3.6 新增)

ETF 期权层(V3.3 新增)

端点 数据
期权合约清单 50ETF / 300ETF / 科创50ETF / 500ETF 各月份认购认沽合约
T型报价 买卖五档 / 持仓量 / 行权价 / 最新价 / 成交量额
希腊字母 + IV Delta / Gamma / Theta / Vega / 隐含波动率 / 理论价值(交易所预算,免本地算 BSM)

舆情互动层(V3.3 新增)

端点 数据
互动易问答 投资者提问 + 公司官方回复(AI 问答独家信源:公司如何回应某传闻/利好)
同花顺热榜 人气值 / 概念标签 / 排名变化
东财人气榜 排名 + 排名变化 + 名称价格
东财个股概念命中 这只票当下被市场归到哪些概念在炒 + 热度值

宏观层(V3.7 新增)

端点 数据
人民银行社融 社会融资规模增量月度 12 列(人民币贷款/委托/信托/未贴现汇票/企业债/政府债/股票融资/ABS/核销)
国家统计局 PMI 制造业 / 非制造业商务活动 / 综合产出 + 大中小型企业分档

指数与交易日历

端点 数据
指数成分 中证最近成分、国证最近公布的月末成分;保留源侧日期,不提供历史时点回填
指数权重 中证/国证最近公布权重;单位为百分数,不假定与成分同日
指数估值 中证两种股本口径的 PE 和股息率;近期文件,不含 PB、不承诺全历史
官方交易日历 深交所完整自然月交易标志,缺日/未发布/未知标志抛错

备用源(主源被封时降级)

端点 数据
官方龙虎榜备胎 上交所 + 深交所官方接口,零鉴权权威一手,含营业部席位(东财被封时用)
资金流备胎 新浪日度四档单净额(超大/大/中/小单 + 净流入)
公告备胎 深市走深交所官方、沪市走东财,均带 PDF 直链(巨潮被封时用)
官方两融备胎 上交所/深交所分开查询,金额元、余量股/份;上交所缺融券余额金额时保留为空
北交所行情备胎 全板或单票 OHLC/成交量额/五档快照,强制核对交易日;不提供历史回填,盘中延迟未标定

另附十二层主源 → 独立备胎速查表(交易所官方 / 同花顺 F10 / HKEX / 巨潮 webapi / 金十等,全部不同风控面)与「已死透别用」名单,见 SKILL.md「备用源速查 & 降级策略」章节。

鉴权要求

除 iwencai 外,其余已接入数据源无需用户注册或 API Key;新增中证、国证和北交所也不需要用户凭据(北交所使用官网匿名 Cookie)。仅 iwencai 语义搜索需要 API Key(申请地址)。候选增强源不计入上述能力。


使用示例

跟你的 AI 助手说这些话就能激活:

场景 说什么
个股估值 「帮我估一下 688017,给我 PE / PEG / 消化时间」
题材归因 「今天哪些股票走强,主要是什么题材」
研报检索 「人形机器人产业链最近的研报,特别是丝杠和减速器」
北向资金 「今天北向资金流入流出怎么样」
概念板块 「688017 属于哪些概念板块」
资金流向 「000858 今天主力资金流入还是流出」
龙虎榜 「002475 最近上过龙虎榜吗,哪些营业部在买」
全市场龙虎榜 「今天龙虎榜哪些票净买入最多」
解禁预警 「这只股票未来 3 个月有没有限售解禁」
行业轮动 「今天哪些行业涨幅最大」
板块资金流 「今天主力资金在流入哪些行业/概念板块,近 5 日趋势呢」
融资融券 「600519 最近的融资余额变化趋势」
大宗交易 「这只票最近有没有大宗交易,溢价还是折价」
股东户数 「000858 股东户数在增加还是减少,筹码集中吗」
分红送转 「茅台历年分红派息多少」
ETF 行情 「510050 上证50ETF 现在什么价、今天涨跌多少」
涨停打板 「今天涨停多少家、最高几连板、炸板率多少」
涨停归因 「今天涨停的票都是什么题材,哪些是几天几板」
重点监控池 「现在哪些标的被交易所列入重点监控,监控到什么时候」
日内异动 「今天有哪些严重异常波动的票,触发的是哪条异动规则」
异动 × 监控交叉 「今天异动的票里,有没有已经在重点监控名单上的」
ETF 期权 「50ETF 平值期权的隐含波动率和 Delta 是多少」
互动易 「比亚迪最近投资者都在问什么,公司怎么回应的」
市场热度 「今天哪些票最热门,被归到什么概念在炒」
新闻公告 「拉一下 300476 最近的新闻和公告」
市场快讯 「用财联社电报看看现在市场上有什么大新闻」
批量对比 「帮我对比这 5 只半导体股的估值」
筹码分布 「600519 现在获利盘多少,平均成本在哪,筹码峰压力位在哪」
估值历史 「茅台现在的 PE 在过去十年是什么分位,顺便看下换手率」
ST / 停牌 「000004 历史上哪段时间是 ST,有没有停过牌」
行业变迁 「000001 在 2016 年属于哪个申万行业,跟现在一样吗」
宏观环境 「最新社融和 PMI 什么水平,现在流动性是宽还是紧」
指数成分 「沪深300最近的成分有哪些,文件日期是什么」
指数权重 「创业板指最近公布的权重是多少,注意保留真实日期」
指数估值 「中证沪深300近期 PE 和股息率,两种口径分别列出」
交易日历 「2026 年 9 月哪些日期开市,按深交所官方日历」
两融备胎 「东财不可用,分别取沪深交易所 2026-09-03 的两融明细」
北交所备胎 「从北交所官方取 920021 当前快照,核对交易日」

内置 4 套调研流程

流程 做什么 耗时
单票估值 实时价 → 一致预期 EPS → 前向 PE / PEG / PE 消化年数 30 秒
批量对比

readme truncated — read the full docs on github

Frequently asked questions

Is a-stock-data free to use?

a-stock-data is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does a-stock-data do?

A股全栈数据工具包 · 十二层架构 · 60端点 · 22数据源 · 零鉴权 | Full-stack China A-share data toolkit for AI agents — 12 layers, 60 endpoints, 22 sources, zero-auth

What is a-stock-data written in?

a-stock-data is primarily written in Python. Its source is publicly available at https://github.com/simonlin1212/a-stock-data, and it has 9,928 GitHub stars.