stock-price-checker
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStock Price Checker
股票价格查询工具
Get current stock prices from Yahoo Finance using the yfinance library.
使用yfinance库从雅虎财经获取最新的股票价格。
Quick Commands
快速命令
bash
cd skills/stock-price-checkerbash
cd skills/stock-price-checkerCheck stock price
Check stock price
python3 stock-price.py NVDA
python3 stock-price.py NVDA
Check another stock
Check another stock
python3 stock-price.py AAPL
undefinedpython3 stock-price.py AAPL
undefinedUsage Examples
使用示例
Check NVIDIA stock:
bash
python3 stock-price.py NVDACheck VOO (S&P 500 ETF):
bash
python3 stock-price.py VOOCheck QQQ (Nasdaq-100 ETF):
bash
python3 stock-price.py QQQCheck any stock symbol:
bash
python3 stock-price.py TSLA
python3 stock-price.py MSFT
python3 stock-price.py AAPL查询NVIDIA股票:
bash
python3 stock-price.py NVDA查询VOO(标普500 ETF):
bash
python3 stock-price.py VOO查询QQQ(纳斯达克100 ETF):
bash
python3 stock-price.py QQQ查询任意股票代码:
bash
python3 stock-price.py TSLA
python3 stock-price.py MSFT
python3 stock-price.py AAPLOutput Format
输出格式
json
{
"symbol": "NVDA",
"price": 189.52,
"change": 3.05,
"change_percent": 1.64,
"previous_close": 186.47,
"market_cap": 4614243483648,
"volume": 112439494,
"fifty_two_week_high": 212.19,
"fifty_two_week_low": 86.62
}json
{
"symbol": "NVDA",
"price": 189.52,
"change": 3.05,
"change_percent": 1.64,
"previous_close": 186.47,
"market_cap": 4614243483648,
"volume": 112439494,
"fifty_two_week_high": 212.19,
"fifty_two_week_low": 86.62
}Technical Notes
技术说明
- Uses yfinance library to fetch data from Yahoo Finance
- No API key required
- Handles errors gracefully
- Works with most major stocks and ETFs
- Returns comprehensive data including market cap, volume, and 52-week range
- 使用yfinance库从雅虎财经获取数据
- 无需API密钥
- 优雅处理错误
- 支持绝大多数主流股票和ETF
- 返回包含市值、交易量、52周价格区间在内的全面数据
Troubleshooting
问题排查
- If the stock symbol is invalid, the script will return an error
- Some data (like market cap) may not be available for all symbols
- 如果股票代码无效,脚本会返回错误
- 部分数据(如市值)可能不是对所有代码都可用