Tushare Pro

Fetch Chinese stock and futures market data via Tushare API. Supports stock quotes, futures data, company fundamentals, and macroeconomic indicators. Use when the user needs financial data from Chinese markets. Requires TUSHARE_TOKEN environment variable.

3,891 stars

Best use case

Tushare Pro is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Fetch Chinese stock and futures market data via Tushare API. Supports stock quotes, futures data, company fundamentals, and macroeconomic indicators. Use when the user needs financial data from Chinese markets. Requires TUSHARE_TOKEN environment variable.

Teams using Tushare Pro should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/tushare/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/alphafactor/tushare/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/tushare/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How Tushare Pro Compares

Feature / AgentTushare ProStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Fetch Chinese stock and futures market data via Tushare API. Supports stock quotes, futures data, company fundamentals, and macroeconomic indicators. Use when the user needs financial data from Chinese markets. Requires TUSHARE_TOKEN environment variable.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Tushare 金融数据接口

获取中国 A 股市场和期货市场的实时及历史数据。

## 前提条件

### 1. 注册 Tushare 账号

访问 https://tushare.pro/weborder/#/login?reg=503098 注册账号并获取 API Token。

### 2. 配置 Token

```bash
# 添加到 ~/.zshrc
export TUSHARE_TOKEN="your-api-token-here"
```

然后执行:
```bash
source ~/.zshrc
```

### 3. 安装依赖

```bash
pip3 install tushare pandas --user
```

## 快速开始

### 获取股票列表

```bash
python3 scripts/market.py stock_basic
```

### 获取日线行情

```bash
python3 scripts/market.py daily --ts_code 000001.SZ --start_date 20240101 --end_date 20240131
```

### 获取实时行情

```bash
python3 scripts/market.py realtime 000001
```

## 股票数据

### 股票基础信息

```bash
python3 scripts/market.py stock_basic
python3 scripts/market.py stock_basic --exchange SSE  # 仅上交所
python3 scripts/market.py stock_basic --exchange SZSE  # 仅深交所
```

### 日线行情

```bash
# 获取单只股票近期数据
python3 scripts/market.py daily --ts_code 000001.SZ

# 指定日期范围
python3 scripts/market.py daily --ts_code 600519.SH --start_date 20240101 --end_date 20240131

# 获取指定交易日全市场数据
python3 scripts/market.py daily --trade_date 20240115
```

### 周线行情

```bash
# 获取周线数据
python3 scripts/market.py weekly --ts_code 000001.SZ

# 指定日期范围
python3 scripts/market.py weekly --ts_code 600519.SH --start_date 20230101 --end_date 20240131
```

### 月线行情

```bash
# 获取月线数据
python3 scripts/market.py monthly --ts_code 000001.SZ

# 指定日期范围
python3 scripts/market.py monthly --ts_code 600519.SH --start_date 20200101 --end_date 20240131
```

**股票代码格式**:
- 深交所:`000001.SZ`, `000002.SZ`, `300001.SZ` (创业板)
- 上交所:`600000.SH`, `600519.SH`, `688001.SH` (科创板)

### 实时行情

```bash
python3 scripts/market.py realtime 000001
python3 scripts/market.py realtime 600519
```

### 资金流向

```bash
# 获取指定股票资金流向
python3 scripts/market.py moneyflow --ts_code 000001.SZ

# 获取指定日期全市场资金流向
python3 scripts/market.py moneyflow --trade_date 20240115
```

### 公司信息

```bash
python3 scripts/market.py company
```

## 期货数据

### 期货合约基础信息

```bash
python3 scripts/market.py fut_basic

# 指定交易所
python3 scripts/market.py fut_basic --exchange CFFEX  # 中金所
python3 scripts/market.py fut_basic --exchange SHFE   # 上期所
python3 scripts/market.py fut_basic --exchange DCE    # 大商所
python3 scripts/market.py fut_basic --exchange CZCE   # 郑商所
```

**交易所代码**:
- `CFFEX` - 中国金融期货交易所
- `SHFE` - 上海期货交易所
- `DCE` - 大连商品交易所
- `CZCE` - 郑州商品交易所
- `INE` - 上海国际能源交易中心

### 期货日线行情

```bash
# 获取铜期货数据
python3 scripts/market.py fut_daily --ts_code CU.SHF

# 获取沪深300股指期货
python3 scripts/market.py fut_daily --ts_code IF.CFX

# 指定日期范围
python3 scripts/market.py fut_daily --ts_code RB.SHF --start_date 20240101 --end_date 20240131
```

**期货代码格式**:
- 上期所:`CU.SHF` (铜), `RB.SHF` (螺纹钢), `AU.SHF` (黄金)
- 大商所:`M.DCE` (豆粕), `I.DCE` (铁矿石)
- 郑商所:`SR.CZC` (白糖), `CF.CZC` (棉花)
- 中金所:`IF.CFX` (沪深300), `IC.CFX` (中证500)

