About akshare-data
akshare-data is a finance-data query skill built on AKShare for users who need market and macroeconomic data. It calls more than 500 interfaces through a script and organizes reference material by data category.
Key features
- 01Covers stocks, futures, options, and more
- 02Provides over 500 data interfaces
- 03Routes references by data category
- 04Exports query results to CSV
Use cases
- 01Query historical or live A-share prices
- 02Retrieve macroeconomic indicators
- 03Save query results as CSV
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ gusibi/ skills --skill akshare-dataAfter installing, type/akshare-datain Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
README.mdreferences/alternative.mdbond.mdforex.mdfund.mdfutures.mdindex_data.mdmacro.mdoptions.mdstock.mdscripts/akshare_query.pyDetails
From the project READMEAKShare 财经数据查询
基于 AKShare 的财经数据查询 skill,覆盖股票、期货、期权、债券、外汇、基金、宏观经济、指数、另类数据等 500+ 个数据接口。
快速使用
使用通用查询脚本 scripts/akshare_query.py 查询数据:
python3 scripts/akshare_query.py <函数名> [参数=值] ... [--save output.csv] [--head N]
示例:
# A股历史行情(前复权)
python3 scripts/akshare_query.py stock_zh_a_hist symbol=000001 period=daily start_date=20240101 end_date=20241231 adjust=qfq
# A股实时行情(前20条)
python3 scripts/akshare_query.py stock_zh_a_spot_em --head 20
# 中国CPI数据并保存
python3 scripts/akshare_query.py macro_china_cpi --save cpi.csv
数据类别路由
根据用户查询需求,加载对应的 reference 文件获取具体接口信息:
| 用户需求关键词 | 加载文件 |
|---|---|
| 股票行情、财报、资金流向、板块、龙虎榜、沪深港通、A股、港股、美股 | references/stock.md |
| 期货行情、持仓排名、仓单、交割、内盘、外盘 | references/futures.md |
| 期权、希腊字母、隐含波动率 | references/options.md |
| 债券、可转债、国债、企业债、债券回购 | references/bond.md |
| 汇率、外汇、货币 | references/forex.md |
| 基金、ETF、LOF、基金排名、净值 | references/fund.md |
| GDP、CPI、PMI、利率、宏观经济、失业率 | references/macro.md |
| 股票指数、大盘指数、行业指数、中证指数 | references/index_data.md |
| 新闻舆情、百度指数、空气质量、电影票房 | references/alternative.md |
通用注意事项
- 安装:脚本自动安装 akshare(首次运行时
pip install akshare) - 数据格式:所有接口返回 pandas DataFrame,可用
--save导出 CSV - 日期格式:日期参数统一使用
YYYYMMDD格式(如20240101) - 股票代码:A股使用6位数字代码(如
000001),港股使用5位代码(如00700),美股使用字母代码(如AAPL) - 复权方式:
adjust=""不复权,adjust="qfq"前复权,adjust="hfq"后复权 - 频率:
period参数支持daily(日)、weekly(周)、monthly(月) - 限流:部分接口有频率限制,若报错可稍后重试
- API 文档:完整接口文档见 https://akshare.akfamily.xyz/data/index.html
Comments
Markdown supported