← Back to Skills Marketplace
alanwu2024

ashare-market-data-fetcher

by AlanWu2024 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
68
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install ashare-market-data-fetcher
Description
抓取并整理 A股市场数据。Use for: 获取 A股股票基础资料、交易日历、日线/分钟线/复权行情、停复牌、财务三表、财务指标、板块题材、资金流、公告与专业市场数据说明;当用户要求尽可能全面、详细、准确地获取 A股市场数据时使用。
README (SKILL.md)

A股市场数据抓取技能

在用户要求 抓取 A股市场数据核对行情/财务/公告为研究或回测准备数据解释不同数据源为何不一致,或者 尽量全面且准确地整理某只股票、某个板块或某个时间段的数据 时,使用此技能。

本技能的核心目标不是随便抓到一些数字,而是使用 分层数据源策略、明确字段口径和多源校验规则,产出可用于研究、复盘、回测和半自动交易辅助的数据结果。

核心原则

始终把准确性优先级放在抓取速度之前。对 A股数据,必须区分 官方口径商业专业口径开源聚合口径网页抓取口径,不要把它们混为一谈。1 2 3 4

默认采用如下优先级:

优先级 数据源层级 适用场景 使用原则
P1 交易所官方 / 官方授权链路 Level-2、逐笔、订单簿、交易制度、权威市场口径 只要用户追求“最准确”且涉及高等级实时数据,先说明官方或持牌链路的必要性
P2 专业商业数据接口 高稳定性、机构级序列数据、基本面深度字段 当用户需要专业级质量且可接受付费时优先考虑
P3 AKShare 历史行情、部分财务报表、交易日历、市场统计、板块题材、公告补充、回测研究 作为免费结构化与聚合数据主源
P4 巨潮资讯 / 交易所公开页面 定期报告、公告、交易制度、市场统计与权威披露 作为免费权威补源
P5 其他网页公开页面 无正式接口但需补全信息时 只能作为补救方案,必须标注口径与抓取时间

数据源定位

1. AKShare

优先将 AKShare 用于 股票基础资料、交易日历、日线、分钟线、复权相关行情、市场统计、板块题材、资金流、龙虎榜、公告补充 等免费可得的结构化与聚合数据。1 2

当任务涉及下列目标时,优先想到 AKShare:

任务 默认主源
历史回测数据准备 AKShare
财报分析底稿 AKShare + 巨潮资讯
股票清单、上市公司信息、交易日历 AKShare
复权价格与交易状态补充 AKShare + 交易所公开披露

不要把 AKShare 当作最高权威口径。它更适合承担 免费主抓取层广覆盖聚合层

2. 巨潮资讯 / 交易所公开页面

优先将 巨潮资讯 用于 公告、定期报告、上市公司披露文件 的免费权威补充;将 上交所/深交所公开页面 用于 交易制度、市场统计、市场概览与权威披露 的交叉核验。3 4 5

当用户要求“尽量准确”且任务涉及财报、公告、交易制度或市场统计时,应主动用巨潮资讯或交易所公开页面做第二来源校验。

3. Choice / EMQuant

当用户追求更高稳定性、更多专业字段、机构化使用体验,且接受商业数据接口时,将 Choice 视为升级选项。官方手册明确说明其可通过函数调用提供 基本面、财务、序列数据,并支持多种语言环境。6

4. 交易所官方 / 官方授权链路

当用户要求 Level-2、逐笔、订单簿、盘口深度、最准确实时市场数据 时,先明确说明:上交所官方市场数据产品包括 Level-1 与 Level-2,Level-2 包含逐笔、委托、撤单、订单档位等更丰富信息,并通过授权分发链路提供。5

遇到这类需求时,不要假装免费公开源等价于官方链路。应明确指出授权、权限、费用和分发限制。

触发决策

按下面顺序判断任务类型:

  1. 如果用户要 某只股票的基础资料、历史行情、财务三表、停复牌、复权,走“结构化主数据工作流”。
  2. 如果用户要 板块、题材、资金流、龙虎榜、公告、新闻或情绪信息,走“市场扩展信息工作流”。
  3. 如果用户要 分钟级、逐笔、Level-2、盘口、订单簿,先走“高精度实时数据说明工作流”,优先解释权限边界,再决定能否继续抓取。
  4. 如果用户要 为回测、选股、研究报告准备一组可复用字段,走“研究数据集工作流”。
  5. 如果用户明确说“要最准确”,必须主动补充 数据源优先级、字段口径、抓取时间和交叉校验

