
tushare-finance
Fetch Chinese financial market data (A-shares, Hong Kong stocks, US stocks, funds, futures, bonds). Supports 220+ Tushare Pro APIs: stock quotes, financial statements, macroeconomic indicators. Use when users request stock price data, financial analysis, index quotes, GDP/CPI and other macro data.
Fetch Chinese financial market data (A-shares, Hong Kong stocks, US stocks, funds, futures, bonds). Supports 220+ Tushare Pro APIs: stock quotes, financial statements, macroeconomic indicators. Use when users request stock price data, financial analysis, index quotes, GDP/CPI and other macro data.
Tushare Financial Data Skill
This skill fetches Chinese financial market data via the Tushare Pro API, supporting 220+ data interfaces.
Quick Start
1. Token Configuration
Ask the user: Have you configured your Tushare Token?
If not, guide the user:
- Register at https://tushare.pro
- Get your Token
- Set the environment variable:
export TUSHARE_TOKEN="your_token"
2. Verify Dependencies
Check the Python environment:
python -c "import tushare, pandas; print('OK')"
If errors occur, install dependencies:
pip install tushare pandas
Common Interface Quick Reference
| Data Type | Interface Method | Description |
|---|---|---|
| Stock List | pro.stock_basic() |
Get list of all stocks |
| Daily Quotes | pro.daily() |
Get daily quote data |
| Financial Indicators | pro.fina_indicator() |
Financial indicators (ROE, etc.) |
| Income Statement | pro.income() |
Income statement data |
| Index Quotes | pro.index_daily() |
Index daily data |
| Fund NAV | pro.fund_nav() |
Fund net asset value data |
| GDP Data | pro.gdp() |
Gross domestic product |
| CPI Data | pro.cpi() |
Consumer price index |
Full interface list: See Interface Documentation Index
Data Retrieval Process
- Find the interface: Locate the corresponding interface in the Interface Index based on your needs
- Read the documentation: Check
reference/接口文档/[接口名].mdfor parameters - Write code:
import tushare as ts # Initialize (using Token from environment variable) pro = ts.pro_api() # Call the interface df = pro.daily(ts_code='000001.SZ', start_date='20241201', end_date='20241231') - Return results: DataFrame format
Parameter Format Notes
- Date: YYYYMMDD (e.g., 20241231)
- Stock code: ts_code format (e.g., 000001.SZ, 600000.SH)
- Return format: pandas DataFrame
Interface Documentation Reference
Interface Index: reference/README.md
Interface documentation is organized by category:
- Stock data (39 interfaces)
- Index data (18 interfaces)
- Fund data (11 interfaces)
- Futures and options (16 interfaces)
- Macroeconomic data (10 interfaces)
- Hong Kong and US stocks (23 interfaces)
- Bond data (16 interfaces)
Reference Resources
- Tushare Official Documentation: https://tushare.pro/document/2
- API Testing Tool: https://tushare.pro/document/1





