返回顶部
🇺🇸 English
🇨🇳 简体中文
🇨🇳 繁體中文
🇺🇸 English
🇯🇵 日本語
🇰🇷 한국어
🇫🇷 Français
🇩🇪 Deutsch
🇪🇸 Español
🇷🇺 Русский
t

tushare-pro

A股/港股/期货量化数据查询工具。基于 Tushare Pro API,直接通过 HTTP REST 接口调用,无需 pip 和 Python 环境。用于获取中国A股/港股/期货/指数/资金流向/财务数据。

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,395
下载量
1
收藏
概述
安装方式
版本历史

tushare-pro

# 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`

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 tushare-pro-1776368556 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 tushare-pro-1776368556 技能

通过命令行安装

skillhub install tushare-pro-1776368556

下载 Zip 包

⬇ 下载 tushare-pro v1.0.0

文件大小: 2.64 KB | 发布时间: 2026-4-17 14:42

v1.0.0 最新 2026-4-17 14:42
Initial release: Direct access to Tushare Pro quantitative financial data for China A-shares, Hong Kong stocks, futures, and indices via HTTP REST API—no Python or pip required.

- Supports daily data queries for equities, indices, funds flow, and futures
- Requires only TUSHARE_TOKEN environment variable, no additional dependencies
- Provides ready-to-use example scripts and command templates
- Detailed instructions for obtaining and configuring the API token
- Includes tips on API usage limits and data field formats

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部