Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Installation

npx skills add https://github.com/stanleychanh/tushare-finance-skill-for-claude-code --skill tushare-finance

Summary

获取中国金融市场数据(A股、港股、美股、基金、期货、债券)。支持220+个Tushare Pro接口:股票行情、财务报表、宏观经济指标。当用户请求股价数据、财务分析、指数行情、GDP/CPI等宏观数据时使用。

SKILL.md

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 环境:

python -c "import tushare, pandas; print('OK')"

如报错,安装依赖:

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()居民消费价格指数

完整接口列表:查看 接口文档索引

数据获取流程

  1. 查找接口:根据需求在 接口索引 找到对应接口
  2. 阅读文档:查看 reference/接口文档/[接口名].md 了解参数
  3. 编写代码
   import tushare as ts

   # 初始化(使用环境变量中的 Token)
   pro = ts.pro_api()

   # 调用接口
   df = pro.daily(ts_code='000001.SZ', start_date='20241201', end_date='20241231')
  1. 返回结果:DataFrame 格式

参数格式说明

  • 日期:YYYYMMDD(如 20241231)
  • 股票代码:ts_code 格式(如 000001.SZ, 600000.SH)
  • 返回格式:pandas DataFrame

接口文档参考

接口索引:reference/README.md

接口文档按类别组织:

  • 股票数据(39 个接口)
  • 指数数据(18 个接口)
  • 基金数据(11 个接口)
  • 期货期权(16 个接口)
  • 宏观经济(10 个接口)
  • 港股美股(23 个接口)
  • 债券数据(16 个接口)

参考资源

  • Tushare 官方文档:https://tushare.pro/document/2
  • API 测试工具:https://tushare.pro/document/1

Recommended skills

Browse all →

Related guides

Hand-picked reading to help you choose, install, and use agent skills.