ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

tushare

Tushare Pro 金融大数据平台 - 提供A股、指数、基金、期货、债券、宏观数据,Token认证方式访问。

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/coderwpf/tusharefree
Or

Tushare Pro(大数据开放社区)

Tushare Pro is a widely used financial data platform in China, serving over 300,000 users. It provides a standardized Python API covering A-shares, indices, funds, futures, bonds, and macro data. All interfaces return pandas.DataFrame.

⚠️ Token Required: Register at https://tushare.pro and obtain your personal Token from the User Center. Some interfaces require a higher credit level. See the Credit System section below.

安装

pip install tushare --upgrade

初始化与基本用法

import tushare as ts

# Set Token (only needs to be set once per session)
ts.set_token('your_token_here')

# Initialize the Pro API
pro = ts.pro_api()

# Call any data interface
df = pro.daily(ts_code='000001.SZ', start_date='20240101', end_date='20240630')
print(df)

You can also pass the Token directly during initialization:

# Initialize with Token directly
pro = ts.pro_api('your_token_here')

股票代码格式(ts_code)

  • Shanghai: 600000.SH, 601398.SH
  • Shenzhen: 000001.SZ, 300750.SZ
  • Beijing: 430047.BJ
  • Indices: 000001.SH (SSE Composite Index), 399001.SZ (SZSE Component Index)

沪深股票数据

股票列表

# Get basic information for all currently listed stocks
df = pro.stock_basic(
    exchange='',
    list_status='L',      # L=Listed, D=Delisted, P=Suspended
    fields='ts_code,symbol,name,area,industry,list_date'
)

Credit requirement: 120

日K线数据

# Get daily market data for a specified stock
df = pro.daily(
    ts_code='000001.SZ',
    start_date='20240101',
    end_date='20240630'
)
# Returned fields: ts_code, trade_date, open, high, low, close, pre_close, change, pct_chg, vol, amount

Credit requirement: 120

周线/月线数据

# Get weekly data
df = pro.weekly(ts_code='000001.SZ', start_date='20240101', end_date='20240630')
# Get monthly data
df = pro.monthly(ts_code='000001.SZ', start_date='20240101', end_date='20240630')

分钟级K线数据

# Get minute-level K-line data
df = pro.stk_mins(
    ts_code='000001.SZ',
    freq='5min',           # Options: 1min, 5min, 15min, 30min, 60min
    start_date='2024-01-02 09:30:00',
    end_date='2024-01-02 15:00:00'
)

Credit requirement: 2000+

复权因子

# Get adjustment factors for calculating forward/backward adjusted prices
df = pro.adj_factor(ts_code='000001.SZ', trade_date='20240102')

每日指标

# Get daily market indicator data (PE ratio, PB ratio, turnover rate, market cap, etc.)
df = pro.daily_basic(
    ts_code='000001.SZ',
    trade_date='20240102',
    fields='ts_code,trade_date,turnover_rate,volume_ratio,pe,pe_ttm,pb,ps,ps_ttm,dv_ratio,dv_ttm,total_mv,circ_mv'
)

Credit requirement: 120

停复牌信息

# Get suspension & resumption info, S=Suspended
df = pro.suspend_d(ts_code='000001.SZ', suspend_type='S')

财务数据

利润表

Metadata

Author@coderwpf
Stars3409
Views0
Updated2026-03-25
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-coderwpf-tusharefree": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.