akshare-skill

AKShare Data API Reference

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-skill" with this command: npx skills add ppsteven/trade-skills/ppsteven-trade-skills-akshare-skill

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

  • Foreign Exchange (FX) - Currency pairs, exchange rates

  • Hong Kong/Singapore Data (QHKC) - Hong Kong stocks, Singapore data, commodity analysis

Macro & Economics

  • Macroeconomic Data - GDP, CPI, industrial production, consumer spending

  • Currency & FX Markets - Currency data, forex indicators

  • Energy Data - Oil, coal, natural gas prices and data

  • Interest Rates - Central bank rates, yield curves

Specialized Data

  • Bank Data - Bank regulatory data, administrative penalties

  • Data Center (DC) - Data center services and infrastructure

  • Digital Currency - Cryptocurrency and digital asset data

  • Events & News - Market events, corporate actions, news events

  • Natural Language Processing - Text analysis, sentiment analysis

  • Technical Indicators & Tools - Technical analysis tools, indicators

  • Financial Articles - Financial research articles and reports

  • Others - Additional specialized data sources

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:

  • Funds (references/fund/) - Public funds vs. private funds documentation

  • QHKC (references/qhkc/) - Hong Kong stocks, fundamentals, brokers, commodities, analysis tools

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

trade-skills

No summary provided by upstream source.

Repository SourceNeeds Review
General

akshare-data

No summary provided by upstream source.

Repository SourceNeeds Review
General

ll-feishu-audio

飞书语音交互技能。支持语音消息自动识别、AI 处理、语音回复全流程。需要配置 FEISHU_APP_ID 和 FEISHU_APP_SECRET 环境变量。使用 faster-whisper 进行语音识别,Edge TTS 进行语音合成,自动转换 OPUS 格式并通过飞书发送。适用于飞书平台的语音对话场景。

Archived SourceRecently Updated
General

test_skill

import json import tkinter as tk from tkinter import messagebox, simpledialog

Archived SourceRecently Updated