akshare
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.
Security Assessment
About akshare
The akshare skill provides guidance for Chinese financial data access using the AkShare library, a free, open-source Python library for fetching real-time and historical data from Chinese and global markets. It covers A-shares, Hong Kong stocks, US stocks, futures, funds, and macroeconomic indicators, drawing data from exchanges including the Shanghai Stock Exchange, Shenzhen Stock Exchange, and Hong Kong Exchange. It is intended for use when a user requests Chinese market data, stock prices, market analysis, or financial information from Chinese exchanges.
After installing with pip install akshare, the skill demonstrates concrete function calls: real-time A-share data via ak.stock_zh_a_spot_em() and ak.stock_zh_a_spot(), historical daily data via ak.stock_zh_a_hist() with symbol, period, start_date, end_date, and adjust parameters, and the stock list via ak.stock_info_a_code_name(). It covers Hong Kong stocks (ak.stock_hk_spot_em(), ak.stock_hk_hist()), US stocks (ak.stock_us_spot_em()), futures (ak.futures_zh_spot(), ak.futures_zh_hist_sina()), funds (ak.fund_open_fund_info_em()), and macro indicators (ak.macro_china_gdp(), ak.macro_china_cpi(), ak.macro_china_pmi()). Common parameters include period values daily, weekly, and monthly, and adjustment values qfq (前复权), hfq (后复权), and "" (不复权). All functions return pandas DataFrames.
The skill targets developers and analysts working with Chinese and international market data in Python. It offers practical tips: AkShare does not cache data so you should implement your own caching if needed, be mindful of request frequency to avoid rate limiting or being blocked, and implement retry logic because network errors may occur. For deeper coverage it points to bundled references (references/akshare_api.md and references/common_functions.md) and the official documentation at https://akshare.akfamily.xyz/. The bundle also includes scripts such as akshare_tool.py and install_akshare.sh.
FAQ
How do I install AkShare?
Run pip install akshare, then import it in Python with import akshare as ak. The bundle also includes an install_akshare.sh script.
How do I fetch real-time and historical A-share data?
Use ak.stock_zh_a_spot_em() for all A-shares real-time data, and ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20240101", end_date="20241231", adjust="qfq") for historical daily data. Functions return a pandas DataFrame.
What period and adjustment parameters are supported?
Period accepts daily (日线), weekly (周线), and monthly (月线). Adjustment accepts qfq (前复权), hfq (后复权), and "" for no adjustment (不复权).
Does AkShare cache data or handle rate limiting?
No. AkShare does not cache data, so you should implement your own caching if needed. Be mindful of request frequency to avoid being blocked, and implement retry logic since network errors may occur.
What markets beyond A-shares are covered?
Hong Kong stocks (ak.stock_hk_spot_em, ak.stock_hk_hist), US stocks (ak.stock_us_spot_em), futures (ak.futures_zh_spot, ak.futures_zh_hist_sina), funds (ak.fund_open_fund_info_em), and macroeconomic indicators like GDP, CPI, and PMI (ak.macro_china_gdp, ak.macro_china_cpi, ak.macro_china_pmi).
All Files
16 filesInstall akshare
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
succ985/openclaw-akshare-skill