SuperAPI AI Directory

tushare-api

Data & analytics

View repository

Updated 10-15 12:47

About this skill

Tushare API Skill

Introduction

Tushare Pro is China's leading financial data platform, providing full-category financial big data such as stocks, funds, futures, bonds, forex, and digital currencies.

Official Website: https://tushare.pro API Documentation: https://tushare.pro/document/2

Stock Code Conventions

All stock codes need a suffix:

Exchange Suffix Example
Shanghai Stock Exchange .SH 600000.SH
Shenzhen Stock Exchange .SZ 000001.SZ
Beijing Stock Exchange .BJ 835305.BJ
Hong Kong Stock Exchange .HK 00001.HK

Common API Interfaces

Basic Data

  • stock_basic - Basic stock information
  • trade_cal - Trading calendar
  • stock_company - Basic information of listed companies
  • new_share - IPO new stock list

Market Data

  • daily - Daily quotes
  • weekly - Weekly quotes
  • monthly - Monthly quotes
  • adj_factor - Adjustment factors
  • daily_basic - Daily indicators (PE/PB/market cap, etc.)

Financial Data

  • income - Income statement
  • balance_sheet - Balance sheet
  • cashflow - Cash flow statement
  • forecast - Earnings forecast
  • express - Earnings express report
  • dividend - Dividends and bonus shares
  • fina_indicator - Financial indicators

Market Data

  • moneyflow - Individual stock capital flow
  • limit_list - Daily limit-up and limit-down stocks
  • top_list - Dragon and Tiger List data
  • block_trade - Block trades

Usage

Python SDK

import tushare as ts

# 设置 token(需要用户自行申请)
pro = ts.pro_api('your_token_here')

# 获取股票列表
df = pro.stock_basic(exchange='', list_status='L', fields='ts_code,symbol,name,area,industry,list_date')

# 获取日线行情
df = pro.daily(ts_code='000001.SZ', start_date='20240101', end_date='20240201')

# 获取财务数据
df = pro.income(ts_code='600000.SH', start_date='20230101', end_date='20231231')

HTTP API

curl -X POST https://api.tushare.pro \
  -H "Content-Type: application/json" \
  -d '{
    "api_name": "daily",
    "token": "your_token",
    "params": {"ts_code": "000001.SZ", "start_date": "20240101"},
    "fields": "ts_code,trade_date,open,high,low,close,vol"
  }'

Points System

  • Initial points are given upon registration
  • Earn points through check-ins, sharing, contributing data, and other methods
  • Different API calls consume different amounts of points
  • Points and frequency correspondence table: https://tushare.pro/document/1?doc_id=290

Detailed Documentation

For more interface details, see references/api-reference.md

Notes

  1. A token must be applied for to use the API
  2. Pay attention to points consumption; high-frequency interfaces consume more points
  3. Data updates are delayed; daily data is usually updated 1-2 hours after market close
  4. Free users have call frequency limits