tushare-baseFetch 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.
Install via ClawdBot CLI:
clawdbot install WdBlink/tushare-base获取中国 A 股市场和期货市场的实时及历史数据。
访问 https://tushare.pro/register 注册账号并获取 API Token。
# 添加到 ~/.zshrc
export TUSHARE_TOKEN="your-api-token-here"
然后执行:
source ~/.zshrc
pip3 install tushare pandas --user
python3 scripts/market.py stock_basic
python3 scripts/market.py daily --ts_code 000001.SZ --start_date 20240101 --end_date 20240131
python3 scripts/market.py realtime 000001
python3 scripts/market.py stock_basic
python3 scripts/market.py stock_basic --exchange SSE # 仅上交所
python3 scripts/market.py stock_basic --exchange SZSE # 仅深交所
# 获取单只股票近期数据
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
# 获取周线数据
python3 scripts/market.py weekly --ts_code 000001.SZ
# 指定日期范围
python3 scripts/market.py weekly --ts_code 600519.SH --start_date 20230101 --end_date 20240131
# 获取月线数据
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 (科创板)python3 scripts/market.py realtime 000001
python3 scripts/market.py realtime 600519
# 获取指定股票资金流向
python3 scripts/market.py moneyflow --ts_code 000001.SZ
# 获取指定日期全市场资金流向
python3 scripts/market.py moneyflow --trade_date 20240115
python3 scripts/market.py company
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 - 上海国际能源交易中心# 获取铜期货数据
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)python3 scripts/market.py fut_holding --trade_date 20240115 --symbol CU
python3 scripts/market.py gdp
输出示例:
📈 GDP数据 (88 条):
2023年4季度: GDP 347909亿元, 增速 5.2%
2023年3季度: GDP 319992亿元, 增速 4.9%
...
python3 scripts/market.py cpi
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 部分接口需要积分或付费权限,请在官网查看接口权限要求
如何获取股票代码?
python3 scripts/market.py stock_basic | grep "平安"
Generated Feb 24, 2026
Analysts and researchers use this skill to fetch historical stock prices, futures data, and macroeconomic indicators like GDP and CPI for Chinese markets. It supports backtesting investment strategies, generating reports, and monitoring market trends over daily, weekly, or monthly intervals.
Portfolio managers and individual investors utilize real-time stock quotes and historical data to track asset performance, assess risk, and make informed trading decisions. The skill helps in analyzing stock fundamentals, company information, and market liquidity through features like moneyflow and company data.
Quantitative developers and traders integrate this skill into algorithmic trading systems to access structured market data for modeling and automation. It provides essential inputs for building predictive models, executing trades based on real-time signals, and analyzing futures holdings and rankings.
Journalists, economists, and business analysts leverage the skill to gather macroeconomic data such as GDP, CPI, and PPI for creating market reports, news articles, and economic forecasts. It enables quick access to up-to-date financial indicators from Chinese markets for public dissemination.
Students and educators in finance or economics courses use this skill to teach market concepts, perform data analysis projects, and conduct research on Chinese financial markets. It offers hands-on experience with real-world data for learning about stock exchanges, futures, and economic trends.
Offer premium access to Tushare data through a subscription platform, providing cleaned, enriched, or real-time data feeds to clients like hedge funds or research firms. Revenue is generated from monthly or annual fees based on data volume and features, with tiered pricing for different user needs.
Provide integration services and consulting to businesses that need to embed Tushare data into their applications, such as trading platforms or financial dashboards. Revenue comes from one-time setup fees, ongoing support contracts, and customization projects tailored to client specifications.
Develop and sell analytics software that uses Tushare data to generate insights, visualizations, and automated reports for investors and corporations. Revenue is driven by software licensing, SaaS subscriptions, and premium features like advanced forecasting or compliance monitoring.
💬 Integration Tip
Ensure the TUSHARE_TOKEN environment variable is set correctly and dependencies like pandas are installed; use the provided scripts for quick data fetching with proper code formats.
Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management, watchlists with alerts, dividend analysis, 8-dimension stock scoring, viral trend detection (Hot Scanner), and rumor/early signal detection. Use for stock analysis, portfolio tracking, earnings reactions, crypto monitoring, trending stocks, or finding rumors before they hit mainstream.
Get stock prices, quotes, fundamentals, earnings, options, dividends, and analyst ratings using Yahoo Finance. Uses yfinance library - no API key required.
Yahoo Finance (yfinance) powered stock analysis skill: quotes, fundamentals, ASCII trends, high-resolution charts (RSI/MACD/BB/VWAP/ATR), plus optional web a...
Become an autonomous prediction market trader on Polymarket with AI-powered analysis and a performance-backed token on Base. Trade real markets, build a track record, and let the buyback flywheel run.
Get cryptocurrency token price and generate candlestick charts via CoinGecko API or Hyperliquid API. Use when user asks for token price, crypto price, price chart, or cryptocurrency market data.
Query Polymarket prediction markets - check odds, trending markets, search events, track prices and momentum. Includes watchlist alerts, resolution calendar,...