yfinance wraps Yahoo Finance public APIs so Python code can pull quotes, history, fundamentals, options, and related market metadata. It is unofficial and meant for research and education.
Overview
yfinance is a Python package for downloading financial and market data from Yahoo Finance. It exposes high-level types for one symbol, many symbols, bulk downloads, market metadata, live streaming via WebSocket helpers, search results, sector and industry lookups, and equity screening queries.
Typical calls fetch ticker info, calendars, analyst price targets, financial statements, historical prices with dividend-aware autoadjust defaults, and option chains. Multi-ticker workflows batch requests or use the shared download helper for several symbols at once.
It is not affiliated with Yahoo, and users must follow Yahoo terms of use for downloaded data, including personal-use limits on the underlying API. Installation is via pip from PyPI; optional install paths exist for environments without certain HTTP dependencies.
Documentation includes quick-start examples for single tickers, baskets, and fund holdings such as ETF top positions.
Key features
- Single and multi-ticker objects
- Historical price download helper
- Fundamentals and calendar fields
- Options chain access
- Live WebSocket streaming types
- Market search quotes and news
- Equity screener query builder
- Sector and industry metadata
Use cases
- Research notebooks on equities
- Batch historical price export
- Option chain analysis scripts
- ETF holdings inspection
- Market screening prototypes