Skip to main content
skill CX Codex

akshare — Claude Code skill: what it does, how to install

This skill lets an AI coding agent query AkShare for financial data. Use it for market quotes, trading history, funds, futures, and Chinese macro indicators.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add succ985/openclaw-akshare-skill --skill akshare -a claude-code
Open on GitHub

What akshare does

The skill guides Python calls to AkShare for live and historical data on A-shares, Hong Kong stocks, US stocks, futures, funds, and Chinese macroeconomic indicators. It covers stock lists, quotes, daily history, and GDP, CPI, or PMI series. Returned data is available as a pandas DataFrame.

The included examples use daily, weekly, and monthly periods, with qfq, hfq, or no price adjustment. Install the dependency first with pip install akshare. AkShare does not cache responses, so a project that needs caching must add it separately; frequent requests also need care because network access can be blocked.

What it helps with

  • fetch live A-share quotes
  • load historical stock prices
  • inspect futures and fund data
  • compile GDP, CPI, and PMI series
  • retrieve an A-share code list

Example prompts for the agent

  • Fetch the current A-share quotes with AkShare and return them as a table.
  • Load daily history for stock 000001 from 20240101 through 20241231 using qfq adjustment.
  • Create separate tables for China GDP, CPI, and PMI data.

How to install akshare

1Skills CLI (Vercel)

npx skills add succ985/openclaw-akshare-skill --skill akshare -a claude-code

2Manually: put the files in place

~/.claude/skills/akshare/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/akshare/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about akshare

How do I install akshare in Claude Code?

Run npx skills add succ985/openclaw-akshare-skill --skill akshare -a claude-code. The skill file will be placed at ~/.claude/skills/akshare/SKILL.md.

What does the akshare skill do?

It helps an agent use AkShare to retrieve current and historical data for stocks, futures, funds, and macroeconomic indicators. The results can be handled as pandas DataFrames.

What does akshare require before use?

Install the Python package with pip install akshare. Add project-level caching separately, since AkShare does not provide it.

Source text

SKILL.md · MIT
---
name: akshare
description: Chinese financial data access using AkShare library. Fetch real-time and historical data for A-shares, Hong Kong stocks, US stocks, futures, funds, and macroeconomic indicators. Use when user requests Chinese market data, stock prices, market analysis, or financial information from Chinese exchanges. Supports stock quotes, historical data, futures market data, fund information, macroeconomic indicators, and real-time market updates.
---

# 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:
```bash
pip install akshare
```

Basic stock quote:
```python
import akshare as ak
df = ak.stock_zh_a_spot_em()  # Real-time A-share data
```

## Stock Data

### A-Shares (A股)

**Real-time quotes:**
```python
# 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:**
```python
# Historical daily data
df = ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20240101", end_date="20241231", adjust="qfq")
```

**Stock list:**
```python
# Get all A-share stock list
df = ak.stock_info_a_code_name()
```

### Hong Kong Stocks (港股)

**Real-time quotes:**
```python
df = ak.stock_hk_spot_em()
```

**Historical data:**
```python
df = ak.stock_hk_hist(symbol="00700", period="daily", adjust="qfq")
```

### US Stocks (美股)

**Real-time data:**
```python
df = ak.stock_us_spot_em()
```

## Futures Data (期货)

**Real-time futures:**
```python
# Commodity futures
df = ak.futures_zh_spot()
```

**Historical futures:**
```python
df = ak.futures_zh_hist_sina(symbol="IF0")
```

## Fund Data (基金)

**Fund list:**
```python
df = ak.fund_open_fund_info_em()
```

**Fund historical data:**
```python
df = ak.fund_open_fund_info_em(fund="000001", indicator="单位净值走势")
```

## Macroeconomic Indicators (宏观)

**GDP data:**
```python
df = ak.macro_china_gdp()
```

**CPI data:**
```python
df = ak.macro_china_cpi()
```

**PMI data:**
```python
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:
- [references/akshare_api.md](references/akshare_api.md) - Detailed API reference
- [references/common_functions.md](references/common_functions.md) - Commonly used functions
- [https://akshare.akfamily.xyz/](https://akshare.akfamily.xyz/) - Official documentation

© succ985 · MIT · succ985/openclaw-akshare-skill

Similar skills

All skills for Finance and business →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor