a-stock-data

a-stock-data is a skill for Claude Code, Codex from leecyno1/boutique-skills. It costs 263 tokens per session (50,872 once invoked), scanned B, original, MIT.

A Chinese-language toolkit for retrieving data about mainland Chinese stocks and related markets. It includes market prices, company financials, research reports, news, announcements, trading signals, fund flows, and ETF options data from multiple sources.

In plain words
What is it for?
Use it to fetch Chinese stock quotes and K-lines, reports, financial statements, announcements, trading activity, investor sentiment, and ETF option quotes for analysis or trading code.
Why use it?
It provides one set of code interfaces for many kinds of A-share data and includes backup sources when a primary source is unavailable. It also warns about stale stock codes and silent empty results.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: reads .claude/ paths; mentions Claude Code; mentions Codex.

Good fit Use it to fetch Chinese stock quotes and K-lines, reports, financial statements, announcements, trading activity, investor sentiment, and ETF option quotes for analysis or trading code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leecyno1/boutique-skills/a-stock-data
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add leecyno1/boutique-skills --skill a-stock-data
Clone the repo
git clone --depth 1 https://github.com/leecyno1/boutique-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for a-stock-data

README.md
[![agentmods](https://agentmods.dev/badge/skills/leecyno1/boutique-skills/a-stock-data/github.svg)](https://agentmods.dev/skills/leecyno1/boutique-skills/a-stock-data)
Your own site
<a href="https://agentmods.dev/skills/leecyno1/boutique-skills/a-stock-data"><img src="https://agentmods.dev/badge/skills/leecyno1/boutique-skills/a-stock-data/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for a-stock-data

Your own site · 80×15
<a href="https://agentmods.dev/skills/leecyno1/boutique-skills/a-stock-data"><img src="https://agentmods.dev/badge/skills/leecyno1/boutique-skills/a-stock-data.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 263 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 50,872 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00263 $0.50872
Opus 5 $0.00131 $0.25436
Sonnet 5 $0.00053 $0.10174
Haiku 4.5 $0.00026 $0.05087

Measured 11d ago against content hash b39ae1ee3eae, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade B, and why

a-stock-data scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

r1 = requests.post("https://irm.cninfo.com.cn/newircs/index/queryKeyboardInfo",

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

本 SKILL 提供统一的节流入口 `em_get()`(定义见下方「东财数据中心统一查询(共用 helper)」),它自动做到:串行限流(最小间隔 `EM_MIN_INTERVAL=1.0s` + 随机抖动)+ 复用 `EM_SESSION`(Keep-Alive)+ 默认 UA。**所有 `eastmoney.com` 端点的代码块都已改用 `em_get` 而非裸 `requests.get`**,AI 直接抄代码即自带防封。批量
Origin

Copies of this mod

2 near-identical copies found in the catalogue:

skills/default/a-stock-data/SKILL.md · 3,323 lines

How it starts

The opening of the file, as written. The whole thing — 3,323 lines — stays where its author put it; the contents beside it link to each section on GitHub.

📦 项目主页:https://github.com/simonlin1212/a-stock-data — 更新、反馈、支持作者

作者:Simon 林 · X @linsizhen · 邮箱:[email protected]

A股全栈数据工具包 V3.6.0

十层数据架构,47 个端点实测可用(44 主端点 + 3 官方备胎,2026-07 验证),覆盖主板/中小板/科创板/ST。每类数据在「备用源速查」列有独立备胎,主源被封时可降级。

V3.6.0(静默失败修复 + 重点监控池/日内异动,2026-07-31 · #15):

  • 🔴 北交所老号段(43/83/87)会返回僵尸数据且不报错:实测在市 342 只中 336 只已迁至 920xxx(锦波生物 832982920982、贝特瑞 835185920185),老码在东财研报静默返回 0 篇、在腾讯行情返回定格报价(成交量 0,价差达 17%~100%+)却仍是 HTTP 200。新增全局警告章节;tencent_quote() 增加 is_stale/stale_reason 标志(实测老码 2/2 命中、正常票 4/4 无误报);eastmoney_reports() 遇老码抛 ValueError 而非返回空
  • 🔴 §2.1/§2.2 研报层 ticker 未归一化(静默空)eastmoney_reports("SH600519") / "600519.SH" 一律返回 0 篇(reportapi 只认纯 6 位),而文档「Ticker 格式归一化」明文承诺全接口支持带前缀写法——承诺与实现不符,且失败方式是静默空,调用方会误读成「该标的无研报覆盖」。新增 norm_ticker() 实现(解析失败抛 ValueError,绝不返回空串),eastmoney_reports() / ths_eps_forecast() 接入。
  • §8.4 em_stock_monitor() 东财重点监控池新增(#15):交易所风险警示 / 重点监控名单 + 生效时间窗,零鉴权静态 JSON。
  • §8.5 em_price_anomaly() / em_price_anomaly_count() 日内异动池新增(#15):交易所「严重异常波动」口径的异动明细与按标的聚合统计,含 12 条异动规则码全解释。⚠️ 必须带 team=h5 等固定参数,缺失返回 unknow team——已做 result!=0 冒泡而非静默返回空。
  • §2.1 行业研报去硬编码日期begin 默认由固定的 2024-01-01 改为「相对今天往前两年」,避免时间窗越用越旧。
  • 端点 44 → 47。实测 24/24 通过(含前缀格式 4/4、老号段拦截、新端点真数据、异动接口拒绝冒泡)。

V3.5.0(板块资金流向,2026-07-23 · #37):

  • §3.8 board_fund_flow() 板块资金流向新增:补上此前缺失的板块级资金流——行业/概念/地域三类板块 × 今日/5日/10日三周期,主力净流入额/净占比 + 超大/大/中/小单四档明细 + 领涨股。与 §3.7 板块排名同源同接口(东财 push2 clist),此前只请求了价格/涨跌家数字段,本版补请求 f62/f184/f66... 资金流字段即覆盖。走 em_get 限流防封。端点 43 → 44。
  • 实测(2026-07-23):行业今日 100 个板块主力净额降序(电力设备 64.66亿 = 超大 43.55亿 + 大 21.11亿)、概念 5 日、地域 10 日均真实返回;参数校验拒绝非法 board_type/period。

V3.4.1(前缀路由 + mootdx 验活修复,2026-07-23):

  • §1.2/§市场前缀规则 前缀路由修复(#40 #41)5 开头沪市 ETF(510300/588200 等)、沪深指数(000300/000016 等)此前落到 else → sz,腾讯接口返回空或错票000016 被误判为 sz000016 *ST康佳A,静默返回不相干标的的数据,比返空更危险)。get_prefix()tencent_quote() 两处同步修复:5x→sh、沪指数白名单、支持显式前缀(sh000001/sz000001)透传解决 000001(上证指数 vs 平安银行)歧义。
  • §1.1 tdx_client() 真实取数验活(#43)_probe() 仅做 TCP 握手,握手成功 ≠ 能取数——坏服务器可握手通过却回 2 字节空 body,导致静默返回空 DataFrame 或连接崩溃且走不到 fallback。新增 _validate():每个候选 server 必须真实拉一根 K 线成功才采用,并对 factory() 连接异常做 try/except 跳过,全部失败才抛明确错误。
  • 备用源速查 K线行新增腾讯 m5 分钟 K 线(#43):同花顺 K 线备胎只有 30/60 分,mootdx 一挂就无 5 分钟源。补腾讯 ifzq.gtimg.cn 分钟 K(m1/m5/m15/m30/m60,零鉴权不封 IP)。⚠️ 第 7 字段是换手率基点不是成交额(差 3 个数量级),成交额需自算。

V3.4.0(接口质量 + 备用源韧性,2026-07-11):

  • §5.2 财联社快讯复活:旧 nodeapi 2026-05 下线后,改走官方 v1/roll/get_roll_list + 本地签名(sign=md5(sha1(排序query)),零 key),V3.2 移除的全市场电报能力恢复,与东财 7×24 互为独立备份。实测 errno=0。
  • 新增「备用源速查 & 降级策略」章节:十层主源→独立备胎速查表(不同域名/不同风控面)+ 3 个实测备胎函数——dragon_tiger_backup()(沪深交易所官方龙虎榜,含营业部席位)、fund_flow_backup()(新浪日度资金流)、announcements_backup()(深市深交所官方/沪市东财公告+PDF)。端点 40 → 43,数据源 13 → 15(新增沪深交易所官方)。
  • §3.6 解禁字段修复:东财 RPT_LIFT_STAGE 改列名致 type/shares 恒空 → 改 FREE_SHARES_TYPE/FREE_SHARES,并新增 able_shares(实际可流通股数,更贴近真实抛压)。
  • §3.7 行业排名排序修复:clist 请求补 fid=f3top/bottom 现按涨跌幅真实排序(此前缺排序字段,切片结果非涨幅序)。
  • §3.2 深股通标注:北向盘中披露收紧后 sgt 分钟序列不可靠(hgt 可用),权威北向用 HKEX 官方日统计(见备用源速查)。
  • 体验:顶部新增「端点路由速查」总表(§→函数→用途→源,可按需局部读取);FAQ 新增东财被封对策 / 财联社复活 / mootdx 库烂尾说明。

V3.2.3(行业研报新增):

  • §2.1 东财行业研报 eastmoney_industry_reports():研报层补上行业研报端点(此前只有个股研报)。与个股研报同端点 reportapi.eastmoney.com/report/list,仅 qType=1industry_code="*" 拉全行业、传东财行业码(如 1238=IT服务Ⅱ)精确过滤,PDF 复用 download_pdf(),走 em_get 限流。端点数 27 → 28。
  • 实测(2026-06-20):全行业 hits=47928、按行业码 1238 过滤 hits=1863,首篇 PDF H3_{infoCode}_1.pdf 下载成功(2.5MB,%PDF 头);行业码表端点(bxpa 等)404 不存在,用 "*" 拉取后从结果反查行业码。

V3.2.2(失效接口替换 + 隐藏 Bug 修复):

  • §3.3 概念板块归属(#18):百度 PAE getrelatedblock 失效(ResultCode 10003 + 空数组)→ 改用东财 slistspt=3eastmoney_concept_blocks(),一次请求拿全个股所属板块(行业/概念/地域 + BK码 + 涨跌幅 + 龙头股),零鉴权走 em_get 限流。
  • §7.1 巨潮公告 orgId(#19):硬编码 gssx0{code} 致大量 601xxx 股票 totalAnnouncement=0 → 新增 _cninfo_orgid() 动态查官方映射表 szse_stock.json(6198 只股,模块级缓存),硬编码降为 fallback。
  • 综合示例修复:示例仍调用 v3.1 已删的 baidu_fund_flow_history → 改 eastmoney_fund_flow_minute
  • §4.5/§5.1 风控说明:部分大陆住宅 IP 被东财间歇风控(HTTP 000/空)非代码 Bug,加重试/换网络提示。
  • 新代码原样 exec smoke test 实测:板块归属 茅台27/五粮液28/绿的谐波21;公告 平安601318/工行601398 原失效股恢复。

V3.2.1(Bug 修复): 修复两个内嵌函数的解析逻辑(预先存在,非 V3.2 引入)——

  • §5.1 东财个股新闻:东财实际返回里 result.cmsArticleWebOld 直接就是文章列表,旧写法对 list 调 .get("list") 触发 AttributeError / 返回空 → 改为遍历 cmsArticleWebOld 列表本身。
  • §6.4 新浪财报三表:新浪实际结构是 result.data.report_list(按报告期为键的 dict,每期 data 才是行项列表),旧写法取 result.data.{lrb} 永久返回空 → 改为遍历 report_list 期次、从每期 dataitem_title 提取。
  • 两函数均用茅台 600519 公开 API(零 key)实测返回非空、字段正确。

V3.2(防封 + 失效修复):

  • 数据源优先级 + 东财防封:明确「通达信(mootdx)/腾讯不封IP 优先用,东财仅用于其独有数据」原则;新增统一节流入口 em_get(),所有东财接口内置串行限流(间隔≥1s+随机抖动)+ 会话复用,AI 抄代码即自带防封。详见「数据源优先级 & 东财防封」章节。
  • 财联社快讯下线(#14)cls.cn 旧 API 全面 404,标注弃用并改用东财全球资讯。

V3.1 修复: 替换 4 个失效接口(百度 PAE 资金流→东财 push2、大宗交易 RPT 报表名更新、机构席位改用 BUY/SELL 明细筛选)+ 修复东财全球资讯 req_trace 参数 + 修复巨潮公告 orgId 格式。

V3.0 Breaking Change:彻底移除 akshare 依赖,所有数据源改为直连 HTTP API(零第三方数据依赖,仅 mootdx 保留 TCP)。

Read the full file on GitHub · 3,323 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 3,323 lines · 263 tokens per session scan B b39ae1ee3eae

Subscribe to this mod's changes

a-stock-data is a skill published in the GitHub repository leecyno1/boutique-skills (5 stars, last pushed 20d ago), licensed MIT. It adds 263 tokens to every session and 50,872 once invoked, about $0.0013 per session on Opus 5. A static security scan graded it B with 2 findings (sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

sector-rotation

An analysis framework for comparing industries in the Chinese A-share stock market, using business conditions, price momentum, valuation, and money flows. It produces rankings and higher- or lower-allocation suggestions.

HKUDS/Vibe-Trading · 39 tokens

strategy-pivot-designer

Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.

tradermonty/claude-trading-skills · 28 tokens

twitter-reader

Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…

himself65/finance-skills · 161 tokens

chenhao-limit-up

A framework for judging Chinese A-share stocks that have reached the daily price-rise limit, using market mood, sector leadership, and trading momentum.

questflowai/investorskills · 44 tokens

trading-risk-gate

Unified pre-trade safety gate: Ruin check (Law #1), ergodicity audit, and win-rate dominance validation. Absorbs: ergodicity-check, law-of-ruin, win-rate-dominance.

winstonkoh87/Athena-Public · 53 tokens

furusato

A Japanese hometown-tax donation manager for furusato nozei, a system where donations to municipalities can qualify for an income-tax or local-tax deduction. It reads donation receipts, stores donation records, and calculates deduction limits.

kazukinagata/shinkoku · 102 tokens