
Yahoo Finance
Fetch market quotes and financial data from Yahoo Finance.
Install
npx skills add https://github.com/0juano/agent-skills --skill yahoo-financeWhat is this skill?
- Yahoo Finance data
- Market quotes
- Finance API
Adoption & trust: 1 installs on skills.sh; 1/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
China Stock Analysissugarforever/01coder-agent-skills
Backtesting Frameworkswshobson/agents
Grimoire Polymarketfranalgaba/grimoire
Wind Mcp Skillwind-information-co-ltd/wind-skills
Coinglassstarchild-ai-agent/official-skills
Stock Analysisgracefullight/stock-checker
Journey fit
Common Questions / FAQ
Is Yahoo Finance safe to install?
skills.sh reports 1 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Yahoo Finance
#!/usr/bin/env -S uv run --script # /// script # requires-python = ">=3.10" # dependencies = [ # "yfinance>=0.2.36", # "rich>=13.7", # ] # /// """Yahoo Finance CLI — tailored for fixed income / EM investors. Usage: yf <command> [args] [--json] Commands: price TICKER Quick price + change + volume quote TICKER Detailed quote (52w range, PE, yield, etc.) compare T1,T2,T3 Side-by-side comparison table credit TICKER Credit analysis: leverage, coverage, debt maturity macro Morning macro dashboard fx [BASE] LatAm FX rates flows ETF ETF top holdings + fund data history TICKER [PERIOD] Price history fundamentals TICKER Full financials (IS, BS, CF) news TICKER Recent news search QUERY Find tickers options TICKER Options chain (near-the-money calls & puts) dividends TICKER Dividend history, yield, payout ratio ratings TICKER Analyst recommendations & upgrades/downgrades """ import json import sys from datetime import datetime from io import StringIO import yfinance as yf from rich.console import Console from rich.table import Table from rich.panel import Panel from rich.text import Text console = Console() err_console = Console(stderr=True) def _json_mode() -> bool: return "--json" in sys.argv def _clean_args() -> list[str]: return [a for a in sys.argv[1:] if a != "--json"] def _safe_get(info: dict, key: str, default="N/A"): v = info.get(key) return default if v is None else v def _fmt_num(v, decimals=2, prefix="", suffix=""): if v is None or v == "N/A": return "N/A" try: n = float(v) if abs(n) >= 1e12: return f"{prefix}{n/1e12:.{decimals}f}T{suffix}" if abs(n) >= 1e9: return f"{prefix}{n/1e9:.{decimals}f}B{suffix}" if abs(n) >= 1e6: return f"{prefix}{n/1e6:.{decimals}f}M{suffix}" if abs(n) >= 1e3: return f"{prefix}{n/1e3:.{decimals}f}K{suffix}" return f"{prefix}{n:.{decimals}f}{suffix}" except (ValueError, TypeError): return str(v) def _fmt_pct(v, decimals=2): if v is None or v == "N/A": return "N/A" try: return f"{float(v)*100:.{decimals}f}%" if abs(float(v)) < 1 else f"{float(v):.{decimals}f}%" except (ValueError, TypeError): return str(v) def _color_change(v): if v is None or v == "N/A": return "N/A" try: n = float(v) color = "green" if n >= 0 else "red" sign = "+" if n >= 0 else "" return f"[{color}]{sign}{n:.2f}%[/{color}]" except (ValueError, TypeError): return str(v) def _get_ticker(symbol: str): t = yf.Ticker(symbol) info = t.info if not info or info.get("regularMarketPrice") is None and info.get("previousClose") is None: if info.get("symbol") is None: err_console.print(f"[red]Error: Ticker '{symbol}' not found[/red]") sys.exit(1) return t, info def cmd_price(args: list[str]): if not args: err_console.print("[red]Usage: yf price TICKER[/red]") sys.exit(1) symbol = args[0].upper() t, info = _get_ticker(symbol) price = _safe_get(info, "regularMarketPrice", _safe_get(info, "previousClose")) prev = _safe_get(info, "regularMarketPreviousClose", _safe_get(info, "previousClose")) change = change_pct = "N/A" if price != "N/A" and prev != "N/A": try: change = float(price) - float(prev) change_pct = (change / float(prev)) * 100 except (ValueError, TypeError, ZeroDivisionError): pass volume = _safe_get(info, "regularMarketVolume", _safe_get(info, "volume")) currency = _safe_get(info, "currency", "") name = _safe_get(info, "shortName", symbol) if _json_mode(): print(json.dumps({"symbol": symbol, "name": name, "price": price, "change": change, "changePct": change_pct, "vo