yfinance
The Python library everyone starts with — free, unofficial, and not something to build on.
What it is
yfinance is a Python library that pulls price history, fundamentals, options chains and corporate actions from Yahoo Finance's internal endpoints and hands them back as pandas DataFrames. It costs nothing, needs no key, covers most of the world's exchanges, and is almost certainly what the tutorial you are reading uses.
It is also unofficial. There is no agreement behind it, no support, no uptime commitment and no rate limit you can plan against — Yahoo throttles by IP at a threshold nobody publishes. Every time Yahoo changes its endpoints, yfinance breaks for everyone simultaneously until a maintainer ships a fix.
That combination makes it excellent for research and a poor foundation for anything with users.
Data & coverage
Global, delayed, and deep on daily bars — intraday history is capped at roughly sixty days. Fundamentals are present and of uneven quality; treat anything surprising as a parsing artefact until a second source agrees.
Limitations
- No contract, no support, no SLA — by design, not by omission.
- Undocumented throttling; heavy use gets an IP blocked with no warning.
- Breaks whenever Yahoo changes an endpoint.
- Redistribution is not permitted.
- It is a library, not an API. It is catalogued here because that is where people look for it, and it will move to the libraries category when that opens.
Alternatives
If the reason you are considering yfinance is money, the free tiers of Alpha Vantage are smaller but contractual. If it is coverage, the paid providers in the market data category start around $30/month.
Source on GitHub.
Specifications
- History depth
- Decades of daily bars; intraday limited to roughly 60 days
- Delivery
- Library
- Data source
- Scraped
- Free tier limits
- No published limit — Yahoo throttles by IP and the threshold is undocumented
- Paid rate limits
- None
- Entry paid tier, $/mo
- No paid tier
- Entry tier name
- None
- Official SDKs
- —
- Redistribution
- Prohibited
- Bulk / flat-file download
- No
- Key without a card
- Yes
Capabilities
- Charting
- Screening
- Scanning
- Backtesting
- Automation
- Live trading
- Paper trading
- Portfolio tracking
- Broker import
- Tax reporting
- Alerts
- News
- Options analysis
- Interfaces:
- Python, Python
- Export:
- CSV, JSON
- Asset classes:
- Stocks, ETF, Options, Forex, Crypto, Indices, Mutual funds
- Markets:
- US, EU, UK, Asia, Global
- Platforms:
- Library
- AI features:
- None
FAQ
Is yfinance legal to use?
It reads Yahoo Finance's undocumented endpoints, which Yahoo's terms do not contemplate. Fine for personal research; not something to put under a product you charge for.
Why does yfinance keep breaking?
Because it depends on endpoints Yahoo never promised to keep. When Yahoo changes something, every user breaks at once and waits for a release. Budget for that or use a provider with a contract.
Is yfinance an API?
No — it is a Python library that fetches from Yahoo. It sits in this category because that is where people look for it, and it will move when the libraries category opens.