工作流总览

按以下顺序执行,不要跳步:

  1. 识别数据对象与范围。
  2. 明确时间范围、频率和复权口径。
  3. 为每类字段选择主源与补源。
  4. 先抓结构化核心数据,再抓扩展信息。
  5. 对关键字段做交叉校验。
  6. 输出时强制声明来源、时间和口径。
  7. 若存在冲突或缺失,显式标注“待校验”或“数据不可得”。

第一步:识别对象与范围

先把任务拆成下面四个维度,并在内部明确:

维度 需要确认的内容
标的范围 单只股票、股票列表、板块、指数、全市场
时间范围 最新、当日、近 5 日、近 1 年、指定区间
数据频率 静态资料、日频、分钟频、Tick、Level-2
数据类型 行情、财务、公告、资金流、题材、交易状态、市场统计

如果用户没有说清楚,优先用当前任务上下文推断;实在无法推断时再询问最小必要问题。

第二步:确定字段口径

对行情类请求,必须先在内部确定以下口径:

字段 必须明确的口径
价格 前复权 / 后复权 / 不复权
时间粒度 日线 / 1 分钟 / 5 分钟 / Tick
成交量 股数、手数或接口默认单位
成交额 元、万元、亿元或接口默认单位
涨跌幅 相对昨收还是相对复权基准
财报期间 单季度、累计值、TTM、年报、半年报

如果用户没有指定复权方式,默认优先提供 不复权 + 说明可切换复权口径;若任务用于回测,可额外提供前复权版本。

第三步:选择数据源

遵循下表,不要随意切换主源:

数据类别 默认主源 默认补源 备注
股票基础资料 AKShare 交易所公开页面 / 网页公开源 含代码、上市状态、行业、地域等
交易日历 AKShare 交易所公开日历 / 商业源 用于回测和调度前校验
日线历史行情 AKShare 网页公开源 需要说明复权口径
分钟行情 AKShare 网页公开源 若免费源不稳定,显式标注
Tick / Level-2 官方授权链路 商业供应商 优先解释权限,不要误导
停复牌与复权相关信息 AKShare 交易所公告 / 网页公开源 回测任务务必优先校验
财务三表与财务指标 AKShare 巨潮资讯 / Choice 财报类字段优先用结构化源并交叉核验
板块题材 / 资金流 / 龙虎榜 AKShare 商业源 / 网页补充 多为扩展层,不宜冒充官方口径
公告与资讯 巨潮资讯 / AKShare / 网页公开源 商业资讯源 必须标注抓取时间和来源
市场总貌 / 统计 AKShare 交易所公开页面 适合盘前盘后摘要

第四步:执行抓取

A. 结构化主数据工作流

在用户要股票基础资料、历史行情、财务与交易状态时,按以下顺序执行:

  1. 先抓股票代码与基础资料。
  2. 再抓交易日历,确认区间内是否有交易日。
  3. 再抓行情数据。
  4. 若用于研究或回测,再抓停复牌与复权因子。
  5. 若涉及基本面,再抓财务三表与财务指标。
  6. 最后统一整理字段名与单位。

B. 市场扩展信息工作流

在用户要板块、题材、资金流、龙虎榜、公告、新闻或情绪信息时,按以下顺序执行:

  1. 先抓核心标的或板块清单。
  2. 再抓扩展字段,如资金流、题材归属、龙虎榜、公告标题。
  3. 只把这些内容当作 辅助解释层,不要替代主行情或主财务数据。
  4. 若要给出结论,必须回到核心行情或财务字段做支撑。

C. 高精度实时数据说明工作流

当用户要 Level-2、逐笔、订单簿、盘口深度时,按以下顺序执行:

  1. 先说明此类数据通常依赖交易所官方授权链路或持牌供应商。4
  2. 再说明当前可用来源是否只是近似替代或公开聚合。
  3. 如果无法获得官方授权数据,不要假称“已经拿到最准确数据”。
  4. 若继续提供替代数据,必须写清“替代来源”“限制”“与官方口径可能存在偏差”。

D. 研究数据集工作流

