mcpField
A
akshare

akshare

github.com/succ985Data & databases111.8k installsUpdated 38w ago
Repository

About akshare

A skill that guides use of AkShare, an open-source Python library for retrieving Chinese financial market data. It covers stocks, futures, funds, and macroeconomic indicators across Chinese and other listed markets.

Key features

  1. 01Real-time and historical stock data
  2. 02A-share, Hong Kong, and US quotes
  3. 03Futures data retrieval
  4. 04Fund data and NAV history
  5. 05GDP, CPI, and PMI indicators

Use cases

  1. 01Checking current stock quotes
  2. 02Retrieving historical market prices
  3. 03Gathering macroeconomic time series

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/succ985/openclaw-akshare-skill --skill akshare

After installing, type/aksharein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

CHANGELOG.md
.gitignore
LICENSE
CONTRIBUTING.md
README.md
references/
common_functions.md
akshare_api.md
scripts/
IMPLEMENTATION_SUMMARY.md
README.md
VERIFICATION_REPORT.md
example_usage.py
akshare_tool.py
test_basic.py
test_quick.py
install_akshare.sh

Details

From the project README

AkShare - Chinese Financial Data

Overview

AkShare is a free, open-source Python library for accessing Chinese financial market data. This skill provides guidance for fetching data from Chinese exchanges including Shanghai Stock Exchange, Shenzhen Stock Exchange, Hong Kong Exchange, and more.

Quick Start

Install AkShare:

pip install akshare

Basic stock quote:

import akshare as ak
df = ak.stock_zh_a_spot_em()  # Real-time A-share data

Stock Data

A-Shares (A股)

Real-time quotes:

# All A-shares real-time data
df = ak.stock_zh_a_spot_em()

# Single stock real-time quote
df = ak.stock_zh_a_spot()

Historical data:

# Historical daily data
df = ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20240101", end_date="20241231", adjust="qfq")

Stock list:

# Get all A-share stock list
df = ak.stock_info_a_code_name()
Hong Kong Stocks (港股)

Real-time quotes:

df = ak.stock_hk_spot_em()

Historical data:

df = ak.stock_hk_hist(symbol="00700", period="daily", adjust="qfq")
US Stocks (美股)

Real-time data:

df = ak.stock_us_spot_em()

Futures Data (期货)

Real-time futures:

# Commodity futures
df = ak.futures_zh_spot()

Historical futures:

df = ak.futures_zh_hist_sina(symbol="IF0")

Fund Data (基金)

Fund list:

df = ak.fund_open_fund_info_em()

Fund historical data:

df = ak.fund_open_fund_info_em(fund="000001", indicator="单位净值走势")

Macroeconomic Indicators (宏观)

GDP data:

df = ak.macro_china_gdp()

CPI data:

df = ak.macro_china_cpi()

PMI data:

df = ak.macro_china_pmi()

Common Parameters

Period (周期):

  • daily - 日线
  • weekly - 周线
  • monthly - 月线

Adjustment (复权):

  • qfq - 前复权
  • hfq - 后复权
  • "" - 不复权

Tips

  1. Data caching: AkShare doesn't cache data, implement your own caching if needed
  2. Rate limiting: Be mindful of request frequency to avoid being blocked
  3. Data format: Returns pandas DataFrame, can be easily processed
  4. Error handling: Network errors may occur, implement retry logic

References

For complete API documentation and advanced usage, see:

Comments

Markdown supported