Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
himself65 avatar

Yfinance Data

  • 2.2k installs
  • 3.1k repo stars
  • Updated July 21, 2026
  • himself65/finance-skills

yfinance-data fetches Yahoo Finance market and fundamental data through the yfinance Python package.

About

The yfinance-data skill guides agents to pull quotes, historical OHLCV, balance sheets, income statements, cash flows, dividends, splits, options chains, earnings, analyst targets, recommendations, institutional holders, news, and screener results via the yfinance library. Workflow checks installation, maps user intent to API methods using a reference table, and executes Python with try/except for rate limits and empty responses. Rules cover multi-ticker downloads, quarterly statement prefixes, intraday range limits, timezone-aware indices, and readable DataFrame output. Agents infer intent from ticker mentions even without explicit finance wording. Data is for research and educational use, not affiliated with Yahoo. Use when users ask for stock prices, financials, options, dividends, analyst ratings, or comparative downloads across tickers.

  • Maps user requests to yfinance Ticker methods and bulk download APIs.
  • Checks and installs yfinance before executing market data scripts.
  • Covers quotes, statements, options, holders, news, and screeners.
  • Documents period, interval, timezone, and rate-limit handling.
  • Infers finance intent from ticker symbols in casual queries.

Yfinance Data by the numbers

  • 2,218 all-time installs (skills.sh)
  • +127 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #67 of 1,106 Finance & Trading skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

yfinance-data capabilities & compatibility

Capabilities
ticker quotes · historical ohlcv · financial statements · options chains
Use cases
data analysis · trading
npx skills add https://github.com/himself65/finance-skills --skill yfinance-data

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2.2k
repo stars3.1k
Security audit2 / 3 scanners passed
Last updatedJuly 21, 2026
Repositoryhimself65/finance-skills

How do I get AAPL financials, price history, or options data in Python?

Fetch stock prices, financial statements, options chains, and market data from Yahoo Finance using the yfinance Python library.

Who is it for?

Research scripts needing quick Yahoo Finance quotes and fundamentals.

Skip if: Production trading systems requiring licensed real-time feeds.

When should I use this skill?

User mentions tickers, stock price, earnings, options chain, or yfinance.

What you get

Executed Python returning the requested quotes, statements, or historical series with handled errors.

  • Python data-fetch scripts
  • Ticker financial DataFrames
  • Historical price series exports

By the numbers

  • Covers price, fundamentals, options, dividends, earnings, and analyst recommendation datasets via yfinance

Files

SKILL.mdMarkdownGitHub ↗

yfinance Data Skill

Fetches financial and market data from Yahoo Finance using the 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:

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 RequestData CategoryPrimary Method
Stock price, quoteCurrent priceticker.info or ticker.fast_info
Price history, chart dataHistorical OHLCVticker.history() or yf.download()
Balance sheetFinancial statementsticker.balance_sheet
Income statement, revenueFinancial statementsticker.income_stmt
Cash flowFinancial statementsticker.cashflow
DividendsCorporate actionsticker.dividends
Stock splitsCorporate actionsticker.splits
Options chain, calls, putsOptions dataticker.option_chain()
Earnings, EPSAnalysisticker.earnings_history
Analyst price targetsAnalysisticker.analyst_price_targets
Recommendations, ratingsAnalysisticker.recommendations
Upgrades/downgradesAnalysisticker.upgrades_downgrades
Institutional holdersOwnershipticker.institutional_holders
Insider transactionsOwnershipticker.insider_transactions
Company overview, sectorGeneral infoticker.info
Compare multiple stocksBulk downloadyf.download()
Screen/filter stocksScreeneryf.Screener + yf.EquityQuery
Sector/industry dataMarket datayf.Sector / yf.Industry
NewsNewsticker.news

---

Step 3: Write and Execute the Code

General pattern

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 handling — yfinance returns tz-aware datetime indices (e.g., America/New_York). When comparing dates, always use pd.Timestamp(..., tz=...) or strip timezones with .tz_localize(None). See the reference file for details.

Valid periods and intervals

Periods1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max
Intervals1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo

---

Step 4: Present the Data

After fetching data, present it clearly:

1. Summarize key numbers in a brief text response (current price, market cap, P/E, etc.) 2. Show tabular data formatted for readability — use markdown tables or formatted DataFrames 3. Highlight notable items — earnings beats/misses, unusual volume, dividend changes 4. Provide context — compare to sector averages, historical ranges, or analyst consensus when relevant

If the user seems to want a chart or visualization, combine with an appropriate visualization approach (e.g., generate an HTML chart or describe the trend).

---

Reference Files

  • references/api_reference.md — Complete yfinance API reference with code examples for every data category

Read the reference file when you need exact method signatures or edge case handling.

Related skills

How it compares

Pick yfinance-data over generic Python skills when the task specifically needs Yahoo Finance tickers and yfinance API patterns rather than unrelated data sources.

FAQ

Does yfinance need installation each session?

The skill checks import status and pip installs yfinance when missing.

How do I compare multiple tickers?

Use yf.download() for faster multi-ticker historical downloads.

What about intraday limits?

1m data spans about seven days and 1h about 730 days per yfinance constraints.

Is Yfinance Data safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.