akshare-data

AKShare CLI wrapper and API reference documentation. Use this skill to access Chinese financial market data via command line (stocks, futures, funds, bonds, forex, macro indicators) or browse comprehensive API documentation with parameter tables, output schemas, and code examples for all supported data categories.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "akshare-data" with this command: npx skills add ppsteven/skills/ppsteven-skills-akshare-data

AKShare Data API Reference

AKShare is a Python package providing access to Chinese financial market data. This skill contains complete API documentation organized by asset class and data category.

Quick Start

AKShare can be used via CLI wrapper or Python library.

CLI (Recommended)

# Get stock data (JSON output is default)
python3 scripts/akshare_cli.py stock_zh_a_hist --symbol 000001 --start_date 20200101 --end_date 20210101

# Get as JSON explicitly
python3 scripts/akshare_cli.py stock_zh_a_hist --symbol 000001 --start_date 20200101 --end_date 20210101 --format json

# Export to CSV when needed for complex analysis
python3 scripts/akshare_cli.py stock_zh_a_hist --symbol 000001 --start_date 20200101 --end_date 20210101 --format csv > stock_data.csv

Python Library (Legacy)

import akshare as ak

stock_df = ak.stock_zh_a_hist(symbol="000001", start_date="20200101", end_date="20210101")
print(stock_df)

Data Categories

All APIs below are available via CLI wrapper. See individual API docs for both CLI and Python usage:

Equities & Indices

  • Stock Data - A/B shares, history, daily snapshots, sector data, board listings
  • Index Data - Stock indices, index components, performance data

Fixed Income & Rates

  • Bonds - Government bonds, corporate bonds, municipal bonds
  • Interest Rates - LPR rates, deposit/loan rates, yield curves

Derivatives & Futures

  • Futures - Futures contracts, open interest, delivery data
  • Options - Options contracts, Greeks, implied volatility

Alternative Assets

  • Funds - Public funds (mutual funds), private funds (hedge funds), fund ratings
  • QDII - Qualified Domestic Institutional Investor products
  • Commodities & Spot Trading - Commodity futures, spot market data

Forex & International

Macro & Economics

Specialized Data

API Documentation Structure

Each reference file contains:

  • API name - The function name (e.g., stock_zh_a_hist)
  • Target URL - Data source web address
  • Description - What the API provides
  • Rate limits - Data return limits per request
  • Input parameters - Function parameters with types and descriptions
  • Output parameters - DataFrame columns returned by the API
  • Code example - Working Python example
  • Data sample - Sample output rows

Parameter Conventions

Common parameter patterns across AKShare APIs:

  • symbol - Stock symbol (e.g., "000001" for SZZF)
  • start_date / end_date - Date strings in format "YYYYMMDD" (e.g., "20200101")
  • period - Time period ("daily", "weekly", "monthly")
  • page / limit - Pagination parameters for large datasets
  • Date output - Most APIs return datetime columns in format "YYYY-MM-DD HH:MM:SS"

Multi-Part Categories

Some data categories have multiple sub-APIs:

Finding What You Need

By asset class: Start with the category above that matches your market focus

By function: If you know the AKShare function name, search within the corresponding reference file using grep patterns:

  • Stock functions: stock_
  • Fund functions: fund_
  • Futures functions: futures_ or future_
  • Forex functions: fx_ or exchange_

By data type: All APIs include parameter tables and examples. Look for "Input parameters" and "Output parameters" sections.

Example Usage Patterns

Get historical stock data:

See references/stock.md - use stock_zh_a_hist() function

Access futures data:

See references/futures.md - functions like futures_open_interest(), futures_delivery()

Query fund performance:

See references/fund/fund_public.md for mutual funds or references/fund/fund_private.md for private funds

Macroeconomic indicators:

See references/macro.md - GDP, inflation, industrial production

Hong Kong/Singapore market data:

See references/qhkc/ subdirectory for index data, fundamentals, and analysis tools

CLI Usage Guide

All AKShare functions are available via the CLI wrapper in scripts/akshare_cli.py.

Output Formats

  • --format json: JSON format for API integration (default)
  • --format pretty: Human-readable tables
  • --format csv: CSV format for import into Excel/databases (use when complex analysis is needed)

Examples by Category

# Stock data
python3 scripts/akshare_cli.py stock_zh_a_hist --symbol 000001 --start_date 20240101 --end_date 20240110

# Index data
python3 scripts/akshare_cli.py index_zh_a_hist --symbol 000001 --start_date 20240101 --end_date 20240110

# Macro data
python3 scripts/akshare_cli.py macro_china_gdp --format json

# Bank data
python3 scripts/akshare_cli.py bank_fjcf_table_detail --page 1 --item "分局本级"

# Export to file
python3 scripts/akshare_cli.py stock_zh_a_hist --symbol 000001 --start_date 20240101 --end_date 20240110 --format csv > output.csv

See CLI_DESIGN.md for complete CLI documentation.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

akshare-data

No summary provided by upstream source.

Repository SourceNeeds Review
General

trade-skills

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

Self Updater

⭐ OPEN SOURCE! GitHub: github.com/GhostDragon124/openclaw-self-updater ⭐ ONLY skill with Cron-aware + Idle detection! Auto-updates OpenClaw core & skills, an...

Registry SourceRecently Updated
1171Profile unavailable
Coding

ClawHub CLI Assistant

Use the ClawHub CLI to publish, inspect, version, update, sync, and troubleshoot OpenClaw skills from the terminal.

Registry SourceRecently Updated
1.9K2Profile unavailable