yfinance is a Python library that downloads market data from Yahoo! Finance's API.
The library solves the problem of programmatically accessing financial market data by providing a Pythonic interface to Yahoo! Finance's publicly available APIs. It abstracts away the complexity of making direct API calls, allowing developers to fetch stock prices, historical data, and other market information with simple function calls. The tool works by querying Yahoo! Finance endpoints and returning data in formats suitable for analysis, particularly as pandas DataFrames.
Developers should choose yfinance for research, educational, and personal projects that require historical or current market data. It suits use cases ranging from simple stock price lookups to building financial analysis tools and backtesting systems. The library offers multiple access patterns: a Ticker class for single securities, a Tickers class for multiple securities, and a download function for batch operations. It also provides WebSocket and AsyncWebSocket components for live streaming data, market information retrieval, and equity screening capabilities. Users must be aware that yfinance is not affiliated with Yahoo! Inc. and relies on Yahoo's publicly available APIs, which are intended for personal use only. Developers should review Yahoo!'s terms of use before deploying the tool in production environments.
The project maintains active engagement with community contributions for bug investigation and code development. The tool includes multiple access patterns and streaming capabilities alongside traditional batch data retrieval. Development includes both synchronous and asynchronous interfaces for different integration scenarios. The library provides specialized components for market analysis, including sector and industry information retrieval and equity screening functionality.