# a-stock-data: a zero-auth China A-share data toolkit for AI coding agents

> a-stock-data packages 60 endpoints across 22 sources into a single SKILL.md file that Claude Code, Codex and OpenClaw can read. It is a research convenience layer, not a trading system, and its own documentation flags which sources can be degraded.

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

- Repository: https://github.com/simonlin1212/a-stock-data
- Stars: 10,435 · Forks: 1,900
- Language: Python
- License: Apache-2.0
- Published: 2026-09-10 · Updated: 2026-09-10 · Language: en
- Canonical page: https://hysenlabs.com/projects/simonlin1212-a-stock-data

## What a-stock-data actually packages

The project is a single SKILL.md file, described in the README as structured Markdown with embedded Python. It collects A-share data access code that would otherwise be scattered across 22 upstream sources: mootdx, Tencent Finance, Baidu K-line, Sina, Eastmoney (reportapi, datacenter, push2, push2ex), Tonghuashun, iwencai, cninfo, baostock, Shenwan, the PBOC and the National Bureau of Statistics. The stated goal is that a user does not have to remember mootdx K-line parameters, Eastmoney's PDF Referer header or iwencai's X-Claw authentication.

The audience is narrow and specific. It targets people using an AI coding assistant that supports context injection, and the README names Claude Code, Codex and OpenClaw as compatible. The README also notes that the author is looking for AI-related work in Shenzhen, which tells you this is a personal project with a single maintainer rather than a funded data vendor. That matters for anyone planning to depend on it.

## The twelve-layer layout and how a request moves

The architecture diagram splits coverage into twelve named layers: quotes, research reports, signals, capital and chips, news, fundamentals, announcements, limit-up boards, ETF options, sentiment and interaction, macro, and index and calendar. Above them sits a priority rule stated in the diagram itself: mootdx and Tencent are preferred because they do not block IPs, while Eastmoney is reserved for data only it carries and is rate-limited internally to avoid bans.

That priority rule is the real design decision. It means the same conceptual field, say a price or a market cap, can come from different upstreams depending on which layer you call, and the fallback table exists because any one of them can stop responding. The README describes a separate section for backup sources and degradation strategy covering dragon-tiger lists, fund flows, announcements, official margin financing, and Beijing Stock Exchange quotes. The honest reading is that a-stock-data is a routing and normalisation layer over sources it does not control, and the document says so rather than hiding it.

Two layers do local computation instead of fetching. Chip distribution (CYQ) computes profit ratio, average cost, cost bands and chip peaks locally, and the Tonghuashun Northbound history endpoint is described as local self-cache rather than an upstream series.

## Installing the skill and asking for a first valuation

The README gives a three-step, two-minute setup for Claude Code. It creates a skills directory, downloads SKILL.md into it, and installs the Python dependencies. Note that akshare is explicitly no longer required as of V3.0.

```bash
mkdir -p ~/.claude/skills/a-stock-data
curl -o ~/.claude/skills/a-stock-data/SKILL.md \
  https://raw.githubusercontent.com/simonlin1212/a-stock-data/main/SKILL.md
pip install mootdx requests pandas stockstats numpy baostock xlrd openpyxl
```

After that, start Claude Code and ask a question about a ticker. The README's own example is asking for the valuation of 688017, and it says the skill activates automatically. For Codex or OpenClaw, the instruction is different: paste the contents of SKILL.md into your system prompt or project context file, and the embedded Python can be executed directly. There is no package on PyPI and no CLI entry point described.

One practical caveat before you run anything: this is a data-fetching skill, so the first request will hit live upstream endpoints. If a source is unreachable from your network, you will see that at the call site, not at install time.

## Where the coverage stops: Northbound, Beijing, and point-in-time indices

The most useful parts of the README are the admissions. The Tonghuashun Northbound realtime endpoint covers Shanghai Connect minute-level flow, but the README states that Shenzhen Connect disclosure has recently tightened upstream and should be treated as reference only, with the authoritative Northbound figure available via an HKEX backup. If your research depends on Northbound flows, this is not the primary source.