当用户要“帮我准备回测/选股/研究的数据集”时,优先产出结构化表格,并最少包含:

字段组 建议内容
标识字段 ts_code / 股票代码 / 股票名称 / 市场
时间字段 trade_date / report_date / ann_date
行情字段 open / high / low / close / vol / amount
状态字段 是否停牌 / 复权因子 / 上市状态
财务字段 营收、净利润、资产负债率、ROE、经营现金流
扩展字段 板块、题材、资金流、公告摘要
元数据 数据源、抓取时间、字段口径

第五步:执行校验

校验是本技能最重要的部分。至少对下面内容做一致性检查:

校验项 检查方法
股票代码 校验交易所后缀和市场归属
交易日期 校验是否为有效交易日
行情完整性 检查 open / high / low / close / vol 是否缺失
高低价逻辑 high 不得低于 open / close / low
停牌逻辑 停牌日不应给出正常成交量
财报期间 区分单季、累计、TTM 与年报口径
多源一致性 对 close、volume、announcement_date 等关键字段做抽样对比

如果多源数据冲突,按下面规则处理:

  1. 官方或官方授权链路优先于商业源。
  2. 商业源优先于开源聚合源。
  3. 结构化 API 优先于网页抓取。
  4. 无法确认时,保留冲突并明确写出“待校验”。

第六步:统一输出

除非用户明确要求原始 JSON 或 CSV,否则默认使用下面的输出结构。

输出模板

始终尽量采用这个结构:

A股市场数据结果

请求概述

说明抓取对象、时间范围、数据频率与任务目的。

数据来源与口径

用表格列出主源、补源、抓取时间、复权方式、单位说明。

核心数据

给出结构化表格,按任务展示基础资料、行情、财务或扩展字段。

关键校验结果

说明哪些字段已经交叉验证,哪些字段存在冲突或限制。

结论与使用建议

说明这些数据适合拿去做什么,例如研究、回测、盘前观察、财报分析;如果不适合用于自动交易,也要明确说明。

风险与限制

说明权限限制、延迟、非官方口径、字段缺失、网页抓取不稳定等问题。

必备元数据表

无论输出什么内容,都优先补上这张表:

字段 内容
数据对象 股票 / 板块 / 指数 / 全市场
标的代码 如 600519.SH
时间范围 如 2025-01-01 至 2025-12-31
数据频率 日频 / 分钟 / Tick
价格口径 不复权 / 前复权 / 后复权
主数据源 AKShare / 巨潮资讯 / Choice / 官方链路
补充数据源 第二来源或无
抓取时间 实际抓取时间
关键限制 如“非官方逐笔”“分钟线存在延迟”等

输出质量要求

保持克制,不要因为抓到很多字段就制造过度确定性。任何结论都必须区分 事实字段解释性判断

当用户只是要数据,不要自动延伸成荐股意见。只有用户明确要求分析时,才在数据之后补充解释。

示例触发语句

当用户说出类似下面的话时,优先触发本技能:

用户说法 处理方向
帮我抓取 600519 最近 1 年日线和前复权数据 结构化主数据工作流
给我整理宁德时代最新财报三表和关键财务指标 结构化主数据工作流
帮我抓今天 A股热点板块、资金流和龙虎榜 市场扩展信息工作流
我要最准确的 Level-2 和逐笔数据 高精度实时数据说明工作流
给我做一个能回测的 A股研究数据集 研究数据集工作流

不要做的事

不要把以下做法当成合格输出:

错误做法 为什么不行
不标数据源就直接报数字 无法判断可信度
把免费网页聚合数据说成官方权威 容易误导用户
不区分复权与不复权 会污染研究与回测
不区分财报期间口径 会导致财务分析失真
遇到字段冲突仍强行给唯一答案 容易制造伪确定性

何时建议升级数据方案

如果用户出现下面任一需求,主动建议从免费或开源方案升级到商业或官方链路:

需求 建议
高频或准实时稳定抓取 升级商业专业源
Level-2 / 逐笔 / 订单簿 使用官方授权链路或持牌商
大规模机构化研究 评估 Choice 等商业接口
交易执行前的严肃风控校验 使用更高权威级别数据源复核

References

