Agent skill

Yfinance Data

by himself65 in himself65/finance-skills

Fetch financial and market data with the yfinance Python library (Yahoo Finance).

MITAuto-check passedBusiness, Finance & HR

Install Yfinance Data

skills CLI
$ npx skills add himself65/finance-skills --skill yfinance-data -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install himself65/finance-skills yfinance-data --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/himself65/finance-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/market-analysis/skills/yfinance-data .claude/skills/yfinance-data && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
yfinance-data
GitHub stars
3.4k
Token cost
~1.3k tokens
SKILL.md length
442 words
Files
3 (incl. references)
Skills in repo
22
Repo updated
First seen
Licence
MIT

At a glance

Fetch financial and market data with the yfinance Python library (Yahoo Finance).

  • Works in 4 steps: Ensure yfinance Is Available → Identify What the User Needs → Write and Execute the Code → …
  • The user wants stock data: current quotes and price history
  • SKILL.md covers Step 1: Ensure yfinance Is…, Step 2: Identify What the User…, Step 3: Write and Execute the… and Step 4: Present the Data, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Yfinance Data is an agent skill from himself65/finance-skills. Fetch financial and market data with the yfinance Python library (Yahoo Finance). Use this skill whenever the user wants stock data: current quotes and price history, financial statements (income statement, balance sheet, cash flow), options chains, dividends and splits, earnings and analyst estimates, price targets and ratings, institutional and insider holdings, news, multi-ticker comparisons, stock screens, or sector and industry data. Use it even when the user gives only a ticker symbol (AAPL, MSFT, TSLA) and…

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `README.md` and `references/api_reference.md`).

It sits in Business, Finance & HR, covering Stock and market analysis and Financial analysis. It works with yfinance and Python. The repository describes itself as: A collection of skills for AI financial analysis. The licence is MIT.

