PluginBench
Skill
Pass
Audit score 90

akshare

succ985/openclaw-akshare-skill

Access real-time and historical Chinese financial market data via AkShare library.

SourceView on skills.sh

What is akshare?

AkShare is a free Python library for fetching Chinese financial data from Shanghai, Shenzhen, Hong Kong, and US exchanges. Use it when you need stock quotes, historical prices, futures data, fund information, or macroeconomic indicators for Chinese markets.

  • Fetch real-time A-share, Hong Kong, and US stock quotes
  • Retrieve historical daily, weekly, and monthly stock price data with adjustment options
  • Access commodity futures real-time and historical data
  • Query fund information and historical performance
  • Retrieve macroeconomic indicators (GDP, CPI, PMI)
  • Support multiple adjustment modes (前复权, 后复权, 不复权)

How to install akshare

npx skills add https://github.com/succ985/openclaw-akshare-skill --skill akshare
Prerequisites
  • Python installed
  • pip package manager
  • Network access to AkShare data sources
Claude Code
Cursor
Windsurf
Cline

How to use akshare

  1. 1.Install AkShare: pip install akshare
  2. 2.Import the library: import akshare as ak
  3. 3.Call the appropriate function for your data need (e.g., ak.stock_zh_a_spot_em() for real-time A-shares)
  4. 4.Process the returned pandas DataFrame as needed
  5. 5.Implement caching and rate limiting for production use

Use cases

Good for
  • Get current stock prices for Chinese A-shares and Hong Kong stocks for market monitoring
  • Analyze historical price trends for technical analysis and backtesting
  • Track commodity futures movements for trading decisions
  • Monitor macroeconomic indicators like GDP and CPI for economic analysis
  • Build financial dashboards displaying real-time market data from Chinese exchanges
Who it's for
  • Financial analysts researching Chinese markets
  • Traders monitoring A-shares, Hong Kong stocks, or Chinese futures
  • Developers building financial data applications for Chinese markets
  • Researchers analyzing macroeconomic trends in China

akshare FAQ

What data sources does AkShare support?

AkShare provides data from Shanghai Stock Exchange, Shenzhen Stock Exchange, Hong Kong Exchange, US markets, Chinese futures exchanges, and macroeconomic data from official Chinese sources.

Does AkShare cache data automatically?

No, AkShare does not cache data. You should implement your own caching mechanism if needed to reduce request frequency.

What adjustment modes are available for historical stock data?

Three modes: qfq (前复权 - forward adjustment), hfq (后复权 - backward adjustment), and empty string for no adjustment.

How should I handle rate limiting?

Be mindful of request frequency to avoid being blocked. Implement retry logic and consider adding delays between requests in production applications.

What format does AkShare return data in?

AkShare returns pandas DataFrames, which can be easily processed, filtered, and exported to other formats.

Full instructions (SKILL.md)

Source of truth, from succ985/openclaw-akshare-skill.


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:

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:

Related skills

More from succ985/openclaw-akshare-skill and the wider catalog.