跳到正文
cccskills
免费在 GitHub 公开

akshare-data

Retrieve financial data for Chinese markets and selected global markets using akshare-cli. Find stock prices, fund values, exchange rates, economic indicators, and financial news, then extract recent records or save results in common file formats.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

使用 akshare-cli 获取中国及全球金融市场数据(1090+ 个函数)。覆盖股票、基金、期货、债券、外汇、宏观经济、指数、期权、新闻等全领域。

当用户需要以下任何一种数据时触发此 skill:股票行情、历史K线、实时报价、涨停跌停池、龙虎榜、板块资金流向、基金/ETF净值、期货行情、债券/可转债、外汇汇率、宏观经济指标(GDP/CPI/PMI)、指数数据、期权数据、财经新闻。

关键词触发:akshare、股票、行情、K线、基金、期货、外汇、宏观、国债、可转债、涨停、龙虎榜、板块、资金流向、stock data、market data、financial data、A股、港股、美股。即使用户只是随口提到"看看某个股票"或"最近市场怎么样",也应触发。

查看安装方法

适用场景

  • Retrieve historical prices for Chinese, Hong Kong, or US stocks
  • Check fund and ETF net asset values
  • Look up exchange rates and economic indicators
  • Save retrieved market data as CSV or JSON

包含的文件(3)

  • SKILL.md6.5 KB
  • references/examples.md1.9 KB
  • references/known-issues.md1.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

AKShare 金融数据获取

akshare-cli 封装了 AKShare(1090+ 个函数),覆盖中国几乎所有金融数据及部分全球数据。

核心原则

  1. 轻量优先 — 查单只股票用 stock_individual_info_em(0.1s),不要用 stock_zh_a_spot_em(59s)。详见 references/known-issues.md。
  2. 先查后调 — 不熟悉的函数先 --full-help 看参数,再 call。
  3. 失败必降级 — 不要在第一次失败后就告诉用户"查不到",走完三级降级。
  4. 控制输出量 — 全量接口加 --limit N --sort desc,确保拿到最新数据而非最旧数据。

工作流程:发现 → 查看 → 调用 → 降级

严格按以下步骤顺序执行,不要跳步。

第一步:发现函数

三种方式,按场景选一种:

A. 快捷命令(常用场景直接用,不需要搜索):

akshare-cli stock hist <代码> [--period daily|weekly|monthly] [--adjust qfq|hfq]
akshare-cli stock spot [--market all|sh|sz|bj|hk|us]
akshare-cli fund etf [代码]
akshare-cli futures hist <合约>
akshare-cli bond convertible
akshare-cli macro gdp | macro cpi
akshare-cli forex spot | forex hist [货币对]
akshare-cli index spot [--market global|cn]

B. 关键词搜索(知道大致方向时用):

akshare-cli search <关键词>    # 支持中英文

英文匹配函数名(结果更全),中文匹配描述和分类路径。

用户意图英文关键词(推荐)中文关键词
新闻news新闻
股票stock股票
涨停/跌停stock_zt涨停
龙虎榜stock_lhb龙虎榜
板块/概念stock_board板块
资金流向fund_flow资金流向
基金/ETFfund基金
期货futures期货
债券bond债券
外汇forex外汇
宏观macro宏观
指数index指数

C. 按分类浏览(不确定关键词时用,按中文目录逐级查找):

akshare-cli browse                                # 30 个顶级分类
akshare-cli browse 股票数据/A股/历史行情数据          # 逐级深入
akshare-cli browse --func stock_zh_a_hist         # 反查函数归属

第二步:查看参数(用快捷命令时可跳过)

akshare-cli call --full-help <函数名>
akshare-cli call --full-help fn1,fn2,fn3       # 批量查询

输出包括:说明、数据源、目标地址、参数(含可选值枚举)、用法示例。

仔细看参数:不同函数参数名不同(symbol/code/indicator),有些有枚举约束,日期一般是 YYYYMMDD。

第三步:调用

akshare-cli call <函数名> [--参数 值 ...] [--json] [--limit N] [--sort desc]

查最新数据时加 --sort desc --limit N,否则 --limit 会截取最旧的数据。

第四步:失败时三级降级

AKShare 底层爬取第三方网站,上游随时可能挂。失败后必须依次尝试:

第一级:换数据源后缀 _em(东方财富)失败 → 搜索 _ths(同花顺)或 _sina(新浪)同类函数:

akshare-cli search <相似关键词>