When your agent uses it

  • The user wants stock data: current quotes and price history
  • Financial statements (income statement
  • Dividends and splits
  • Earnings and analyst estimates

Example prompts

  • “/yfinance-data”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Ensure yfinance Is Available
  2. Identify What the User Needs
  3. Write and Execute the Code
  4. Present the Data

What it can do on your machine

Read from SKILL.md and the folder at commit 01fc7b4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Yfinance Data loads about 1.3k tokens when it runs, and up to ~3.6k if it reads all its reference files. Until then it costs about 176 tokens; SKILL.md has 442 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~176
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from himself65/finance-skills at commit 01fc7b4, republished under its MIT licence (© himself65). 442 words, ~1,255 tokens.

Download SKILL.mdSave it as .claude/skills/yfinance-data/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
yfinance-data
description
Fetch financial and market data with the yfinance Python library (Yahoo Finance). Use this skill whenever the user wants stock data: current quotes and price history, financial statements (income statement, balance sheet, cash flow), options chains, dividends and splits, earnings and analyst estimates, price targets and ratings, institutional and insider holdings, news, multi-ticker comparisons, stock screens, or sector and industry data. Use it even when the user gives only a ticker symbol (AAPL, MSFT, TSLA) and the intent has to be inferred. For earnings previews or recaps, estimate revisions, valuation, correlation, liquidity, or ETF premium analysis, prefer the dedicated skill.

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 "exec('try:\n import yfinance\n print(\'yfinance \' + yfinance.__version__ + \' installed\')\nexcept Exception:\n print(\'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 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.screen() + yf.EquityQuery
Sector/industry dataMarket datayf.Sector / yf.Industry
NewsNewsticker.news

Step 3: Write and Execute the Code

General pattern
python
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.
Show full SKILL.md (133 more words)Show less
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

Answer with the numbers the user asked for first, then the supporting table (markdown, or a trimmed DataFrame with the key columns). Call out anything notable in the data — an earnings beat or miss, unusual volume, a dividend change — and add context such as sector averages, historical ranges, or analyst consensus where it changes how the numbers read. If the user wants a chart, pair the data with a visualization.


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.

© himself65, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in plugins/market-analysis/skills/yfinance-data of himself65/finance-skills.

  • SKILL.md
  • README.md
  • references/api_reference.md

Open the folder on GitHubat commit 01fc7b4

Compare with similar skills

Yfinance Data next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Yfinance Data compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Yfinance Data this skillhimself65/finance-skills3.4k—~1.3kAutomated safety check: PassMIT
Fin Yfinance Datacriptogus/agent-evolve-network288—~806Automated safety check: PassMIT
US Market Data ToolkitGeeksfino/finskills283—~1.2kAutomated safety check: PassApache-2.0
Value Stock Screenerokikusan-public/stock_skills135—~2.4kAutomated safety check: PassNone
AKShare Financial DataHKUDS/Vibe-Trading35k—~777Automated safety check: PassMIT
Fundamental Factor ScreeningHKUDS/Vibe-Trading35k—~1.7kAutomated safety check: PassMIT

Similar skills

  • Fin Yfinance Data

    criptogus/agent-evolve-network

    Fetch market and fundamental data via the yfinance Python library — quotes, OHLC history, financial statements, holders, dividends, options, and more.

    288 GitHub stars~806 tokensUpdated 28 days ago
    Business, Finance & HRAuto-check passed
  • US Market Data Toolkit

    Geeksfino/finskills

    Free Python scripts that fetch US stock data, SEC filings, insider trades and macro indicators, and run financial score calculators and portfolio analytics.

    283 GitHub stars~1.2k tokensUpdated 7 mo ago
    Business, Finance & HRAuto-check passed
  • Value Stock Screener

    okikusan-public/stock_skills

    Screens for undervalued stocks across about 60 regions with yfinance's EquityQuery, using ratios such as PER, PBR, dividend yield and ROE, with optional theme filters.

    135 GitHub stars~2.4k tokensUpdated 5 mo ago
    Business, Finance & HRAuto-check passed
  • AKShare Financial Data

    HKUDS/Vibe-Trading

    Pulls free market data from the AKShare Python library: A-share, US and Hong Kong prices, futures, China macro series and forex, with notes on symbol formats and Chinese column names.

    35k GitHub stars~777 tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Builds value or growth stock screens from PE, PB, ROE and financial statement fields for backtests, using tushare data for A-shares and yfinance for Hong Kong and US stocks.

    35k GitHub stars~1.7k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Yahoo Finance

    24mlight/StockClaw

    Get stock prices, quotes, fundamentals, earnings, options, dividends, and analyst ratings using Yahoo Finance.

    101 GitHub starsUsed in 2 repos~1.1k tokens
    Business, Finance & HRAuto-check: notes

More from himself65/finance-skills

All 22 skills in this repo
  • Company Valuation

    himself65/finance-skills

    Estimate a public company's intrinsic value with DCF, relative (peer multiple), and sum-of-the-parts (SOTP) methods, then blend them into an implied share price with upside/downside vs the market…

    3.4k GitHub stars~3.3k tokensUpdated 2 days ago
    Auto-check passed
  • Discord Reader

    himself65/finance-skills

    Read Discord for financial research through opencli connected to the Discord desktop app: servers, channels, members, recent messages in the active channel, and message search.

    3.4k GitHub stars~1.8k tokensUpdated 2 days ago
    Auto-check passed
  • Earnings Preview

    himself65/finance-skills

    Build a pre-earnings briefing for a stock from Yahoo Finance data (yfinance): the upcoming report date and timing, consensus EPS and revenue estimates with their range, the beat/miss track record…

    3.4k GitHub stars~1.4k tokensUpdated 2 days ago
    Auto-check passed
  • Earnings Recap

    himself65/finance-skills

    Analyze a company's most recent (or a specified past) earnings report from Yahoo Finance data (yfinance): actual vs estimated EPS, surprise size, revenue and margin trends, and the stock's price…

    3.4k GitHub stars~1.7k tokensUpdated 2 days ago
    Auto-check passed
  • Estimate Analysis

    himself65/finance-skills

    Analyze sell-side analyst estimates and how they are changing, using Yahoo Finance data (yfinance): EPS and revenue consensus by period, estimate ranges and dispersion, revision trends over…

    3.4k GitHub stars~1.8k tokensUpdated 2 days ago
    Auto-check passed
  • Fintel Data

    himself65/finance-skills

    Query Fintel (fintel.io) institutional market data through its REST API or official MCP server.

    3.4k GitHub stars~2.2k tokensUpdated 2 days ago
    Auto-check: notes

Works with

Questions about Yfinance Data

What does Yfinance Data do?

Fetch financial and market data with the yfinance Python library (Yahoo Finance). Yfinance Data is an agent skill from himself65/finance-skills. Fetch financial and market data with the yfinance Python library (Yahoo Finance).

When should I use Yfinance Data?

Yfinance Data fits situations like: the user wants stock data: current quotes and price history; financial statements (income statement; dividends and splits; earnings and analyst estimates.

How do I install Yfinance Data in Claude Code?

Run `npx skills add himself65/finance-skills --skill yfinance-data -a claude-code`. Or copy the skill folder (plugins/market-analysis/skills/yfinance-data in himself65/finance-skills) into .claude/skills/yfinance-data in your project. Claude Code loads it when a task matches its description.

How do I install Yfinance Data in Codex?

Run `npx skills add himself65/finance-skills --skill yfinance-data -a codex`. Or copy the skill folder (plugins/market-analysis/skills/yfinance-data in himself65/finance-skills) into .agents/skills/yfinance-data in your project. Codex loads it when a task matches its description.

Can I use Yfinance Data in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add himself65/finance-skills --skill yfinance-data -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/yfinance-data, .gemini/skills/yfinance-data, .github/skills/yfinance-data and .opencode/skills/yfinance-data in your project.

What does Yfinance Data need to run?

SKILL.md names no scripts, command-line tools or credentials: Yfinance Data is instructions for the agent only. Our summary lists: Python 3.

Does Yfinance Data access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Yfinance Data safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Yfinance Data use?

Yfinance Data is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Yfinance Data use?

About 1.3k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.3k tokens, read only when the agent opens those files.

What are the alternatives to Yfinance Data?

Skills that share tags, products or a category with Yfinance Data: Fin Yfinance Data (criptogus/agent-evolve-network, 288 stars), US Market Data Toolkit (Geeksfino/finskills, 283 stars), Value Stock Screener (okikusan-public/stock_skills, 135 stars) and AKShare Financial Data (HKUDS/Vibe-Trading, 35k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Yfinance Data?

himself65 (a GitHub user) maintains it in himself65/finance-skills, which has 3,382 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on October 5, 2026.

Source: himself65/finance-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.