
Yfinance Data
Pull live and historical Yahoo Finance data—quotes, financials, options, and holders—inside your agent session without hand-writing yfinance scripts.
Overview
yfinance-data is an agent skill for the Idea phase that fetches stocks, fundamentals, and market series from Yahoo Finance via the yfinance Python library.
Install
npx skills add https://github.com/himself65/finance-skills --skill yfinance-dataWhat is this skill?
- Detects whether yfinance is installed and installs via pip when missing
- Covers prices, history, income/balance/cash flow, options chains, dividends, and earnings
- Handles ticker-only prompts by inferring full data intent from context
- Supports analyst targets, institutional holders, compare/screen style requests
- Documents that Yahoo data is unofficial and for research/education only
Adoption & trust: 1.3k installs on skills.sh; 2.7k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need reliable market or fundamental data for a ticker but do not want to write and debug yfinance boilerplate every time.
Who is it for?
Solo builders researching tickers, building finance demos, or scripting data pulls during early product discovery.
Skip if: Production trading systems that require licensed real-time feeds, compliance-grade market data, or workflows that must not run pip install or arbitrary Python in restricted environments.
When should I use this skill?
User asks for stock prices, tickers, financial statements, options, dividends, earnings, analyst data, or any Yahoo Finance market data—including when only a symbol is provided.
What do I get? / Deliverables
Your agent returns structured Yahoo Finance pulls—prices, statements, options, or screens—after ensuring yfinance is installed in the session.
- Fetched market or fundamental datasets for requested tickers
- Runnable Python using yfinance aligned to the user’s question
Recommended Skills
Journey fit
Market and ticker research usually happens before you commit to a fintech feature or trading-side project, so Idea → research is the natural shelf for “get me data on AAPL.” Competitor pricing, sector screens, and statement pulls are discovery work—you are validating numbers and narratives before build scope is locked.
How it compares
Use for quick Yahoo Finance research pulls in-agent—not a substitute for a paid market-data API or brokerage integration.
Common Questions / FAQ
Who is yfinance-data for?
Indie developers and agent users who need Yahoo Finance quotes, history, and fundamentals inside a coding session without maintaining custom yfinance snippets.
When should I use yfinance-data?
Use it in Idea research when screening stocks or comparing fundamentals, during Validate when pricing or market context informs scope, and in Build when wiring prototypes that need historical or statement data—whenever the user mentions tickers, earnings, options, or “get financi
Is yfinance-data safe to install?
Review the Security Audits panel on this Prism page and treat the skill like any package that runs pip install and network calls to Yahoo; data is unofficial and for research only.
SKILL.md
READMESKILL.md - Yfinance Data
# yfinance Data Skill Fetches financial and market data from Yahoo Finance using the [yfinance](https://github.com/ranaroussi/yfinance) Python library. **Important**: yfinance is not affiliated with Yahoo, Inc. Data is for research and educational purposes. --- ## Step 1: Ensure yfinance Is Available **Current environment status:** ``` !`python3 -c "import yfinance; print('yfinance ' + yfinance.__version__ + ' installed')" 2>/dev/null || echo "YFINANCE_NOT_INSTALLED"` ``` If `YFINANCE_NOT_INSTALLED`, install it before running any code: ```python import subprocess, sys subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "yfinance"]) ``` If yfinance is already installed, skip the install step and proceed directly. --- ## Step 2: Identify What the User Needs Match the user's request to one or more data categories below, then use the corresponding code from `references/api_reference.md`. | User Request | Data Category | Primary Method | |---|---|---| | Stock price, quote | Current price | `ticker.info` or `ticker.fast_info` | | Price history, chart data | Historical OHLCV | `ticker.history()` or `yf.download()` | | Balance sheet | Financial statements | `ticker.balance_sheet` | | Income statement, revenue | Financial statements | `ticker.income_stmt` | | Cash flow | Financial statements | `ticker.cashflow` | | Dividends | Corporate actions | `ticker.dividends` | | Stock splits | Corporate actions | `ticker.splits` | | Options chain, calls, puts | Options data | `ticker.option_chain()` | | Earnings, EPS | Analysis | `ticker.earnings_history` | | Analyst price targets | Analysis | `ticker.analyst_price_targets` | | Recommendations, ratings | Analysis | `ticker.recommendations` | | Upgrades/downgrades | Analysis | `ticker.upgrades_downgrades` | | Institutional holders | Ownership | `ticker.institutional_holders` | | Insider transactions | Ownership | `ticker.insider_transactions` | | Company overview, sector | General info | `ticker.info` | | Compare multiple stocks | Bulk download | `yf.download()` | | Screen/filter stocks | Screener | `yf.Screener` + `yf.EquityQuery` | | Sector/industry data | Market data | `yf.Sector` / `yf.Industry` | | News | News | `ticker.news` | --- ## Step 3: Write and Execute the Code ### General pattern ```python import subprocess, sys subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "yfinance"]) import yfinance as yf ticker = yf.Ticker("AAPL") # ... use the appropriate method from the reference ``` ### Key rules 1. **Always wrap in try/except** — Yahoo Finance may rate-limit or return empty data 2. **Use `yf.download()` for multi-ticker comparisons** — it's faster with multi-threading 3. **For options, list expiration dates first** with `ticker.options` before calling `ticker.option_chain(date)` 4. **For quarterly data**, use `quarterly_` prefix: `ticker.quarterly_income_stmt`, `ticker.quarterly_balance_sheet`, `ticker.quarterly_cashflow` 5. **For large date ranges**, be mindful of intraday limits — 1m data only goes back ~7 days, 1h data ~730 days 6. **Print DataFrames clearly** — use `.to_string()` or `.to_markdown()` for readability, or select key columns 7. **Timezone handl