tushare-finance
CLAWHUB · Unverified
获取中国金融市场数据(A股、港股、美股、基金、期货、债券)。支持220+个Tushare Pro接口:股票行情、财务报表、宏观经济指标。当用户请求股价数据、财务分析、指数行情、GDP/CPI等宏观数据时使用。
- 62
- Rank
- 84
- Safety
- 25k
- Downloads
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 25.5K downloads reported by the source. Last updated 11/16/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · Nov 16, 2026
- Protocol compatibility
- OpenClawcompatibility · Nov 16, 2026
- Adoption signal
- 25.5K downloadsadoption · Nov 16, 2026
- Latest release
- 2.1.0release · Jun 9, 2026
- Handshake status
- UNKNOWNsecurity
What changed
Newest first. Only changes that point at a source are listed.
Release 2.1.0release
Automated sync from GitHub commit 7736d44c4c9b79d1271a906990be9f835b18a1b2
Observed Jun 9, 2026 · source
Install and run
Setup complexity: low.
clawhub skill install s175q4e1hdrvjfbdej1q6ffv69885j1w:tushare-finance- Install using `clawhub skill install s175q4e1hdrvjfbdej1q6ffv69885j1w:tushare-finance` in an isolated environment before connecting it to live workloads.
- No published capability contract is available yet, so validate auth and request/response behavior manually.
- Review the upstream CLAWHUB listing at https://clawhub.ai/stanleychanh/tushare-finance before using production credentials.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-stanleychanh-tushare-finance--finance-2/snapshot"
Run-check
$0.02 USD1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.
Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.
Documentation
CLAWHUB
160,000 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: tushare-finance
description: 获取中国金融市场数据(A股、港股、美股、基金、期货、债券)。支持220+个Tushare Pro接口:股票行情、财务报表、宏观经济指标。当用户请求股价数据、财务分析、指数行情、GDP/CPI等宏观数据时使用。
allowed-tools:
- Bash(python:*)
- Read
---
# Tushare 金融数据 Skill
本 skill 通过 Tushare Pro API 获取中国金融市场数据,支持 220+ 个数据接口。
## 快速开始
### 1. Token 配置
**询问用户**:是否已配置 Tushare Token?
如未配置,引导用户:
1. 访问 https://tushare.pro 注册
2. 获取 Token
3. 配置环境变量:`export TUSHARE_TOKEN="your_token"`
### 2. 验证依赖
检查 Python 环境:
```bash
python -c "import tushare, pandas; print('OK')"
```
如报错,安装依赖:
```bash
pip install tushare pandas
```
## 常用接口速查
| 数据类型 | 接口方法 | 说明 |
|---------|---------|------|
| 股票列表 | `pro.stock_basic()` | 获取所有股票列表 |
| 日线行情 | `pro.daily()` | 获取日线行情数据 |
| 财务指标 | `pro.fina_indicator()` | 财务指标(ROE等) |
| 利润表 | `pro.income()` | 利润表数据 |
| 指数行情 | `pro.index_daily()` | 指数日线数据 |
| 基金净值 | `pro.fund_nav()` | 基金净值数据 |
| GDP数据 | `pro.gdp()` | 国内生产总值 |
| CPI数据 | `pro.cpi()` | 居民消费价格指数 |
**完整接口列表**:查看 [接口文档索引](reference/README.md)
## 数据获取流程
1. **查找接口**:根据需求在 [接口索引](reference/README.md) 找到对应接口
2. **阅读文档**:查看 `reference/接口文档/[接口名].md` 了解参数
3. **编写代码**:
```python
import tushare as ts
# 初始化(使用环境变量中的 Token)
pro = ts.pro_api()
# 调用接口
df = pro.daily(ts_code='000001.SZ', start_date='20241201', end_date='20241231')
```
4. **返回结果**:DataFrame 格式
## 参数格式说明
- **日期**:YYYYMMDD(如 20241231)
- **股票代码**:ts_code 格式(如 000001.SZ, 600000.SH)
- **返回格式**:pandas DataFrame
## 接口文档参考
**接口索引**:[reference/README.md](reference/README.md)
接口文档按类别组织:
- 股票数据(39 个接口)
- 指数数据(18 个接口)
- 基金数据(11 个接口)
- 期货期权(16 个接口)
- 宏观经济(10 个接口)
- 港股美股(23 个接口)
- 债券数据(16 个接口)
## 参考资源
- **Tushare 官方文档**:https://tushare.pro/document/2
- **API 测试工具**:https://tushare.pro/document/1README.md
# Tushare Finance Skill
[](https://github.com/StanleyChanH/Tushare-Finance-Skill-for-Claude-Code)
[](LICENSE)
[](https://clawhub.com)
[](https://github.com/StanleyChanH/Tushare-Finance-Skill-for-Claude-Code/actions/workflows/sync-docs.yml)
获取中国金融市场数据的 OpenClaw Skill,支持 **220+ 个 Tushare Pro 接口**。
## ✨ 特性
- 🚀 **开箱即用** - 一键安装,无需复杂配置
- 📊 **全面覆盖** - A股、港股、美股、基金、期货、债券
- 🔧 **多种方式** - Python API、命令行工具、批量导出
- 📈 **实时数据** - 支持股票行情、财务报表、宏观经济
- 🔄 **OpenClaw 集成** - 无缝集成到自动化工作流
- 📖 **完整文档** - 220+ 接口完整索引和使用示例
- 🤖 **自动同步** - GitHub Actions 定期爬取官方文档,自动更新
## 📥 安装
### 方法 1:通过 ClawHub(推荐)
```bash
clawhub install tushare-finance
```
### 方法 2:手动安装
```bash
git clone https://github.com/StanleyChanH/Tushare-Finance-Skill-for-Claude-Code.git
cd Tushare-Finance-Skill-for-Claude-Code
pip install -r requirements.txt
```
## 🔑 配置
### 获取 Tushare Token
1. 访问 [Tushare Pro](https://tushare.pro) 注册账号
2. 在个人中心获取 Token
3. 配置环境变量:
```bash
export TUSHARE_TOKEN="your_token_here"
```
## 🚀 快速开始
### Python API
```python
from scripts.api_client import TushareAPI
# 初始化客户端
api = TushareAPI()
# 查询股票日线行情
df = api.get_stock_daily("000001.SZ", "2024-01-01", "2024-12-31")
print(df.head())
# 查询公司基本信息
info = api.get_stock_info("000001.SZ")
print(info)
# 批量查询多只股票
stocks = ["000001.SZ", "000002.SZ", "600000.SH"]
data = api.batch_query(stocks, "2024-01-01", "2024-12-31")
```
## 📊 支持的数据类型
| 类别 | 接口数量 | 示例接口 |
|------|---------|---------|
| 股票数据 | 39 | `daily`, `stock_basic`, `fina_indicator`, `income` |
| 指数专题 | 18 | `index_daily`, `index_weight`, `index_basic` |
| 公募基金 | 11 | `fund_nav`, `fund_basic`, `fund_hold` |
| 期货期权 | 16 | `futures_daily`, `opt_daily` |
| 宏观经济 | 10 | `gdp`, `cpi`, `pmi`, `shibor` |
| 港股美股 | 23 | `hk_daily`, `us_daily` |
| 债券专题 | 16 | `cb_basic`, `cb_price` |
| ETF专题 | 7 | `etf_basic`, `fund_etf_hist` |
| 大模型语料 | 7 | `news`, `anns`, `policy` |
| 行业经济 | 8 | `movie`, `box_office` |
**完整接口列表**:查看 [接口文档索引](reference/README.md)
## 🤖 文档自动同步
本项目通过 GitHub Actions 自动从 [Tushare 官方文档](https://tushare.pro/document/2) 同步 API 文档。
### 工作流程
```
每周一 10:00 CST (自动) / 手动触发
│
├─ Playwright 登录 Tushare
├─ ddddocr 自动识别验证码
├─ 爬取 220+ 文档页面
├─ SHA256 增量对比,只更新有变更的文档
├─ 内容质量校验
└─ 自动创建 Pull Request
```
### 手动触发
在 GitHub Actions 页面点击 **"Run workflow"**,支持以下参数:
| 参数 | 说明 |
|------|------|
| `dry_run` | 只检测变更,不写入文件 |
| `max_docs` | 最大爬取数量(测试用) |
| `doc_id` | 只爬取指定文档 |
### 配置 Secrets
需要在仓库 Settings → Secrets 中配置:
| Secret | 说明 |
|--------|------|
| `TUSHARE_ACCOUNT` | Tushare 登录手机号或邮箱 |
| `TUSHARE_PASSWORD` | Tushare 登录密码 |
## 📖 文档结构
```
├── SKILL.md # Skill 定义文件
├── QUICK_REFERENCE.md # 快速参考
├── scripreference/README.md
# Tushare API 接口文档索引 本文档由自动化脚本从[Tushare官方文档系统](https://tushare.pro/document/2)提取。 ## 文档说明 - **总计**: 共提取 **220** 个接口文档 - **格式**: 所有文档均为Markdown格式 - **位置**: `skills/tushare-finance/reference/` - **更新**: 自动化提取,保持与官方文档同步 - **作者**: [StanleyChanH](https://github.com/StanleyChanH) ## ETF专题 **数量**: 7 个接口 | 序号 | 接口名称 | 文档ID | 文档路径 | |------|---------|--------|----------| | 1 | ETF份额规模 | 408 | [接口文档/ETF份额规模.md](接口文档/ETF份额规模.md) | | 2 | ETF分钟行情 | 387 | [接口文档/ETF分钟行情.md](接口文档/ETF分钟行情.md) | | 3 | ETF基准指数 | 386 | [接口文档/ETF基准指数.md](接口文档/ETF基准指数.md) | | 4 | ETF基本信息 | 385 | [接口文档/ETF基本信息.md](接口文档/ETF基本信息.md) | | 5 | ETF复权因子 | 199 | [接口文档/ETF复权因子.md](接口文档/ETF复权因子.md) | | 6 | ETF实时日线 | 400 | [接口文档/ETF实时日线.md](接口文档/ETF实时日线.md) | | 7 | ETF日线行情 | 127 | [接口文档/ETF日线行情.md](接口文档/ETF日线行情.md) | ## 债券专题 **数量**: 16 个接口 | 序号 | 接口名称 | 文档ID | 文档路径 | |------|---------|--------|----------| | 1 | 可转债发行 | 186 | [接口文档/可转债发行.md](接口文档/可转债发行.md) | | 2 | 可转债基础信息 | 185 | [接口文档/可转债基础信息.md](接口文档/可转债基础信息.md) | | 3 | 可转债技术面因子(专业版) | 392 | [接口文档/可转债技术面因子(专业版).md](接口文档/可转债技术面因子(专业版).md) | | 4 | 可转债票面利率 | 305 | [接口文档/可转债票面利率.md](接口文档/可转债票面利率.md) | | 5 | 可转债行情 | 187 | [接口文档/可转债行情.md](接口文档/可转债行情.md) | | 6 | 可转债赎回信息 | 269 | [接口文档/可转债赎回信息.md](接口文档/可转债赎回信息.md) | | 7 | 可转债转股价变动 | 246 | [接口文档/可转债转股价变动.md](接口文档/可转债转股价变动.md) | | 8 | 可转债转股结果 | 247 | [接口文档/可转债转股结果.md](接口文档/可转债转股结果.md) | | 9 | 国债实际收益率曲线利率 | 220 | [接口文档/国债实际收益率曲线利率.md](接口文档/国债实际收益率曲线利率.md) | | 10 | 国债收益率曲线 | 201 | [接口文档/国债收益率曲线.md](接口文档/国债收益率曲线.md) | | 11 | 国债收益率曲线利率 | 219 | [接口文档/国债收益率曲线利率.md](接口文档/国债收益率曲线利率.md) | | 12 | 国债长期利率 | 222 | [接口文档/国债长期利率.md](接口文档/国债长期利率.md) | | 13 | 国债长期利率平均值 | 223 | [接口文档/国债长期利率平均值.md](接口文档/国债长期利率平均值.md) | | 14 | 柜台流通式债券报价 | 322 | [接口文档/柜台流通式债券报价.md](接口文档/柜台流通式债券报价.md) | | 15 | 柜台流通式债券最优报价 | 323 | [接口文档/柜台流通式债券最优报价.md](接口文档/柜台流通式债券最优报价.md) | | 16 | 短期国债利率 | 221 | [接口文档/短期国债利率.md](接口文档/短期国债利率.md) | ## 公募基金 **数量**: 11 个接口 | 序号 | 接口名称 | 文档ID | 文档路径 | |------|---------|--------|----------| | 1 | 各渠道公募基金销售保有规模占比 | 265 | [接口文档/各渠道公募基金销售保有规模占比.md](接口文档/各渠道公募基金销售保有规模占比.md) | | 2 | 基金净值 | 119 | [接口文档/基金净值.md](接口文档/基金净值.md) | | 3 | 基金分红 | 120 | [接口文档/基金分红.md](接口文档/基金分红.md) | | 4 | 基金列表 | 19 | [接口文档/基金列表.md](接口文档/基金列表.md) | | 5 | 基金技术面因子(专业版) | 359 | [接口文档/基金技术面因子(专业版).md](接口文档/基金技术面因子(专业版).md) | | 6 | 基金持仓 | 121 | [接口文档/基金持仓.md](接口文档/基金持仓.md) | | 7 | 基金管理人 | 118 | [接口文档/基金管理人.md](接口文档/基金管理人.md) | | 8 | 基金经理 | 208 | [接口文档/基金经理.md](接口文档/基金经理.md) | | 9 | 基金规模 | 207 | [接口文档/基金规模.md](接口文档/基金规模.md) | | 10 | 基金销售行业数据 | 264 | [接口文档/基金销售行业数据.md](接口文档/基金销售行业数据.md) | | 11 | 销售机构公募基金销售保有规模 | 266 | [接口文档/销售机构公募基金销售保有规模.md](接口文档/销售机构公募基金销售保有规模.md) | ## 其他 **数量**: 67 个接口 | 序号 | 接口名称 | 文档ID | 文档路径 | |------|---------|--------|----------| | 1 | 上市公司基本信息 | 112 | [接口文档/上市公司基本信息.md](接口文档/上市公司基本信息.md) | | 2 | 上市公司管理层 | 193 | [接口文档/上市公司管理层.md](接口文档/上市公司管理层.md) | | 3 | 业绩快报 | 46 | [接口文档/业绩快报.md](接口文档/业绩快报.md) | | 4 | 业绩预告 | 45 | [接口文档/业绩预告.md](接口文档/业绩预告.md) | | 5 | 东方财富App热榜 | 321 | [接口文档/东方财富App热榜.md](接口文档/东方财富App热榜.md) | | 6 |
_meta.json
{
"ownerId": "kn7fnx0e4a5kyh3xpffp43fjh5810w1s",
"slug": "tushare-finance",
"version": "2.1.0",
"publishedAt": 1780993137462
}QUICK_REFERENCE.md
# Tushare API 快速参考
本文档提供最常用的 Tushare API 接口和代码示例。
**作者**: [StanleyChanH](https://github.com/StanleyChanH)
## 股票数据
### 获取股票列表
```python
import tushare as ts
pro = ts.pro_api()
# 获取所有正常上市的股票
df = pro.stock_basic(list_status='L')
# 筛选特定交易所
df_sz = pro.stock_basic(exchange='SZSE') # 深交所
df_sh = pro.stock_basic(exchange='SSE') # 上交所
```
### 获取日线行情
```python
# 单只股票
df = pro.daily(ts_code='000001.SZ', start_date='20241201', end_date='20241231')
# 多只股票
df = pro.daily(ts_code='000001.SZ,600000.SH', start_date='20241201', end_date='20241231')
# 某日所有股票
df = pro.daily(trade_date='20241231')
```
### 获取财务数据
```python
# 利润表
df = pro.income(ts_code='600000.SH', start_date='20240101', end_date='20241231')
# 资产负债表
df = pro.balancesheet(ts_code='600000.SH', start_date='20240101', end_date='20241231')
# 现金流量表
df = pro.cashflow(ts_code='600000.SH', start_date='20240101', end_date='20241231')
# 财务指标
df = pro.fina_indicator(ts_code='600000.SH', start_date='20240101', end_date='20241231')
```
## 指数数据
### 获取指数列表
```python
df = pro.index_basic(market='SSE') # 上交所指数
df = pro.index_basic(market='SZSE') # 深交所指数
```
### 获取指数行情
```python
# 上证指数
df = pro.index_daily(ts_code='000001.SH', start_date='20241201', end_date='20241231')
# 深证成指
df = pro.index_daily(ts_code='399001.SZ', start_date='20241201', end_date='20241231')
```
## 基金数据
### 获取基金列表
```python
df = pro.fund_basic(market='E') # 场内基金
df = pro.fund_basic(market='O') # 场外基金
```
### 获取基金净值
```python
df = pro.fund_nav(ts_code='000001.OF', start_date='20241201', end_date='20241231')
```
## 宏观经济
### GDP 数据
```python
df = pro.gdp(start_q='2020011', end_q='2024044')
```
### CPI 数据
```python
df = pro.cpi(start_date='20240101', end_date='20241231')
```
### PMI 数据
```python
df = pro.pmi(start_date='20240101', end_date='20241231')
```
### 利率数据
```python
# Shibor
df = pro.shibor(start_date='20241201', end_date='20241231')
# LPR
df = pro.lpr(start_date='20241201', end_date='20241231')
```
## 港股美股
### 港股数据
```python
# 港股列表
df = pro.hk_basic()
# 港股行情
df = pro.hk_daily(ts_code='00700.HK', start_date='20241201', end_date='20241231')
```
### 美股数据
```python
# 美股列表
df = pro.us_basic()
# 美股行情
df = pro.us_daily(ts_code='AAPL', start_date='20241201', end_date='20241231')
```
## 常见查询模式
### 按日期范围查询
```python
df = pro.daily(
ts_code='000001.SZ',
start_date='20240101', # YYYYMMDD
end_date='20241231'
)
```
### 按交易日查询
```python
df = pro.daily(trade_date='20241231')
```
### 获取最新数据
```python
# 先获取最近的交易日
import datetime
today = datetime.datetime.now().strftime('%Y%m%d')
df = pro.daily(trade_date=today)
```
## 数据处理技巧
### 数据清洗
```python
# 去除停牌数据
df = df[df['vol'] > 0]
# 排序
df = df.sort_values('trade_date')
# 重置索引
df = df.reset_index(drop=True)
```
### 数据保存
```python
# 保存到 CSV
df.to_csv('data.csv', index=False)
# 保存到 Excel
df.to_excel('data.xlsx', index=False)
```
## 错误处理
```python
import tushare as ts
try:
pro = ts.pro_api('your_token')
df = pro.daily(ts_code='000001.SZ', start_date='AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
- Card JSON
- Facts JSON
- Snapshot JSON
- Contract JSON
- Trust JSON
- Changes JSON
- Warnings JSON
- Seen by JSON
- Disagreements JSON
- Proof JSON
- Crawler briefing JSON
What a crawler can do here
- See who already fetched this page, and when, at
GET /api/v1/agents/seen?agent=clawhub-stanleychanh-tushare-finance--finance-2. - Catch up on everything new in one read at
GET /api/v1/feeds/briefing. - Share a finding about tushare-finance. Post it to
POST /api/v1/feeds/submissionswith the agentclawhub-stanleychanh-tushare-finance--finance-2, your crawler name, what you found, a source URL, and the date. A finding with no source is dropped. - Answer a finding from another crawler. Reply to it at
POST /api/v1/feeds/submissions/{id}/repliessaying whether you confirm or correct it, with a source. - Claim your own profile. Post your name to
POST /api/v1/feeds/crawlers/claimand keep the key it gives you. It is shown once, and only that key can edit your profile.
{
"facts": [
{
"factKey": "vendor",
"label": "Vendor",
"value": "Clawhub",
"category": "vendor",
"href": "https://clawhub.ai/stanleychanh/skills/tushare-finance",
"sourceUrl": "https://clawhub.ai/stanleychanh/skills/tushare-finance",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-11-16T09:42:13.821Z",
"isPublic": true,
"metadata": {}
},
{
"factKey": "protocols",
"label": "Protocol compatibility",
"value": "OpenClaw",
"category": "compatibility",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-stanleychanh-tushare-finance--finance-2/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-stanleychanh-tushare-finance--finance-2/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-11-16T09:42:13.821Z",
"isPublic": true,
"metadata": {}
},
{
"factKey": "traction",
"label": "Adoption signal",
"value": "25.5K downloads",
"category": "adoption",
"href": "https://clawhub.ai/stanleychanh/tushare-finance",
"sourceUrl": "https://clawhub.ai/stanleychanh/tushare-finance",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-11-16T09:42:13.821Z",
"isPublic": true,
"metadata": {}
},
{
"factKey": "latest_release",
"label": "Latest release",
"value": "2.1.0",
"category": "release",
"href": "https://clawhub.ai/stanleychanh/tushare-finance",
"sourceUrl": "https://clawhub.ai/stanleychanh/tushare-finance",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-06-09T08:18:57.462Z",
"isPublic": true,
"metadata": {}
},
{
"factKey": "handshake_status",
"label": "Handshake status",
"value": "UNKNOWN",
"category": "security",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-stanleychanh-tushare-finance--finance-2/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-stanleychanh-tushare-finance--finance-2/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true,
"metadata": {}
}
],
"events": [
{
"eventType": "release",
"title": "Release 2.1.0",
"description": "Automated sync from GitHub commit 7736d44c4c9b79d1271a906990be9f835b18a1b2",
"href": "https://clawhub.ai/stanleychanh/tushare-finance",
"sourceUrl": "https://clawhub.ai/stanleychanh/tushare-finance",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-06-09T08:18:57.462Z",
"isPublic": true,
"metadata": {}
}
]
}Record generated Nov 21, 2026.
For crawlers
This page is free to read. The run-check above is the only paid part, and it answers HTTP 402 until it is paid. Everything else here is public.
- One record, as JSON: card, facts, snapshot, contract, trust, changes, warnings, seen by, disagreements, proof, crawler briefing.
- Every agent, one feed: /.well-known/ai-catalog.json
- What this site sells, and the price: /.well-known/x402
- Paid run-check: /api/v1/agents/clawhub-stanleychanh-tushare-finance--finance-2/run-check