### 期货持仓排名

```bash
python3 scripts/market.py fut_holding --trade_date 20240115 --symbol CU
```

## 宏观经济

### GDP 数据

```bash
python3 scripts/market.py gdp
```

输出示例:
```
📈 GDP数据 (88 条):

2023年4季度: GDP 347909亿元, 增速 5.2%
2023年3季度: GDP 319992亿元, 增速 4.9%
...
```

### CPI 数据

```bash
python3 scripts/market.py cpi
```

### PPI 数据

```bash
python3 scripts/market.py ppi
```

## 命令速查表

| 命令 | 功能 | 示例 |
|------|------|------|
| `stock_basic` | 股票基础信息 | `--exchange SSE` |
| `daily` | 日线行情 | `--ts_code 000001.SZ --start_date 20240101` |
| `weekly` | 周线行情 | `--ts_code 000001.SZ --start_date 20230101` |
| `monthly` | 月线行情 | `--ts_code 000001.SZ --start_date 20200101` |
| `realtime` | 实时行情 | `000001` |
| `moneyflow` | 资金流向 | `--ts_code 000001.SZ` |
| `company` | 公司信息 | - |
| `fut_basic` | 期货基础信息 | `--exchange SHFE` |
| `fut_daily` | 期货日线 | `--ts_code CU.SHF` |
| `fut_holding` | 持仓排名 | `--symbol CU` |
| `gdp` | GDP数据 | - |
| `cpi` | CPI数据 | - |
| `ppi` | PPI数据 | - |

## 常见问题

**错误:请设置 TUSHARE_TOKEN 环境变量**
→ 在 `~/.zshrc` 中添加 `export TUSHARE_TOKEN="your-token"` 并执行 `source ~/.zshrc`

**错误:没有数据返回**
→ 检查股票/期货代码格式是否正确(如:000001.SZ, CU.SHF)

**错误:权限不足**
→ Tushare 部分接口需要积分或付费权限,请在官网查看接口权限要求

**如何获取股票代码?**
```bash
python3 scripts/market.py stock_basic | grep "平安"
```

## 参考文档

- 股票接口文档: [references/stock_api.md](references/stock_api.md)
- 期货接口文档: [references/futures_api.md](references/futures_api.md)
- Tushare 官网: https://tushare.pro

Related Skills

tushare-cli

3891
from openclaw/skills

Tushare 数据查询 CLI

---

3891
from openclaw/skills

name: article-factory-wechat

Content & Documentation

humanizer

3891
from openclaw/skills

Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.

Content & Documentation

find-skills

3891
from openclaw/skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

General Utilities

tavily-search

3891
from openclaw/skills

Use Tavily API for real-time web search and content extraction. Use when: user needs real-time web search results, research, or current information from the web. Requires Tavily API key.

Data & Research

baidu-search

3891
from openclaw/skills

Search the web using Baidu AI Search Engine (BDSE). Use for live information, documentation, or research topics.

Data & Research

agent-autonomy-kit

3891
from openclaw/skills

Stop waiting for prompts. Keep working.

Workflow & Productivity

Meeting Prep

3891
from openclaw/skills

Never walk into a meeting unprepared again. Your agent researches all attendees before calendar events—pulling LinkedIn profiles, recent company news, mutual connections, and conversation starters. Generates a briefing doc with talking points, icebreakers, and context so you show up informed and confident. Triggered automatically before meetings or on-demand. Configure research depth, advance timing, and output format. Walking into meetings blind is amateur hour—missed connections, generic small talk, zero leverage. Use when setting up meeting intelligence, researching specific attendees, generating pre-meeting briefs, or automating your prep workflow.

Workflow & Productivity

self-improvement

3891
from openclaw/skills

Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.

Agent Intelligence & Learning

botlearn-healthcheck

3891
from openclaw/skills

botlearn-healthcheck — BotLearn autonomous health inspector for OpenClaw instances across 5 domains (hardware, config, security, skills, autonomy); triggers on system check, health report, diagnostics, or scheduled heartbeat inspection.

DevOps & Infrastructure

linkedin-cli

3891
from openclaw/skills

A bird-like LinkedIn CLI for searching profiles, checking messages, and summarizing your feed using session cookies.

Content & Documentation

notebooklm

3891
from openclaw/skills

Google NotebookLM 非官方 Python API 的 OpenClaw Skill。支持内容生成(播客、视频、幻灯片、测验、思维导图等)、文档管理和研究自动化。当用户需要使用 NotebookLM 生成音频概述、视频、学习材料或管理知识库时触发。

Data & Research