简体中文 | English
Full-stack data toolkit for China A-shares — 15 layers · 87 endpoints · 34 sources · zero-auth (except iwencai)
Quotes & K-lines · Research · Market Signals · Capital Flow & Chips · News · Fundamentals · Filings · Limit-Up · ETF Options · Sentiment · Macro & Rates · Index & Calendar · Futures & Commodities · Event-Driven · Convertible Bonds
Coverage · Architecture · Quick Start · Endpoints · Changelog
Full-stack data toolkit for China A-Share market — 15-layer architecture · 87 capability endpoints (82 primary + 5 backups) · 34 data sources · direct HTTP calls except two TCP client libraries (mootdx / baostock) A self-contained Skill file that consolidates raw A-share and related market data from 34 sources into a ready-to-use toolkit for AI coding assistants. No need to memorize Tencent K-line paging parameters, the binary layout of TDX end-of-day packages, Eastmoney PDF Referer headers, or iwencai X-Claw authentication — it's all handled. And when a primary source bans you, there's a backup-source quick reference to fall back on. > Compatible with [Claude Code](https://github.com/anthropics/claude-code) · [Codex](https://github.com/openai/codex) · [OpenClaw](https://github.com/openclaw/openclaw) · [WorkBuddy](https://www.workbuddy.cn/) · [Muse](https://muse.ai/) · [Grok Bot](https://x.ai/bot) > > The Skill file is structured Markdown + embedded Python. Any AI coding assistant with context injection can use it. > **V3.10.5 (2026-11-28 · #66 duplicated and missing ticks):** §1.4 `tencent_ticks()` now uses Tencent's trade-detail endpoint. Tencent keeps more than one copy of the day's ticks, and the copies split some trades differently; the old 70-row page endpoint mixed copies across pages, so some rows came twice and others were missing, and removing the duplicates still left the turnover about 3% short. Each batch is now joined to the previous one by content, and only at a whole-second boundary; in after-close tests on six symbols the session turnover matched the quote snapshot. `seq` is now renumbered from 0 for this fetch (numbers missing from Tencent's own copy stay missing), so two calls may differ by a few rows. §11.6 `macro_calendar()` now accepts unrated items (importance 0), which the default filter still leaves out. Entry count and source count are unchanged. > > **V3.10.4 (2026-11-04 · #64 fund adjustment):** when the §1.6 Sina adjustment factors were used on funds (ETF / LOF), only `f` was read, and for funds it is always 1, so no adjustment happened. The split ratio `s` and cumulative per-unit dividend `u` are now read as well: forward-adjusted `raw / s - u`, back-adjusted `(raw + u) * s`. Stock results, entry count and source count are unchanged. > > **V3.10.3 (2026-10-23 · SSE e-Interaction time column):** §10.3 `sse_e_interaction()` receives relative reply times (`昨天 18:22` — "yesterday 18:22"). The parser only accepted absolute times and raised for the whole page. Relative and absolute times are now both normalized to `YYYY-MM-DD HH:MM` (Beijing time), and unparseable times still raise. Entry count, source count and returned data are unchanged. > > **V3.10.2 (2026-10-11 · #58):** fixes the PE digestion years in `full_valuation()`. When the forward PE is above 30x and forecast earnings are not growing (or next year's forecast is missing), it used to return 0 years, as if the PE were already digested; it now returns `None`, meaning it cannot be estimated. It also returns `None` when current EPS is missing or not positive. Entry and source counts are unchanged. > > **V3.10.1 (2026-10-07 · #57):** corrects the §1.2 Tencent K-line volume unit: **STAR Market (688 / 689) is in shares**, everything else is in lots. The docs said lots throughout, so STAR volumes converted per the old docs came out 100× too large. Also adds the rules for reconciling share-level volume with the TDX end-of-day package and Baostock. §1.4 ticks now use a pooled, auto-retrying session (one call ~70 s → ~25 s) and add `frame.attrs["complete"]`, which from 15:31 on checks for missing after-hours fixed-price trades; §13.7 futures daily K-lines retry too. Entry count, source count and returned data are unchanged. > > **V3.10.0 (2026-09-22):** after the TDX public servers stopped serving K-lines, order books and ticks (#52), the quote layer now lists the working sources first (Tencent → Tencent K-lines → TDX end-of-day package → Tencent ticks) and moves mootdx to the end as an archive. New: §1.4 `tencent_ticks()` — Tencent intraday ticks for the latest trading day, one snapshot about every 3 seconds (replaces mootdx ticks) — and §13.7 `futures_kline()` — Sina futures daily K-lines, continuous or single contract, **now covering DCE**. Layer 1 is renumbered; the old→new mapping is in the CHANGELOG. > > **V3.9.0 (2026-09-20):** three new layers — futures & commodities, event-driven, convertible bonds — plus Tencent K-lines, the TDX official end-of-day package, Sina research reports, ETF shares, yield curves and more in the existing layers: 25 new entries in total. The broken TDX public-server K-line commands (#52) are now routed over HTTP. See the [CHANGELOG](./CHANGELOG.md) (Chinese). --- ## Data Coverage (15 categories)| # | Category | Data | Main sources |
|---|---|---|---|
| 1 | Quotes / K-lines | Live price, PE/PB/market cap/turnover, daily/weekly/monthly forward- and back-adjusted and 1–60-minute K-lines, full-market daily bars for a trading day (with turnover value), adjust factors, index / ETF | Tencent, TDX official site, Baidu, Sina |
| 2 | Research | Stock / industry reports and PDFs, ratings, 3-year EPS forecasts, consensus EPS, natural-language search, report lists | Eastmoney, Sina, THS, iwencai |
| 3 | Market signals | Hot stocks and themes, northbound flow, sector membership, fund flow, dragon-tiger board, lockup expiries, industry ranking, board fund flow | THS, Eastmoney |
| 4 | Capital flow / chips | Margin trading, block trades, shareholder count, dividends, 120-day fund flow, chip distribution, ETF shares | Eastmoney, SSE, SZSE, computed locally |
| 5 | News | Stock news, CLS flash, 7×24 live news, CCTV evening news transcripts | Eastmoney, CLS, Wallstreetcn, CCTV |
| 6 | Fundamentals | Quarterly snapshot, F10, financial statements, valuation history, listing/delisting dates, SW industry history, ST list | TDX (mootdx), Sina, baostock, SW, Eastmoney |
| 7 | Filings | Full filings across SSE / SZSE / BSE | cninfo |
| 8 | Limit-up | Limit-up / break / limit-down / previous-day pools, limit-up reasons, watch list, intraday anomalies | Eastmoney, THS |
| 9 | ETF options | T-quotes, Greeks, implied volatility | Sina |
| 10 | Sentiment | cninfo IRM (Shenzhen), SSE e-Interaction (Shanghai), THS hot list, Eastmoney popularity rank, concept hits | cninfo, SSE e-Interaction, THS, Eastmoney |
| 11 | Macro & rates | Social financing, PMI, government and credit yield curves, repo fixing rates, LPR, global macro calendar | PBoC, NBS, ChinaBond, China Money (CFETS), Eastmoney, Wallstreetcn |
| 12 | Index & calendar | CSI / CNI constituents and weights, CSI PE and dividend yield, SZSE trading calendar | CSI, CNI, SZSE |
| 13 | Futures & commodities | Futures daily quotes, commodity and index options, member position rankings, real-time futures, FTSE China A50, SGE spot | SHFE, INE, CZCE, CFFEX, GFEX, Sina, SGE |
| 14 | Event-driven | Earnings previews, institutional surveys, shareholder buying/selling, buybacks, share pledges, IPO calendar | Eastmoney |
| 15 | Convertible bonds | Terms, conversion price, conversion value, premium, listing / delisting status | Eastmoney |
| Endpoint | Data |
|---|---|
| Tencent Finance | PE(TTM) / PB / Market Cap / Float Cap / Turnover / Price Limits / Index / ETF |
| Tencent K-lines | SSE/SZSE daily/weekly/monthly forward- and back-adjusted + 1/5/15/30/60-minute bars, rotating across three Tencent hosts; no BSE (V3.9 new) |
| TDX End-of-Day Package | Every SSE/SZSE/BSE security's daily bar for one trading day, incl. turnover value; one 2–3 MB zip; 2022-01-04 and 2023-01-03 tested available, 2021-01-04 gone, not every day verified; packages before 2022-05-06 have no BSE files (V3.9 new) |
| Tencent Ticks | All ticks of the latest trading day (~3-second snapshots, not Level-2 trade-by-trade): time / price / volume / value / buy-sell side, SSE/SZSE stocks + ETFs, no BSE; after the close the total is checked against the day's turnover (V3.10 new, replaces mootdx ticks) |
| Baidu K-line | Daily K-line + MA5/MA10/MA20 moving averages included (V3.0 new) |
| Sina Adjust Factors | qfq / hfq factor series + applying them to unadjusted candles (V3.7 new) |
| mootdx Market Data (archive) | Candlesticks (multi-period) + order book + ticks + 46-field quote (⚠️ TDX public servers return empty since 2026-09, see FAQ #52; use Tencent K-lines / the end-of-day package for bars and Tencent Ticks for trades) |
| Endpoint | Data |
|---|---|
| Stock News | Eastmoney per-stock news (direct search-api-web) |
| CLS Flash | Market-wide real-time flash (v1 API + local signature, zero key, ✅revived in V3.4.0, mutual backup with Global News) |
| Global News | Eastmoney global finance news (direct np-weblist, 7×24) |
| Wallstreetcn Live | 7×24 live news by channel, with a paging cursor (V3.9 new) |
| CCTV Evening News | Xinwen Lianbo item titles + transcripts (cctv.com, updated after about 20:00 Beijing time; V3.9 new) |
| Endpoint | Data |
|---|---|
| Investor Q&A (IRM) | Investor questions + official company replies (cninfo, Shenzhen-listed companies; unique source: how a company responds to rumors/news) |
| SSE e-Interaction | Investor questions + replies for Shanghai-listed companies, which cninfo IRM does not cover (V3.9 new) |
| THS Hot List | Popularity / concept tags / rank change |
| EM Popularity Rank | Rank + rank change + name/price |
| EM Stock Concept Hits | Which concepts the market is grouping this stock under + heat |
| Endpoint | Data |
|---|---|
| PBoC Social Financing | Aggregate Financing to the Real Economy, monthly, 12 columns (RMB/entrusted/trust loans, undiscounted acceptances, corporate & government bonds, equity financing, ABS, write-offs) |
| NBS PMI | Manufacturing / non-manufacturing / composite PMI + large / medium / small enterprise breakdown |
| ChinaBond Yield Curves | Government / commercial bank AAA / short-term note AAA, 3 months to 30 years (V3.9 new) |
| Repo Fixing Rates | FR001 / FR007 / FR014 and the matching FDR tenors (China Money; FR about 3 years, FDR about 1 year of history; V3.9 new) |
| LPR | 1-year / 5-year full history (incl. the daily quotes of the 2013–2019 regime; V3.9 new) |
| Global Macro Calendar | Actual / forecast / previous / revised values and importance (Wallstreetcn; V3.9 new) |
| Endpoint | Data |
|---|---|
| Futures Daily | Official closing data from SHFE / INE / CZCE / CFFEX / GFEX: OHLC, settlement, volume, open interest and its change, turnover |
| Options Daily | Commodity and index options: strike, settlement, volume and open interest, Delta, implied volatility (per series on SHFE / INE, per contract on CZCE / GFEX; CFFEX publishes neither Delta nor IV) |
| Member Position Rank | Top 20 members by volume / long / short positions and their changes (SHFE, INE, CZCE, CFFEX) |
| Real-Time Futures | Sina real-time price and best bid/ask across all six futures exchanges (use this for DCE contracts); price limits for CFFEX contracts only |
| Futures Daily K-lines | Sina daily bars for a continuous series (RB0 / M0, back to 2005) or a single contract (those expiring from about 2022), all six exchanges incl. DCE; prices match the official daily data, settlement prices are incomplete (V3.10 new) |
| FTSE China A50 | FTSE China A50 continuous futures quote |
| SGE Spot | Shanghai Gold Exchange Au99.99 / Au(T+D) / Ag(T+D) / Pt99.95 and more, daily bars |
| Endpoint | Data |
|---|---|
| Convertible Bonds | Underlying stock, rating, issue size, conversion price, conversion value, premium, listing / maturity / delisting dates and status |
| Workflow | What it does | Time |
|---|---|---|
| Single Stock Valuation | Live price → Consensus EPS → Forward PE / PEG / PE payback years | 30 sec |
| Batch Comparison | Side-by-side valuation ranking | 1 min |
| Thematic Research | iwencai multi-keyword NL search + Eastmoney PDF cross-reference | 2 min |
| New Target Research | Coverage → Valuation → Concepts → Fund flow → Dragon tiger → Lockup → Margin | 1 min |
| Priority | Source | Protocol | IP Ban Risk | Use |
|---|---|---|---|---|
| 1 (top) | Tencent Finance | HTTP | Never banned (one K-line host rate-limits after ~600 calls; three hosts rotate) | Live price / PE / PB / market cap / turnover / price limits / index / ETF / daily-weekly-monthly and minute K-lines |
| 2 | Exchanges / official bodies | HTTP | Very low (avoid bursts) | TDX package, SSE / SZSE / BSE, five futures exchanges, SGE, ChinaBond, China Money, CSI / CNI, PBoC, NBS |
| 3 | Sina / cninfo / THS / Baidu / CLS / Wallstreetcn / CCTV / SW | HTTP | Low | Financial statements, adjust factors, report lists, real-time futures, filings, consensus EPS, hot stocks and northbound, K-lines with MAs, live news, evening news, industry history |
| 4 | mootdx (TDX) | TCP 7709 | Never banned | Financial snapshots and F10 "latest notes" work; K-lines / order book / ticks return empty since 2026-09 (#52); ticks now come from Tencent §1.4 |
| 4 | baostock | TCP | Low (no registration) | Valuation history PE/PB/PS/PCF + turnover + suspension + ST + listing/delisting dates (no Beijing Exchange) |
| Key required | iwencai | OpenAPI | Low | NL semantic report search (the only source that needs a key) |
| last (exclusive only) | Eastmoney datacenter / push2 / reportapi / search / np-weblist | HTTP | Medium — has rate-limit risk | Dragon-tiger / lockup / margin / block trades / shareholders / dividends / fund flow / report PDFs / news / ST list / LPR / event-driven / convertibles (all via em_get()) |