
Chinese financial data access using AkShare library for OpenClaw
概览
Chinese financial data access using AkShare library for OpenClaw. This skill provides easy access to Chinese financial market data through the AkShare library. It supports real-time and historical data for: - : Shanghai and Shenzhen stock exchanges - : HKEX - : US market data - : Commodity and index futures - : Open-end and ETF funds - : GDP, CPI, PMI, and more Or use the provided installation script: Copy this skill to your OpenClaw workspace: - : All A-shares, Hong Kong stocks, US stocks - : Daily, weekly, monthly periods with price adjustment - : Complete stock code and name information - Commodity futures real-time data - Historical futures data from major exchanges - Open-end fund information - Fund historical net value trends
README
以下为原文 README 节选,完整内容请查看原文。
OpenClaw AkShare Skill
Chinese financial data access using AkShare library for OpenClaw.
Overview
This skill provides easy access to Chinese financial market data through the AkShare library. It supports real-time and historical data for:
- A-shares (A股): Shanghai and Shenzhen stock exchanges
- Hong Kong stocks (港股): HKEX
- US stocks (美股): US market data
- Futures (期货): Commodity and index futures
- Funds (基金): Open-end and ETF funds
- Macroeconomic indicators (宏观): GDP, CPI, PMI, and more
Installation
Prerequisites
- Python 3.7+
- OpenClaw framework
Install AkShare
pip install akshare
Or use the provided installation script:
bash scripts/install_akshare.sh
Install the Skill
Copy this skill to your OpenClaw workspace:
cp -r openclaw-akshare-skill /path/to/openclaw/workspace/skills/akshare
Quick Start
Basic Stock Quote
import akshare as ak
# Get all A-shares real-time data
df = ak.stock_zh_a_spot_em()
print(df.head())
Historical Stock Data
# Get historical daily data for a specific stock
df = ak.stock_zh_a_hist(
symbol="000001",
period="daily",
start_date="20240101",
end_date="20241231",
adjust="qfq" # Forward adjustment
)
print(df.tail())
Features
Stock Data
- Real-time quotes: All A-shares, Hong Kong stocks, US stocks
- Historical data: Daily, weekly, monthly periods with price adjustment
- Stock list: Complete stock code and name information
Futures Data
- Commodity futures real-time data
- Historical futures data from major exchanges
Fund Data
- Open-end fund information
- Fund historical net value trends
Macroeconomic Indicators
- GDP, CPI, PPI, PMI
- Economic calendar and indicators
Common Parameters
Period (周期)
daily- Daily (日线)weekly- Weekly (周线)monthly- Monthly (月线)
Price Adjustment (复权)
qfq- Forward adjustment (前复权)hfq- Backward adjustment (后复权)""- No adjustment (不复权)
Examples
See the scripts/ directory for more examples:
example_usage.py- Common usage examplestest_basic.py- Basic functionality teststest_quick.py- Quick start examples
Documentation
- SKILL.md - Complete skill documentation
- references/akshare_api.md - Detailed API reference
- references/common_functions.md - Commonly used functions
- Official AkShare Docs
Tips
- Data caching: AkShare doesn’t cache data by default. 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
License
MIT License - see LICENSE file for details
Contributing
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add succ985/openclaw-akshare-skill