Usage Guidance
This skill appears coherent for A‑share data collection, but before installing/checking it you should: 1) Ask the publisher how commercial/official data credentials (Choice, exchange feeds, 巨潮资讯) are expected to be provided and stored — they are referenced but not declared. 2) Confirm your agent runtime has AKShare and any needed SDKs installed (there is no install spec). 3) Verify whether the agent will access the web directly and whether you consent to scraping third‑party sites (legal/rate‑limit concerns). 4) If you will provide API keys, ensure they are supplied via secure, explicit configuration and that the skill will not persist or exfiltrate them. 5) For Level‑2/逐笔 data, expect costs and licensing; ask the publisher for exact upstream endpoints and credential requirements. If the publisher cannot clarify dependency/credential handling, treat the skill as unready for production use.
Capability Analysis
Type: OpenClaw Skill Name: ashare-market-data-fetcher Version: 1.0.0 The skill bundle is a legitimate framework for fetching A-share market data using standard sources like AKShare and CNINFO. The SKILL.md file provides detailed, professional instructions on data source prioritization and validation workflows without any signs of prompt injection or malicious intent. All other files (scripts/example.py, references/api_reference.md) are harmless placeholders.
Capability Assessment
Purpose & Capability
The name and long SKILL.md consistently describe fetching A股 market data and multi‑source cross‑validation (AKShare, 巨潮资讯, Choice, exchange official feeds). That capability matches the stated purpose. However, the skill repeatedly references commercial/authorized data feeds and an external Python library (AKShare) that are not reflected in declared dependencies or required environment variables.
Instruction Scope
The runtime instructions stay on topic: identify scope, pick sources, fetch structured data, cross‑validate, declare sources and caveats. It explicitly forbids pretending aggregated sources are official and requires provenance. It does permit web scraping and use of multiple external APIs as fallback — which is expected for this task but broad in scope (network I/O, scraping) and should be supervised by the user.
Install Mechanism
There is no install spec (instruction‑only) and only a placeholder script. This minimizes on‑install risk. Note: SKILL.md assumes use of AKShare and possibly other client libraries or commercial SDKs but does not declare them; the runtime environment will therefore need those dependencies available externally.
Credentials
SKILL.md mentions commercial services (Choice), exchange official/authorized feeds, and possibly API‑backed sources (巨潮资讯/cninfo) that normally require API keys or paid access, but requires.env / primary credential fields are empty. The skill gives no guidance on how credentials should be supplied, stored, or protected. This is an inconsistency: credentials are likely needed for full functionality but are not declared or scoped.
Persistence & Privilege
The package does not request always:true, does not require system config paths, and contains no install actions that would persist or modify agent configuration. Autonomous invocation is allowed by default (platform normal) but there is no added persistence privilege.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install ashare-market-data-fetcher
  3. After installation, invoke the skill by name or use /ashare-market-data-fetcher
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of ashare-market-data-fetcher. - Provides workflows and best practices for fetching comprehensive A-share market data, including stock basics, trading calendar, historical prices, financials, trading status, sector/theme, capital flows, announcements, and professional data specifications. - Introduces a multi-layered data source strategy: prioritizing exchange-official, commercial, open-source (AKShare), and public web sources, with clear guidance on when to use each. - Outlines detailed execution workflows for key use cases: structured core data, market extension info, high-precision real-time data, research datasets, and data validation/cross-checking. - Supplies standardized output templates, metadata requirements, quality controls, and explicit risk/limitation disclosures for every data delivery. - Provides actionable advice for when users should upgrade to commercial or official data interfaces for advanced needs.
Metadata
Slug ashare-market-data-fetcher
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is ashare-market-data-fetcher?

抓取并整理 A股市场数据。Use for: 获取 A股股票基础资料、交易日历、日线/分钟线/复权行情、停复牌、财务三表、财务指标、板块题材、资金流、公告与专业市场数据说明;当用户要求尽可能全面、详细、准确地获取 A股市场数据时使用。 It is an AI Agent Skill for Claude Code / OpenClaw, with 68 downloads so far.

How do I install ashare-market-data-fetcher?

Run "/install ashare-market-data-fetcher" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is ashare-market-data-fetcher free?

Yes, ashare-market-data-fetcher is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does ashare-market-data-fetcher support?

ashare-market-data-fetcher is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created ashare-market-data-fetcher?

It is built and maintained by AlanWu2024 (@alanwu2024); the current version is v1.0.0.

💬 Comments