The valuation history endpoint, added in V3.7, goes back to 2016 and carries PE, PB, PS, PCF, turnover, suspension and ST flags, but the README says it does not support the Beijing Stock Exchange. The Shenwan industry history endpoint removes look-ahead bias, which is genuinely useful for backtests, but it returns codes without Chinese names. For index data the constraint is sharper: constituents are the most recent China Securities Index or Guozheng month-end publication, weights are the most recently published weights in percent with no assumption that they share a date with constituents, and valuation covers PE and dividend yield only, with no PB and no promise of full history. The README also says historical point-in-time backfill is not provided.

That last point is the one that disqualifies a whole class of use. If you are building a backtest that needs the index membership as it stood on a past date, this toolkit will not give it to you.

## How it differs from akshare and from a broker data API

The closest well-known comparison is akshare, a general-purpose open source financial data library. a-stock-data is narrower in scope, A-share only, and its packaging is the difference: it ships as an agent-readable skill file rather than an importable library, and V3.0 removed akshare from the dependency chain entirely. If you want a Python library you call from your own code, akshare is the more conventional choice. If you want an assistant to pick the right endpoint from a natural-language question, the skill file format is the point.

The other comparison is a broker or exchange data API. Those give you a contract, a rate limit and a support path. a-stock-data gives you none of that; it wraps public endpoints, some of which carry authentication quirks the README mentions specifically, such as Eastmoney's PDF Referer and iwencai's X-Claw header. The trade is convenience and breadth against contractual stability. The README's own fallback table is an acknowledgement of that trade.

## Maintenance, licensing and what an upgrade costs you

The repository is not archived, and the last push was on 2026-09-05, which is recent. Release notes show a steady cadence through the 3.7.x and 3.8.0 line, with fixes as specific as Beijing Stock Exchange code-range detection and a get_prefix() suffix routing bug. The 3.8.0 release is titled around index data and exchange official backups. A single maintainer shipping point fixes at that granularity is a good sign for correctness, and a risk for continuity.

Upgrade cost is low in the mechanical sense, because installation is a file download plus a pip line. The real cost is that upstream schemas change. When Eastmoney or Tonghuashun alters a response, the embedded Python in SKILL.md has to be updated, and you get that only by re-downloading the file. There is no version pinning described for the skill file itself, so if you need reproducibility you should vendor a copy and record which release it came from.

The license is Apache-2.0, which permits commercial use and modification and includes a patent grant, with the usual notice and attribution conditions. That is a permissive choice for a project of this kind. This is not legal advice; if you are redistributing the file inside a product, read the LICENSE in the repository and check the terms of each upstream data source separately, since the licence covers the project's code, not the data it fetches.

## Conclusion

Adopt a-stock-data if you already drive Claude Code, Codex or OpenClaw and want A-share quotes, filings and fund-flow fields without writing per-source auth code; the install is three commands and the dependency list is explicit. Do not adopt it if you need point-in-time index membership, Northbound history as an authoritative series, or a stable public API contract for a production trading system. Before relying on it, check the SKILL.md section that lists the real data dates for each source and the fallback table, since several endpoints are documented as degraded or self-cached rather than upstream-authoritative.

## FAQ

### What does a-stock-data mean by "stock data"?

In this project the term covers raw A-share fields pulled from 22 upstream sources and grouped into twelve layers: quotes, research reports, signals, capital and chips, news, fundamentals, announcements, limit-up boards, ETF options, sentiment, macro, and index and calendar data.

### How can I get stock data with a-stock-data?

The README's quick start creates ~/.claude/skills/a-stock-data, downloads SKILL.md into it with curl, then installs mootdx, requests, pandas, stockstats, numpy, baostock, xlrd and openpyxl. After that, asking Claude Code a question about a ticker activates the skill automatically.

### Can I download stock data in Excel with a-stock-data?

The repository documents no Excel integration. Its outputs are consumed by an AI coding assistant through the embedded Python in SKILL.md, so getting the data into a spreadsheet would require exporting it yourself from those calls.

## Sources

- [Issues](https://github.com/simonlin1212/a-stock-data/issues)
- [License: Apache-2.0](https://github.com/simonlin1212/a-stock-data/blob/main/LICENSE)
- [README](https://github.com/simonlin1212/a-stock-data/blob/main/README.md)
- [Releases](https://github.com/simonlin1212/a-stock-data/releases)
- [simonlin1212/a-stock-data on GitHub](https://github.com/simonlin1212/a-stock-data)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/simonlin1212-a-stock-data
