tushare

Fetch standardized financial market data via Tushare API into DataFrames.

Updated May 5, 2026
One-click install
npx skills add https://github.com/wudye/traderAssistHK --skill tushare-wudye
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tushare
Source: https://github.com/wudye/traderAssistHK/tree/main/backend/src/skills/tushare
Command: npx skills add https://github.com/wudye/traderAssistHK --skill tushare-wudye

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires tushare, pandas, os, datetime, and includes scripts (resource) and references (resource) components.

What problem does it solve?

解决手动查找、整理财经数据费时费力的问题,通过统一的 Tushare 接口方式快速拉取行情、基金、债券、宏观等多类数据,帮助你更快进入分析与研究流程。

Core Features & Use Cases

  • 统一财经数据接口能力:以标准化 API 方式获取股票、基金、期货、债券、外汇、指数等数据,并支持常用字段选择与条件筛选。
  • 快速上手的工程化示例:提供配置 Token、初始化 pro 接口以及调用典型接口(如股票列表、基金净值、基金经理等)的可复用脚本示例。
  • 面向研究的数据组织:可结合 references/ 中的各类接口说明与字段定义,按需提取到 DataFrame 后直接进行清洗、特征构建与分析。

Quick Start

使用 tushare 初始化 pro 对象并调用股票/基金/债券等接口,获取 DataFrame 后即可直接用于你的回测或数据分析任务。

Frequently Asked Questions about tushare

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get financial market data into a Python DataFrame for analysis?▼

You can fetch financial market data into a Python DataFrame by initializing the Tushare pro API with a valid token and calling specific endpoints with parameters like ts_code and date ranges to retrieve standardized stock, fund, and bond datasets.

Can I use Tushare to pull historical stock and fund data for backtesting?▼

Yes, Tushare supports fetching historical and near-real-time datasets for stocks, funds, futures, and bonds. You invoke the specific endpoints with proper input formats to retrieve structured DataFrame outputs ready for backtesting.

What do I need to configure before calling Tushare API endpoints?▼

Before calling Tushare API endpoints, you need to configure your TUSHARE_TOKEN environment variable, initialize the ts.pro_api object, and format your request parameters such as ts_code and date ranges correctly.

Does Tushare support forex and index data or only stock market data?▼

Tushare supports a wide range of financial data beyond stocks, including funds, futures, bonds, forex, and indices. It provides standardized API access to fetch historical and near-real-time datasets across these asset classes.

What is the best way to organize and clean market data fetched via API?▼

The best way to organize and clean market data is to use the Tushare API to extract the required fields directly into a pandas DataFrame, which allows you to immediately perform data cleaning, feature construction, and analysis workflows.

Why are my Tushare API calls returning empty DataFrames when querying market data?▼

Empty DataFrames often occur when input formats are incorrect. You must invoke specific Tushare endpoints with proper parameters, ensuring your ts_code and date ranges exactly match the required standardized formats for the requested data.