Xpersona
A

Akshare

CLAWHUB · Unverified

Fetch Chinese stock market data (A-shares, Hong Kong stocks, futures, funds, macroeconomic indicators) using AKShare library. Use when you need to get real-t... Skill: Akshare Owner: learner1999 Summary: Fetch Chinese stock market data (A-shares, Hong Kong stocks, futures, funds, macroeconomic indicators) using AKShare library. Use when you need to get real-t... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-02-19T14:22:19.248Z | auto - Initial release of the akshare skill. - Fetch Chinese stock market, fund, futures, and macroeconomic data using the AKShare Python librar

62
Rank
84
Safety
3.1k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 3.1K downloads reported by the source. Last updated 10/9/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s176x9ngsgs1vb2e0784fxq8dx8849h0:akshare
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-learner1999-akshare/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

8,639 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: akshare
description: Fetch Chinese stock market data (A-shares, Hong Kong stocks, futures, funds, macroeconomic indicators) using AKShare library. Use when you need to get real-time or historical financial data from Chinese markets, including stock prices, trading volumes, financial statements, fund data, futures data, or macroeconomic statistics. Supports daily/weekly/monthly K-line data, stock fundamentals, market indices, and more. No API key required - completely free.
---

# AKShare - Chinese Financial Data

AKShare is a free, open-source Python library for accessing Chinese financial market data.

## Quick Start

```python
import akshare as ak

# Get A-share real-time quotes
stock_spot = ak.stock_zh_a_spot_em()

# Get historical K-line data (with forward adjustment)
df = ak.stock_zh_a_hist(symbol="000001", period="daily", 
                        start_date="20200101", end_date="20231231", 
                        adjust="qfq")
```

## Core Functions

### Stock Data

**Real-time quotes:**
```python
# All A-shares
ak.stock_zh_a_spot_em()

# Individual stock info
ak.stock_individual_info_em(symbol="000001")
```

**Historical data:**
```python
# Daily K-line (symbol without exchange prefix)
ak.stock_zh_a_hist(
    symbol="000001",      # Stock code
    period="daily",       # daily/weekly/monthly
    start_date="20200101",
    end_date="20231231",
    adjust="qfq"         # qfq=forward, hfq=backward, ""=none
)
```

**Index data:**
```python
# Shanghai Composite
ak.stock_zh_index_daily(symbol="sh000001")

# Shenzhen Component
ak.stock_zh_index_daily(symbol="sz399001")
```

### Fund Data

```python
# Fund rankings
ak.fund_open_fund_rank_em(symbol="全部")

# Fund net value history
ak.fund_open_fund_info_em(fund="000001", indicator="单位净值走势")

# ETF real-time quotes
ak.fund_etf_spot_em()
```

### Futures Data

```python
# Futures real-time quotes
ak.futures_zh_spot(symbol="主力合约")

# Futures historical data
ak.futures_zh_daily_sina(symbol="CU0", start_date="20230101", end_date="20231231")
```

### Macroeconomic Data

```python
# GDP
ak.macro_china_gdp()

# CPI
ak.macro_china_cpi()

# PMI
ak.macro_china_pmi()

# Money supply
ak.macro_china_money_supply()
```

## Important Notes

### Rate Limiting
- AKShare scrapes public websites - add delays between requests
- Recommended: `time.sleep(1)` between calls
- Batch downloads may trigger rate limits

### Data Quality
- Free data may have occasional gaps or errors
- For production use, consider Tushare Pro (paid)
- Always validate critical data

### Stock Code Format
- Use 6-digit code without exchange prefix: `"000001"` not `"sz000001"`
- Index codes need prefix: `"sh000001"`, `"sz399001"`

## Common Patterns

**Get multiple stocks:**
```python
import time

stocks = ["000001", "600519", "000858"]
data = {}

for code in stocks:
    data[code] = ak.stock_zh_a_hist(symbol=code, period="daily", adjust="qfq")
    time.sleep(1)  # Avoid rate limiting
```

