mcpField
A
akshare-data

akshare-data

github.com/gusibiData & databases1132 installsUpdated 30w ago
Repository

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

  1. 01Covers stocks, futures, options, and more
  2. 02Provides over 500 data interfaces
  3. 03Routes references by data category
  4. 04Exports query results to CSV

Use cases

  1. 01Query historical or live A-share prices
  2. 02Retrieve macroeconomic indicators
  3. 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-data

After installing, type/akshare-datain Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

README.md
references/
alternative.md
bond.md
forex.md
fund.md
futures.md
index_data.md
macro.md
options.md
stock.md
scripts/
akshare_query.py

Details

From the project README

AKShare 财经数据查询

基于 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

通用注意事项

  1. 安装:脚本自动安装 akshare(首次运行时 pip install akshare)
  2. 数据格式:所有接口返回 pandas DataFrame,可用 --save 导出 CSV
  3. 日期格式:日期参数统一使用 YYYYMMDD 格式(如 20240101)
  4. 股票代码:A股使用6位数字代码(如 000001),港股使用5位代码(如 00700),美股使用字母代码(如 AAPL)
  5. 复权方式:adjust="" 不复权,adjust="qfq" 前复权,adjust="hfq" 后复权
  6. 频率:period 参数支持 daily(日)、weekly(周)、monthly(月)
  7. 限流:部分接口有频率限制,若报错可稍后重试
  8. API 文档:完整接口文档见 https://akshare.akfamily.xyz/data/index.html

Comments

Markdown supported