| name | akshare-data |
| description | Query Chinese and global financial data using the AKShare Python library. Use when asked to (1) fetch stock quotes, historical prices, or financial statements for A-shares/HK/US stocks, (2) query macroeconomic data like GDP/CPI/PMI, (3) get futures/options/bond/forex/fund data, (4) look up index data, or (5) retrieve alternative data like news sentiment. Covers 500+ data interfaces for stocks, futures, options, bonds, forex, funds, macro, indexes and alternative data. |
AKShare 财经数据查询
基于 AKShare 的财经数据查询 skill,覆盖股票、期货、期权、债券、外汇、基金、宏观经济、指数、另类数据等 500+ 个数据接口。
快速使用
使用通用查询脚本 scripts/akshare_query.py 查询数据:
python3 scripts/akshare_query.py <函数名> [参数=值] ... [--save output.csv] [--head N]
示例:
python3 scripts/akshare_query.py stock_zh_a_hist symbol=000001 period=daily start_date=20240101 end_date=20241231 adjust=qfq
python3 scripts/akshare_query.py stock_zh_a_spot_em --head 20
python3 scripts/akshare_query.py macro_china_cpi --save cpi.csv
数据类别路由
根据用户查询需求,加载对应的 reference 文件获取具体接口信息:
通用注意事项
- 安装:脚本自动安装 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