yfinance
by Ran Aroussi and contributors · Library · also known as yahoo-finance (Python)
Open-source Python library that downloads price history, fundamentals, options chains and fund data from Yahoo Finance's unofficial endpoints for research and education
Overview
yfinance is an Apache-2.0 Python library by Ran Aroussi that retrieves data from Yahoo Finance's public but undocumented web endpoints. Through Ticker, Tickers and download() it returns price history at daily and intraday intervals, dividends and splits, company information and calendars, analyst targets, financial statements, options chains, holders and fund holdings as pandas objects, with caching and session handling to reduce rate-limit problems. Version 1.7.0 is current on PyPI at the time of writing.
The project states that it is intended for research and educational purposes, is not affiliated with or endorsed by Yahoo, and that users' rights to the data are governed by Yahoo's terms, which describe the API as intended for personal use. Because it scrapes an unofficial interface, breakage after Yahoo changes, throttling, gaps and silent data revisions are recurring issues, and the data should not be redistributed or used as the sole source for publishable results without verification against a licensed vendor.
Capabilities
- Price history at daily and intraday intervals
- Dividends, splits and corporate actions
- Financial statements and company info
- Options chains
- Holders, analyst targets and fund holdings
- Batch download for many tickers
- pandas DataFrame output
Typical workflows
- Quick exploratory charts in a notebook
- Teaching data retrieval in an introductory finance course
Strengths
- Free and open source
- Simple pandas-based API
- Broad global ticker coverage
Limitations
- Unofficial endpoints; breaks when Yahoo changes
- Yahoo terms describe personal use only
- Rate limiting and data gaps
- Unsuitable as sole source for publishable research
Prerequisites
- Python with pandas
Who it is for
- Students and hobbyists
- Researchers prototyping before buying licensed data
Alternatives & comparison
Alpha Vantage offers a licensed free tier with documented limits; Massive, FirstRate Data and Databento are paid vendors with defined licences and support. yfinance trades those guarantees for zero cost and convenience.
- Alpha Vantage
REST API for stock, ETF, options, forex, crypto, commodity and economic data plus fundamentals, news sentiment and technical indicators, with a free key tier and premium plans
ProprietaryFreemium - Databento
Usage-priced market data platform with normalized order-book (MBO/MBP), trades, OHLCV and reference schemas for futures, options and equities, delivered via historical, live and batch APIs in the DBN format
MixedUsage-based - FirstRate Data
Vendor of historical intraday market data (1-minute to daily bars, tick and options) for US stocks, ETFs, futures, indices, crypto and FX, delivered as zipped CSV bundles under a perpetual licence
ProprietaryPaid - Massive (formerly Polygon.io)
Market data platform (renamed from Polygon.io in October 2025) with REST and WebSocket APIs, flat files and SQL access for US stocks, options, indices, forex, crypto and futures
ProprietaryPaid
Sources & verification
Primary sources consulted for this record. Claims are tied to the fields each source supports; the automated link checker re-verifies every URL on a schedule.
- Licenseyfinance LICENSE.txtchecked Nov 1, 2026
https://github.com/ranaroussi/yfinance/blob/main/LICENSE.txt
Supports: license_spdx, source_model
- Official documentationyfinance documentationchecked Nov 1, 2026
https://ranaroussi.github.io/yfinance
Supports: name, summary, capabilities, limitations
States not affiliated with Yahoo; Yahoo API intended for personal use
- Official sitechecked Nov 1, 2026
- Repositorychecked Nov 1, 2026
- Confidence
- High
- Reviewed
- Nov 1, 2026
- Links
- Verified · Nov 2, 2026
Spotted an error?
More in Market & fundamentals data
FRED (Federal Reserve Economic Data)
Federal Reserve Bank of St. Louis · Market & fundamentals data
Free economic database from the St. Louis Fed aggregating hundreds of thousands of US and international time series, with graphs, vintages (ALFRED), an Excel add-in and a keyed JSON/XML API
Interactive Brokers API
Interactive Brokers LLC · Financial analysis & investing
Programmatic trading and market-data access to Interactive Brokers accounts through the TWS API, the REST-based Web API and FIX
QuantConnect
QuantConnect Corporation · Financial analysis & investing
Algorithmic trading platform built on the open-source LEAN engine, with cloud backtesting, research notebooks and brokerage-connected live trading
Statistics Canada
Statistics Canada (Government of Canada) · Open & public data
Canada's national statistical agency publishing census, economic and social data tables with open licensing and programmatic access via Web Data Service
OpenFIGI
Bloomberg L.P. (FIGI Registration Authority) · Market & fundamentals data
Free API and web tool from Bloomberg for mapping tickers, ISINs, CUSIPs and other identifiers to public-domain FIGI instrument identifiers, with search and filter endpoints
Wharton Research Data Services (WRDS)
The Wharton School, University of Pennsylvania · Market & fundamentals data
Institution-subscribed research data platform from Wharton hosting CRSP, Compustat, TAQ, OptionMetrics and dozens of other vendors' databases with web queries, SQL, SAS, Python and R access