GloryJack

Tushare Pro A股数据

Professionalv1.0.0
By GloryJackUpdated 2026-05-11tushare-pro@clawhub_gloryjack/tushare-pro
Finance#接口调用#接口

According to AlphaMoat, as of 2026-09, Tushare Pro A股数据 has 4,154 downloads and 1 stars — ranked #2,419 of 5,078 AI skills overall, and #201 of 465 in Professional.

Installs
422
Downloads
4.2K
Stars
1
Overall Rank
#2,419
Top 48% overall · Top 44% in Professional
PlatformInstallsDownloadsStarsComments
ClawHub ↗1143.4K1-
SkillHub ↗4224.2K1—

Platforms count differently and update at different times.

What this skill does

It documents parameters and fields for stock and index daily bars, money flows and futures bars without a dedicated SDK. Configure TUSHARE_TOKEN, observe endpoint permissions and rate limits, and verify codes, dates and data definitions. A bundled token setup file points to a lookalike domain; do not enter credentials there. Obtain tokens from the verified official Tushare site and provide them through a protected runtime environment.

Profile published 2026-10-27

What you can do with it

  • Retrieve data for a selected market and period

When to use it

  • When structured price or money-flow data is needed

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Prepare a daily-stock query, verify dates, fields and account access, and do not treat examples as live data.

Monthly Trend

Downloads4.2K
1.2K2.8K4.4K2026-03 · Downloads 1.5K2026-05 · Downloads 2.6K2026-07 · Downloads 3.2K2026-08 · Downloads 3.4K2026-09 · Downloads 4.2K26-0326-09
Stars1
0122026-03 · Stars 12026-05 · Stars 12026-07 · Stars 12026-08 · Stars 12026-09 · Stars 126-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-094.2K—1
2026-083.4K+6.7%1
2026-073.2K—1
2026-052.6K—1
2026-031.5K—1

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

3.6 KB · ClawHub v1.0.0
---
name: tushare-pro
description: A股/港股/期货量化数据查询工具。基于 Tushare Pro API,直接通过 HTTP REST 接口调用,无需 pip 和 Python 环境。用于获取中国A股/港股/期货/指数/资金流向/财务数据。
metadata:
  {
    "openclaw": {
      "requires": {
        "env": ["TUSHARE_TOKEN"],
        "bins": []
      },
Show all (132 lines)
      "install": []
    }
  }
---

# Tushare Pro 数据查询技能

通过 HTTP REST 接口直接调用 Tushare Pro,无需 pip/SDK。

## 前提条件

### 1. 注册账号并获取 Token

1. 打开 👉 **https://tushare.pro** 注册账号
2. 登录后进入 **个人中心 → 接口Token**
3. 复制你的 Token

### 2. 配置 Token

在 **~/.openclaw/skills/tushare-pro/** 目录下创建 `token.env` 文件:

```
TUSHARE_TOKEN=你的Token
```

## 数据接口一览

### 股票日线
```
api: daily
params: {ts_code: "600036.SH", start_date: "20260320", end_date: "20260326"}
fields: ts_code,trade_date,open,high,low,close,pct_chg,vol,amount
```
股票代码格式:
- 上交所:`600036.SH`(招商银行)、`600519.SH`(茅台)
- 深交所:`000001.SZ`(平安)、`300001.SZ`(创业板)
- 科创板:`688001.SH`

### 指数日线
```
api: index_daily
params: {ts_code: "000300.SH", start_date: "20260320", end_date: "20260326"}
fields: ts_code,trade_date,open,high,low,close,pct_chg,vol
```
常用指数代码:
- `000300.SH` 沪深300
- `000001.SH` 上证指数
- `399001.SZ` 深证成指
- `HSI.HK` 恒生指数
- `HSTECH.HK` 恒生科技

### 资金流向
```
api: moneyflow
params: {trade_date: "20260324"}
fields: ts_code,trade_date,close,pct_chg,buy_elg_amount,sell_elg_amount
```

### 期货日线
```
api: fut_daily
params: {ts_code: "IF.CFX", start_date: "20260320", end_date: "20260326"}
fields: ts_code,trade_date,open,high,low,close,vol,oi
```
期货代码格式:
- `CU.SHF` 铜
- `AU.SHF` 黄金
- `RB.SHF` 螺纹钢
- `IF.CFX` 沪深300股指
- `IC.CFX` 中证500股指

## 查询脚本

```python
#!/usr/bin/env python3
"""Tushare Pro HTTP 调用工具(无需pip)"""
import os, json, urllib.request

TOKEN = '你的Token'  # 或 os.environ.get('TUSHARE_TOKEN')

def call(api_name, params=None, fields=''):
    payload = json.dumps({
        'api_name': api_name,
        'token': TOKEN,
        'params': params or {},
        'fields': fields
    }).encode('utf-8')
    req = urllib.request.Request(
        'https://api.tushare.pro',
        data=payload,
        headers={'Content-Type': 'application/json'}
    )
    with urllib.request.urlopen(req, timeout=20) as r:
        result = json.loads(r.read().decode())
        if result.get('code') != 0:
            return None
        return result['data']

# 示例:查招商银行近期数据
data = call('daily',
    {'ts_code': '600036.SH', 'start_date': '20260320', 'end_date': '20260326'},
    'ts_code,trade_date,open,high,low,close,pct_chg,vol,amount')
for row in data['items']:
    print(dict(zip(data['fields'], row)))
```

## 常用查询示例

| 目标 | 命令 |
|------|------|
| 招商银行近期日线 | `daily(ts_code='600036.SH', start='20260320', end='20260326')` |
| 沪深300近期日线 | `index_daily(ts_code='000300.SH', start='20260320', end='20260326')` |
| 恒生指数近期 | `index_daily(ts_code='HSI.HK', start='20260320', end='20260326')` |
| 当日全市场资金流 | `moneyflow(trade_date='20260324')` |
| 黄金期货近期 | `fut_daily(ts_code='AU.SHF', start='20260320', end='20260326')` |

## 注意事项

- Token 有调用频率限制,高频查询请加入 `time.sleep(0.5)`
- 部分接口需要 Tushare 积分权限
- 日期格式统一为 `YYYYMMDD`

Popular in Professional

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.