tushare-finance

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.

74stars
10forks
Updated 7/13/2026
SKILL.md
readonlyread-only
name
tushare-finance
description

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:

  1. Register at https://tushare.pro
  2. Get your Token
  3. 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

  1. Find the interface: Locate the corresponding interface in the Interface Index based on your needs
  2. Read the documentation: Check reference/接口文档/[接口名].md for parameters
  3. 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')
    
  4. 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