**Calculate returns:**
```python
df = ak.stock_z

_meta.json

{
  "ownerId": "kn75bgq44z2zty8c3zmqcg3vhn80avsd",
  "slug": "akshare",
  "version": "1.0.0",
  "publishedAt": 1771510939248
}

references/api_reference.md

# AKShare API Reference

Quick reference for commonly used AKShare functions.

## Stock Data

### Real-time Quotes

```python
# All A-shares real-time
ak.stock_zh_a_spot_em()
# Returns: DataFrame with columns [代码, 名称, 最新价, 涨跌幅, 涨跌额, 成交量, 成交额, ...]

# Individual stock info
ak.stock_individual_info_em(symbol="000001")
# Returns: DataFrame with stock basic information
```

### Historical K-line

```python
ak.stock_zh_a_hist(
    symbol="000001",           # Stock code (6 digits)
    period="daily",            # "daily", "weekly", "monthly"
    start_date="20200101",     # YYYYMMDD format
    end_date="20231231",       # YYYYMMDD format
    adjust="qfq"               # "qfq"=forward, "hfq"=backward, ""=none
)
# Returns: DataFrame with columns [日期, 开盘, 收盘, 最高, 最低, 成交量, 成交额, 振幅, 涨跌幅, 涨跌额, 换手率]
```

### Index Data

```python
# Shanghai Composite Index
ak.stock_zh_index_daily(symbol="sh000001")

# Shenzhen Component Index
ak.stock_zh_index_daily(symbol="sz399001")

# ChiNext Index
ak.stock_zh_index_daily(symbol="sz399006")

# Returns: DataFrame with columns [date, open, high, low, close, volume]
```

## Fund Data

### Fund Rankings

```python
ak.fund_open_fund_rank_em(symbol="全部")
# symbol options: "全部", "股票型", "混合型", "债券型", "指数型", "QDII", "FOF"
# Returns: DataFrame with fund rankings and performance
```

### Fund Net Value

```python
ak.fund_open_fund_info_em(fund="000001", indicator="单位净值走势")
# indicator options: "单位净值走势", "累计净值走势", "累计收益率走势", "同类排名走势", "同类排名百分比走势"
# Returns: DataFrame with historical net values
```

### ETF Data

```python
ak.fund_etf_spot_em()
# Returns: DataFrame with ETF real-time quotes
```

## Futures Data

### Futures Quotes

```python
ak.futures_zh_spot(symbol="主力合约")
# symbol options: "主力合约", "中金所", "上期所", "大商所", "郑商所"
# Returns: DataFrame with futures real-time quotes
```

### Futures Historical

```python
ak.futures_zh_daily_sina(symbol="CU0", start_date="20230101", end_date="20231231")
# symbol: Futures code (e.g., "CU0" for copper main contract)
# Returns: DataFrame with columns [date, open, high, low, close, volume, hold]
```

## Macroeconomic Data

### GDP

```python
ak.macro_china_gdp()
# Returns: DataFrame with quarterly GDP data
```

### CPI

```python
ak.macro_china_cpi()
# Returns: DataFrame with monthly CPI data
```

### PMI

```python
ak.macro_china_pmi()
# Returns: DataFrame with monthly manufacturing PMI
```

### Money Supply

```python
ak.macro_china_money_supply()
# Returns: DataFrame with M0, M1, M2 data
```

### Foreign Exchange Reserves

```python
ak.macro_china_fx_reserves()
# Returns: DataFrame with monthly FX reserves
```

### Interest Rates

```python
ak.macro_china_shibor()
# Returns: DataFrame with Shibor rates
```

## US Market Data

### US Stocks

```python
ak.stock_us_daily(symbol="AAPL", adjust="qfq")
# Returns: DataFrame with US stock historical data
```

### US GDP

```python
ak.macro_usa_gdp()
# Returns: DataFrame with US GDP data
```

## Common Data Columns

### Stock Historical Data (stock_zh

Sponsored

Ads related to Akshare and adjacent AI workflows.