A Python library for downloading market data from Yahoo! Finance's public API.
yfinance is a Python library that provides a programmatic interface to download financial market data from Yahoo! Finance. It solves the problem of accessing historical stock prices, company information, and market metrics through a clean Python API instead of manual web scraping or using complex financial data services.
Python developers, quantitative analysts, researchers, and students who need reliable access to financial market data for analysis, backtesting trading strategies, or educational projects.
Developers choose yfinance because it offers a simple, well-documented Pythonic interface to Yahoo! Finance's data that's free to use, actively maintained by the community, and supports both historical data downloads and real-time streaming capabilities.
Download market data from Yahoo! Finance's API
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides intuitive classes like Ticker and Tickers that abstract HTTP requests, allowing data fetching with minimal code, as shown in the clean API examples in the README.
Supports historical prices, dividends, splits, real-time streaming via WebSocket, and market screening tools, covering most financial analysis needs without requiring multiple libraries.
With high PyPI download counts and regular updates, the library is well-maintained by contributors, and the new documentation website indicates ongoing development.
Unlike paid services, yfinance is completely free to use and modify, lowering barriers for research and education, as emphasized in its Apache license.
Relies on Yahoo's publicly available APIs which can change or break without notice, leading to unexpected issues, as warned in the legal disclaimers about non-affiliation.
The README explicitly states it's for personal use only per Yahoo's terms, making it risky for commercial applications without proper licensing.
As a free service, data accuracy and timeliness are not guaranteed, which can impact sensitive financial decisions or backtesting results.