A-Share Full-Stack Data Toolkit
10-layer architecture, 47 data endpoints, 15 data sources, zero-auth — one skill file integrates A-share market, research, capital flow and more.
- Source repo
- simonlin1212/a-stock-data
- Stars
- ★ 12k
- Last updated
- 4d ago v3.10.5
- FARS reviewed
- Nov 08, 2026 +1 new
- License
- Apache-2.0
- Primary language
- Python
- FA score
- 70/100 · Some gaps
At a glance
- How it runs
- Works with
- Portable with changesClaude CodeCodex (Partial support)OpenAI API (Needs adaptation)
- Cost
- Free, no paid service needed
- Setup effort
- Low · running in minutes
- You'll need
- Typical use
- Individual investors using Claude Code to quickly query stock valuations (e.g., 'Estimate 688017, give PE/PEG/absorb time').
- Not a fit if
- Teams needing fully offline or air-gapped operation; all data comes from external public APIs
- Users wanting a backtesting engine or strategy framework; this only fetches data
- Overseas deployments without a China IP; mootdx times out
- Maintenance
- Commits in the last 30 dayslast commit 2026-11-28latest release v3.10.5 (2026-11-28)+26.3 ★/day over 7 days
- Source review
- 70/100 · Some gaps
What does this agent do, and when should you use it?
a-stock-data is a self-contained Skill file designed for AI coding assistants (like Claude Code, Codex) that aggregates A-share (Chinese stock market) data from 15 public data sources into a directly usable toolkit. It features a 10-layer architecture covering market quotes, research reports, signals, capital flow, news, fundamentals, announcements, limit-up tracking, ETF options, and investor interaction, totaling 47 endpoints. The repository distributes a single SKILL.md file; users copy it to the skill directory and it works. Embedded Python code executes directly, compatible with Claude Code, Codex, OpenClaw, and other context-injection AI tools. It emphasizes zero-auth (except iwencai) and mitigates IP bans through data source prioritization and fallback strategies. Licensed under Apache-2.0, it suits developers needing rapid A-share data for investment research.
The agent reads SKILL.md and exposes data-fetching functions to the AI assistant. Users make natural language requests like 'check 688017 valuation', and the agent parses and calls appropriate functions. Operations include: calling mootdx for K-lines, five-level order books, and tick-by-tick data; Tencent Finance for PE/PB/market cap; Eastmoney endpoints for research reports, dragon-tiger lists, capital flows, margin trading, etc., with all Eastmoney calls rate-limited via em_get() to prevent IP bans; asking iwencai for natural-language research search (requires API key); fetching stock news via Eastmoney and Cailianshe telegraph; retrieving announcements from cninfo; quoting ETF options with Greeks, etc. It includes four built-in research workflows (single-stock valuation, batch comparison, themed research, new ticker research) and provides fallback sources (e.g., official exchange APIs) for degradation.
- Individual investors using Claude Code to quickly query stock valuations (e.g., 'Estimate 688017, give PE/PEG/absorb time').
- Quantitative researchers fetching dragon-tiger list data via natural language to analyze institutional moves (e.g., 'Did 002475 appear on the dragon-tiger list recently? Which brokers are buying?').
- Financial news editors using Cailianshe telegraph for real-time market alerts and monitoring major news.
- Investment analysts using iwencai for themed research (e.g., 'Recent reports on humanoid robotics supply chain, especially screws and reducers').
- Traders monitoring limit-up ladders and themes for short-term decisions (e.g., 'How many limit-ups today? What's the highest streak? What's the break rate?').
- Options traders querying IV and Delta of ETF options (e.g., 'What are the ATM option IV and Delta for 50ETF?').
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
pip install mootdx requests pandas stockstats
- Config files
~/.claude/skills/a-stock-data~/.claude/skills/a-stock-data/SKILL.md
How do you install or deploy this agent?
Installation: 1) Create skill directory mkdir -p ~/.claude/skills/a-stock-data; 2) Download SKILL.md: curl -o ~/.claude/skills/a-stock-data/SKILL.md https://raw.githubusercontent.com/simonlin1212/a-stock-data/main/SKILL.md; 3) Install Python dependencies: pip install mootdx requests pandas stockstats. For Codex/OpenClaw users, paste the SKILL.md content into your system prompt or project context file. iwencai requires an API key (https://www.iwencai.com/skillhub).
How do you use this agent?
After installation, in Claude Code simply say 'Help me check 688017's valuation' and it activates automatically. Other examples: say 'Which stocks are strong today and what themes?' for hot stocks; 'Is 000858's main capital flowing in or out today?' for capital flow; 'Pull up recent news and announcements for 300476'. All calls are natural language, no command memorization. For Codex/OpenClaw, include the SKILL.md content in context.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
What are this agent's strengths and limitations?
- Zero-auth: All data sources except iwencai are free and keyless, out-of-box usable.
- Clear architecture: 10 layers covering everything from quotes to investor interaction; 47 endpoints.
- Built-in fallbacks: If primary sources are blocked, official exchange endpoints and others provide degradation.
- Single self-contained file: Easy to distribute and portable, works offline.
- Relies on multiple third-party data sources; interfaces may change or close (e.g., Eastmoney has rate limits).
- Some sources like iwencai require API key, not completely free.
- Beijing Stock Exchange old code segments are deprecated; new 920 codes needed, otherwise stale quotes.
- Requires domestic IP for mootdx; overseas deployment may timeout.
How does this agent compare with similar options?
In the A-share data space, common alternatives include akshare (Python wrapper) and tushare (requires token). This project removed akshare dependency in V3.0 due to intermediate failure points; tushare needs credits. Compared to commercial terminals like Wind or Choice, this is free but may lack full breadth.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| A-Share Full-Stack Data Toolkit This agent | 70 · Some gaps | Agent plugin / skillFree | ★ 12k | 4d ago | Python | Claude Code |
| OpenBB Open Data Platform | 62 · Some gaps | Library / SDKFreemium | ★ 76k | 3d ago | Python | — |
| BetterTradingAgents | 71 · Some gaps | — | ★ 38 | 19d ago | Python | OpenAI API |
| FinRobot | 48 · Major gaps | CLIFree + model costs | ★ 8.5k | 1d ago | Python | OpenAI API |
How does FollowAgents rate this agent?
Why each dimension lost points
The Skill is framed as read-only market and reference data retrieval across public HTTP/TCP sources, and it discloses Eastmoney rate limiting, anonymous access, and the iwencai key requirement; this supports least_privilege=2, data_flow_transparency=2, and external_effects=2. Deductions: it does not detail request data, key storage/protection, user confirmation, or cleanup/rollback, so user_confirmation=1, sensitive_data_handling=1, and rollback=1. Dependencies and an install command are listed, but no pinning or security review is shown (dependency_security=1). An author and contact are named, but identity is unverified and maintenance assurance is limited (source_attribution=2).
The README, Skill, and changelog are broadly consistent about the 15 layers, endpoint and source counts, and they describe mootdx failures, fallbacks, and data boundaries; this supports self_consistency=2 and dependency_availability=2. The material says newer endpoints distinguish empty data from interface failure, documents date/format errors, and gives a mootdx failure path (failure_messages=2). Deductions: the 87-endpoint count depends on special counting rules, and upstreams may throttle, change, or omit data; static material does not establish availability or result correctness.
The Skill targets AI coding assistants that need to retrieve A-share and related-market data, gives many concrete scenarios, and excludes questions that need no data retrieval, supporting audience_and_scenarios=3 and trigger_precision=3. It clearly says it provides data retrieval rather than a backtest engine and documents boundaries such as Beijing Stock Exchange coverage and the lack of historical index constituents (capability_boundaries=3). Python 3.9+ and dependencies are listed, but the installation example centers on Claude Code while Codex/OpenClaw require manual prompt injection, so environment_fit=2.
The README is organized around coverage, architecture, setup, endpoints, examples, and FAQ, while the Skill uses layer-based sections; setup is actionable but thinner for non-Claude environments (information_architecture=3, install_notes=2). Endpoint names and numbering are documented, though numbering has been reorganized and the changelog notes older references, warranting naming_stability=2. Examples, FAQ, and limitations are extensive (examples_and_faq=3, known_limitations=3). The LICENSE contains Apache-2.0 terms (license=3), and the versioned changelog is detailed (versioning_changelog=3). Author and contact details provide an update path, but no response commitment or formal maintenance responsibility is shown (maintenance_responsibility=2).
The product consolidates scattered sources, request details, parsing, and fallback guidance into embedded code for AI use, with field descriptions, scenario examples, and alternate sources; this gives it high marginal value (marginal_value=3). The README describes a self-contained package that needs no key for most sources, but several dependencies must be installed, upstream rate limits remain, and users must check data; output_usability=2 and cost_benefit=2. DataFrames and source/time metadata are described, but this sample does not show the complete implementation or output.
The documentation maps features to sources, sections, fields, and versions, and gives dates, sample dates, and limitations for some changes; fixtures provide Sina adjustment-factor samples, but only for a narrow area (claim_traceability=2). Multiple independent and official sources are listed for corroboration or fallback, though this packet lacks enough implementation or results to verify most claims (cross_source_corroboration=2). The docs identify test dates, inference boundaries, and items not checked day by day, showing some separation of fact and limitation; many capability claims remain documentation assertions (fact_inference_separation=2).
- This Skill retrieves data; it does not provide a backtest engine or investment advice. Check dates, coverage, volume units, and data completeness.
- Upstream interfaces may throttle, change, or return incomplete data. Note the Eastmoney rate limits, mootdx market-data failures, and documented Beijing Stock Exchange and historical-data limits.
- iwencai requires an API key; the materials do not explain how the key is stored or protected.
Recent releases
Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.
-
Release notes excerpt
十五层、87 个入口、34 个来源都不变。修 #66 报的两个问题:§1.4 逐笔页与页之间重发几笔、又缺几笔;§11.6 宏观日历遇到没评级的条目整段报错。感谢 @liuzhi224 报告。 修复 §1.4 腾讯逐笔:重发几笔、又缺几笔(#66) 根因是腾讯后台的当日成交明细不止一份。同一时刻的成交,有的副本记成一笔、有的拆成两笔,所以各份的笔数和序号差几笔: 2026-11-27 实测 000001 两份分别是 4740 笔和 4744 笔(09:30:12 那笔 1976 手,另一份拆成 09:30:09 的 1015 手和 09:30:12 的 961 手), 两份的成交额合计都与行情快照相符。原来用的 70 笔一页接口(stock.gtimg.cn/data/index.php)每页固定落在某一份上, 各页混着不同的副本,页与页之间就会重发几笔、又缺几笔:11-27 实测 000001 有 20 页各重发 4 笔,同时缺 4 笔。 只去掉重发不够:去完以后 000001 连续竞价段成交额仍比快照少约 7800 万元(3%),原有的金额核对照样会报错。所以换了取法: …View on GitHub ↗ -
v3.10.4 v3.10.4 — 基金复权修复(#64)
Release notes excerpt
十五层、87 个入口、34 个来源都不变,个股的返回值也不变。只修 §1.6 基金(ETF / LOF)复权。 修复 §1.6 基金复权因子空转(#64) 根因是我们只读取 f,漏掉上游基金复权响应已有的 s(累计份额折算比例)和 u(累计每份分红),不是上游数据错误。基金(ETF/LOF)现在使用 qfq:raw / s - u;hfq:(raw + u) * s, 返回因子时增加 split / dividend,复权结果增加 adj_split / adj_dividend,价格保留 4 位小数。个股字段及乘除逻辑不变。 混杂口径、非正折算比例、基金 f != 1、基金前复权舍入后非正价显式报错;基金长区间使用 hfq。 测试 新增 tests/test_v37_adjust_factor.py 21 条离线测试:直接抽取 SKILL.md 的 §1.6 代码,覆盖示例基金分红及份额折算、 36 个完整的对照数据源收盘价检查点、个股返回值及异常类型/时机回归、1900 哨兵、404、异常口径、list / DataFrame 入参及 Python 3.9 语法。 保留已发布说明与示例,仅调整长区间建议并追加基金口径及自检说明。 …View on GitHub ↗ -
v3.10.3 v3.10.3 — 上证e互动时间列修复(#61)
Release notes excerpt
十五层、87 个入口、34 个来源都不变,返回的数据也不变。只修 §10.3 上证e互动的时间列。 修复 §10.3 上证e互动的回复时间是相对写法,整页解析直接抛错 站点的提问时间一直是绝对写法(2026年10月21日 17:47),但 1 天内的回复时间是相对写法(昨天 18:22, 2026-10-23 实测第 1798068 条起全是这样)。_sse_time() 只认「YYYY年MM月DD日 HH:MM」,遇到相对写法返回 None, _sse_parse_feed() 按「时间认不出必须报错」的设计抛 RuntimeError: 回复时间认不出: '昨天 18:22'。 结果是:只要第一页里有昨天回复的问答,整个 sse_e_interaction() 就不可用——不是返回少几行,是直接报错。 _sse_time() 现在认这些写法,都换算成 YYYY-MM-DD HH:MM: - 绝对:2026年10月21日 17:47、2026-10-21 17:47; - 相对:今天 / 昨天 / 前天 HH:MM、N秒 / 分钟 / 小时 / 天前、刚刚; - 只给月日:10-20 08:30(跨年时回退到上一年); - 只有时分:09:31(按今天算)。 …View on GitHub ↗
FAQ
pip install mootdx causes httpx version conflict; what to do?
pip install --no-deps "httpx>=0.27.1" to upgrade httpx; mootdx still works as it uses TCP protocol, not httpx. Or use a separate venv.Eastmoney API returns 403 or connection reset; how to handle?
Why no research reports for Beijing Stock Exchange stocks?
SKILL.md is large; will token usage be high each load?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.