yfinance-data

yfinance-data is a skill for Claude Code from himself65/finance-skills. It costs 140 tokens per session (1,290 once invoked), scanned A, original, MIT.

A Python-based tool for retrieving stock and market data from Yahoo Finance, including prices, company accounts, options, dividends, earnings, and analyst information.

In plain words
What is it for?
Use it to retrieve current or historical prices, financial statements, options chains, dividend data, earnings, and analyst recommendations.
Why use it?
It provides market data for analysis without manually collecting figures from financial websites.

Skill for Claude Code

Written for Claude Code: dynamic context !`command`. Also seen: mentions Codex.

Part of the finance-market-analysis plugin — 11 skills shipped together

Good fit Use it to retrieve current or historical prices, financial statements, options chains, dividend data, earnings, and analyst recommendations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/himself65/finance-skills/yfinance-data
About the project

Finance Skills is a collection of agent skills for financial analysis and trading, covering activities such as company valuation, earnings research, market analysis, and options calculations. It is for users who want coding agents to perform structured finance workflows, and the catalogue contains its skills, plugins, instructions, and MCP integration.

himself65/finance-skills · 3,641 stars · on GitHub · skills.himself65.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add himself65/finance-skills --skill yfinance-data
Clone the repo
git clone --depth 1 https://github.com/himself65/finance-skills

Made for: Claude Code.

Or install finance-market-analysis, the plugin that ships this one along with the rest of its 11 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for yfinance-data

README.md
[![agentmods](https://agentmods.dev/badge/skills/himself65/finance-skills/yfinance-data/github.svg)](https://agentmods.dev/skills/himself65/finance-skills/yfinance-data)
Your own site
<a href="https://agentmods.dev/skills/himself65/finance-skills/yfinance-data"><img src="https://agentmods.dev/badge/skills/himself65/finance-skills/yfinance-data/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for yfinance-data

Your own site · 80×15
<a href="https://agentmods.dev/skills/himself65/finance-skills/yfinance-data"><img src="https://agentmods.dev/badge/skills/himself65/finance-skills/yfinance-data.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 140 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,290 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 19 Oct 2026
  • Snyk warn 19 Oct 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00140 $0.01290
Opus 5.5 $0.00056 $0.00516
Sonnet 5.5 $0.00028 $0.00258
Haiku 4.5 $0.00014 $0.00129

Measured 1mo ago against content hash 502db0ad9e13, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

yfinance-data scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "yfinance"])
plugins/market-analysis/skills/yfinance-data/SKILL.md · 112 lines

How it starts

The opening of the file, as written. The whole thing — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.

yfinance Data Skill

If your host has not already executed the shell probes below (for example, in Codex), run the commands inside the ! wrappers with its shell tool before choosing a setup path. Use the actual output; if shell access is unavailable, report that limitation.

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:

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.screen() + yf.EquityQuery
Sector/industry data Market data yf.Sector / yf.Industry
News News ticker.news

Read the full file on GitHub · 112 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +2 lines 502db0ad9e13
  2. 2mo ago Changed · -10 lines · -21 tokens per session 258750d51191
  3. 3mo ago First seen · 120 lines · 161 tokens per session scan A 3b4480be6b8f

Subscribe to this mod's changes

yfinance-data is a skill published in the GitHub repository himself65/finance-skills (3,641 stars, last pushed 1mo ago), licensed MIT. It adds 140 tokens to every session and 1,290 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

yfinance-data compared with skills from other repositories

yfinance-data next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
yfinance-datahimself65/finance-skillsSkill3.6k1mo agoMITA140Claude Code
quotientBankrBot/skillsSkill1.2ktodaynoneA201Claude Code, Codex
themonitorBankrBot/skillsSkill1.2ktodaynoneA128Claude Code, Codex
delu-oracleBankrBot/skillsSkill1.2ktodaynoneA87Claude Code, Codex
lonestaroracle-dataBankrBot/skillsSkill1.2ktodaynoneB58Claude Code, Codex
rhagentBankrBot/skillsSkill1.2ktodaynoneC142Claude Code, Codex
backtesting-simmahmoud20138/TradecraftSkill187mo agoMITA118Claude Code