What problem does it solve?
yfinance eliminates the time-consuming effort of manually gathering market data by providing a single interface to download historical prices and fundamental datasets from Yahoo Finance across US and HK-listed instruments.
Core Features & Use Cases
- Historical OHLCV (multi-interval): Retrieve daily and minute-level bars (with Yahoo Finance-imposed limits) for stocks, ETFs, indices, and FX pairs.
- Fundamentals and corporate actions: Pull company info, financial statements, dividends, splits, and corporate actions for analysis and model features.
- Holdings and transactions: Access institutional holders, major holders summaries, and insider transactions to support valuation and sentiment research.
- Use Case: Backtest a strategy on a mix of US and HK tickers by specifying source: "yfinance" (or "auto") and letting the loader handle ticker normalization.
Quick Start
Install yfinance and pandas, then download historical daily bars by running the yfinance Python snippet to fetch AAPL from 2025-01-01 to 2026-01-01 and print the first rows.