360 Secure SkillHub
360 安全技能中心

stock-price-checker

通过 Python 脚本调用 yfinance 库从 Yahoo Finance 获取指定股票代码的当前价格、涨跌幅、市值、成交量及 52 周高低点,以 JSON 格式输出,无需 API Key,单次命令即可完成。

rupprath
rupprath
热度 96.91
最近更新 2026-05-11 15:51:03
分类:搜索依赖:代码执行 / 第三方 API应用场景:财务

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add stock-price-checker
Metadata
name
stock-price-checker
description
Check stock prices using yfinance library. No API key required.
homepage
https://finance.yahoo.com
metadata
{"clawdbot":{"emoji":"📈","requires":{"bins":["python3","yfinance"]}}}

Stock Price Checker

Get current stock prices from Yahoo Finance using the yfinance library.

Quick Commands

cd skills/stock-price-checker

# Check stock price
python3 stock-price.py NVDA

# Check another stock
python3 stock-price.py AAPL

Usage Examples

Check NVIDIA stock:

python3 stock-price.py NVDA

Check VOO (S&P 500 ETF):

python3 stock-price.py VOO

Check QQQ (Nasdaq-100 ETF):

python3 stock-price.py QQQ

Check any stock symbol:

python3 stock-price.py TSLA
python3 stock-price.py MSFT
python3 stock-price.py AAPL

Output Format

{
  "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

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