yfinance-global
全球股票行情数据工具。优先使用国内数据源(腾讯财经),支持A股、港股、美股和全球指数。自动回退到Yahoo Finance获取海外数据。
Best use case
yfinance-global is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
全球股票行情数据工具。优先使用国内数据源(腾讯财经),支持A股、港股、美股和全球指数。自动回退到Yahoo Finance获取海外数据。
Teams using yfinance-global should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/yfinance-global/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How yfinance-global Compares
| Feature / Agent | yfinance-global | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
全球股票行情数据工具。优先使用国内数据源(腾讯财经),支持A股、港股、美股和全球指数。自动回退到Yahoo Finance获取海外数据。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# yfinance-global
全球股票数据工具,**优先使用国内数据源**,确保在国内网络环境下的稳定性。
## 数据源优先级
1. **腾讯财经** (qt.gtimg.cn) - A股、港股、指数
2. **新浪财经** (hq.sinajs.cn) - 美股
3. **Yahoo Finance** - 其他海外数据(备用)
## 网络配置
已自动配置:
- 强制使用 IPv4
- 连接超时设置
## Features
- A股股票 (000001, 600000, 300750 等)
- 港股 (00700, 09988, 03690 等)
- 美股 (AAPL, TSLA, NVDA 等)
- 全球指数 (^GSPC, ^IXIC, ^HSI 等)
- 历史价格数据
- 技术指标 (RSI, MACD, MA)
- 多股票对比
- 加密货币数据
## Commands
### 统一行情查询 (推荐)
```bash
python scripts/quote.py <code>
```
支持格式:
- A股: `000001` (上证指数), `600000` (浦发银行)
- 港股: `00700` (腾讯), `09988` (阿里)
- 美股: `AAPL`, `TSLA`
- 指数: `GSPC` (标普500), `IXIC` (纳指)
python scripts/yf_search.py <keyword>
```
### Technical analysis (RSI, MACD, MA)
```bash
python scripts/yf_tech.py <ticker>
```
### Compare multiple stocks
```bash
python scripts/yf_compare.py <ticker1> <ticker2> [ticker3...]
```
### Market overview (global indices)
```bash
python scripts/yf_market.py
```
### Cryptocurrency data
```bash
python scripts/yf_crypto.py <symbol>
```
## Ticker Format
- US Stocks: `AAPL`, `TSLA`, `MSFT`, `GOOGL`
- HK Stocks: `0700.HK`, `9988.HK`, `3690.HK`
- Indices: `^GSPC` (S&P 500), `^IXIC` (Nasdaq)
- ETFs: `SPY`, `QQQ`, `ARKK`
- Crypto: `BTC-USD`, `ETH-USD`, `SOL-USD`
## Examples
```bash
# Apple stock info
python scripts/yf_quote.py AAPL
# Tencent (HK)
python scripts/yf_quote.py 0700.HK
# Tesla history
python scripts/yf_hist.py TSLA 30
# Technical analysis
python scripts/yf_tech.py AAPL
# Compare FAANG stocks
python scripts/yf_compare.py AAPL MSFT GOOGL AMZN META
# Market overview
python scripts/yf_market.py
# Bitcoin
python scripts/yf_crypto.py BTC-USD
# Search
python scripts/yf_search.py apple
```
## File Structure
```
yfinance-global/
├── SKILL.md
└── scripts/
├── yf_quote.py # Stock quote and info
├── yf_hist.py # Historical data
├── yf_search.py # Stock search
├── yf_tech.py # Technical indicators (RSI, MACD, MA)
├── yf_compare.py # Multi-stock comparison
├── yf_market.py # Global market overview
└── yf_crypto.py # Cryptocurrency data
```
## Data Sources
- **Yahoo Finance**: Global stock data, free, no API key required
## Technical Indicators
| Indicator | Description |
|-----------|-------------|
| MA5/10/20/60 | Moving Averages |
| RSI (14) | Relative Strength Index (Overbought >70, Oversold <30) |
| MACD | Moving Average Convergence Divergence |
| Support/Resistance | Recent high/low levels |
## Notes
- No API key required
- Data may have 15-20 minute delay
- Some network environments may have access restrictions to Yahoo Finance
- Please respect rate limits (don't spam requests)Related Skills
global-macro
全球宏观数据仪表盘,整合中/美/欧/日等主要经济体的 GDP、CPI、利率、PMI 等核心指标,提供全球经济全景视图。当用户需要全球宏观经济概览时使用。
global-sensitive-statement
用于敏感声明检测场景。适用于金融工作中的基础任务单元。
global-semantic-retrieval
用于语义检索场景。适用于金融工作中的基础任务单元。
global-scenario-diagnosis
用于场景诊断场景。适用于金融工作中的基础任务单元。
global-reporting-caliber
用于报告口径场景。适用于金融工作中的基础任务单元。
global-product-matching-reasoning
用于产品匹配推理场景。适用于金融工作中的基础任务单元。
global-product-knowledge-retrieval
用于产品知识检索场景。适用于金融工作中的基础任务单元。
global-policy-rule-retrieval
用于政策规则检索场景。适用于金融工作中的基础任务单元。
global-material-completeness
用于材料完整性检查场景。适用于金融工作中的基础任务单元。
global-legal-report-template-report
用于法律报告模板场景。适用于金融工作中的基础任务单元。
global-legal-report-summarizer
用于法律报告摘要场景。适用于金融工作中的基础任务单元。
global-legal-report-customer-script
用于法律报告客户脚本场景。适用于金融工作中的基础任务单元。