第二级:browser_use 打开目标地址抓取网页数据 --full-help 输出中有「目标地址」字段,这就是数据来源的网页 URL。用 browser_use 工具打开这个 URL,直接从网页上提取数据:

# 先获取目标地址
akshare-cli call --full-help stock_zh_a_hist
# 输出中会显示: 目标地址: https://quote.eastmoney.com/concept/sh603777.html
# 然后用 browser_use 打开该 URL,从页面中提取所需数据

第三级:WebSearch 兜底 用搜索引擎查数据:

# WebSearch "贵州茅台 财务数据 site:eastmoney.com"

触发条件:非零退出码、空数据(0 行)、网络错误。


股票代码识别

格式含义处理
6 位数字A 股直接用
5 位数字港股直接用
字母开头美股直接用
sh/sz 前缀去前缀sh600519 → 600519
股票名称查代码stock_info_sh_name_code / stock_info_sz_name_code

输出选项

选项效果
--jsonJSON 格式(推荐)
--csvCSV 格式
--output FILE保存文件(.csv/.json/.xlsx/.md)
--limit N限制行数
--sort desc|asc排序:desc 最新在前(默认),asc 最旧在前
--no-cache跳过缓存

获取最新数据的关键: 很多历史数据接口默认返回从最早开始的数据。如果你只取 --limit 10 而不加 --sort desc,拿到的是最旧的 10 条而不是最新的。查最新数据时务必加 --sort desc:

akshare-cli call stock_zh_a_hist --symbol 000001 --json --limit 10 --sort desc   # 最近 10 天

默认缓存 30 分钟(宏观 24 小时),实时行情不缓存。


注意事项

  • 已知损坏接口:调用前先查 references/known-issues.md,命中直接用替代方案
  • 盘中 vs 盘后:非交易时段优先用历史接口(stock_zh_a_hist),更快更稳定
  • 日期自动填充:未指定 date 参数时 CLI 自动填充当天日期
  • 名称查代码:用 stock_info_sh_name_code / stock_info_sz_name_code,禁止用全量 spot 遍历

更多工作流示例见 references/examples.md

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Review a design or web page against WCAG 2.1 AA, an accessibility standard. Organize findings on contrast, keyboard access, forms, and screen reader behavior, with severity levels and practical recommendations for fixes.

中文简介正在准备中。当前显示英语简介。

  • Review accessibility before design handoff
  • Check text and interface color contrast
  • Review keyboard navigation and focus behavior
TencentCloud/Octop99462026年10月18日 更新

Compare technology options, review a system design, or plan a new component from requirements and constraints. The skill organizes the reasoning into an architecture decision record, a document covering alternatives, trade-offs, consequences, and next steps.

中文简介正在准备中。当前显示英语简介。

  • Compare technologies before choosing one
  • Document the reasoning behind a design decision
  • Review a proposed system design
TencentCloud/Octop99462026年10月18日 更新

Turn existing or proposed business processes into reusable standard operating procedures. Organize steps, roles, conditions, and known exceptions while marking missing details, producing clear handover documents without inventing approvals or responsibilities.

中文简介正在准备中。当前显示英语简介。

  • Turning workflow notes into a standard operating procedure
  • Preparing process documentation for a handover
  • Clarifying assignment, execution, and review responsibilities
TencentCloud/Octop99462026年10月18日 更新

Analyze waiting, rework, and handoff waste in business processes using the facts provided. It proposes concrete improvements and, when verification is needed, defines measurement formulas and the minimum records required to assess specific issues.

中文简介正在准备中。当前显示英语简介。

  • Reviewing waiting and rework in an existing workflow
  • Requesting a fixed number of concrete improvement suggestions
  • Defining records to distinguish processing time from waiting
TencentCloud/Octop99462026年10月18日 更新

Assess operational risks in processes, projects, or suppliers using provided evidence. Separate observed facts from possible consequences, propose practical responses, and prepare concise summaries or risk registers without treating unknown controls as confirmed gaps.

中文简介正在准备中。当前显示英语简介。

  • Assess risks in business processes
  • Review operational risks in projects or suppliers
  • Prepare a risk register
TencentCloud/Octop99462026年10月18日 更新

Write reusable operating procedures for recurring business tasks and handovers. Organize prerequisites, roles, steps, success checks, and exception handling, while clearly separating approved recovery actions from decisions that still need confirmation.

中文简介正在准备中。当前显示英语简介。

  • Document a recurring business task
  • Prepare instructions for a handover
  • Clarify success checks and delivery points
TencentCloud/Octop99462026年10月18日 更新

查看 TencentCloud 的全部技能

报告此技能的问题