본문으로 건너뛰기
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(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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 / 1,000자

이 양식은 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/Octop1만2026년 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/Octop1만2026년 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/Octop1만2026년 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/Octop1만2026년 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/Octop1만2026년 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/Octop1만2026년 10월 18일 업데이트

TencentCloud의 스킬 모두 보기

이 스킬의 문제 신고