akshare
0
总安装量
1
周安装量
安装命令
npx skills add https://github.com/succ985/openclaw-akshare-skill --skill akshare
Agent 安装分布
amp
1
cline
1
openclaw
1
opencode
1
cursor
1
kimi-cli
1
Skill 文档
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
- Data caching: AkShare doesn’t cache data, implement your own caching if needed
- Rate limiting: Be mindful of request frequency to avoid being blocked
- Data format: Returns pandas DataFrame, can be easily processed
- Error handling: Network errors may occur, implement retry logic
References
For complete API documentation and advanced usage, see:
- references/akshare_api.md – Detailed API reference
- references/common_functions.md – Commonly used functions
- https://akshare.akfamily.xyz/ – Official documentation