Markets and trading · Edition No. 30 · 24 Sep 2026

ranaroussi/yfinance

A Python library that fetches historical prices, dividends, company financial statements and option chains from Yahoo Finance and returns them as pandas dataframes.

← Markets and tradingRead the whole edition →

25,217 stars · Apache-2.0 · 1.7.0 (2026-08-26, ungh; pypi.org is blocked by robots.txt from this sandbox) · Track this in Scout

A Python library that fetches historical prices, dividends, company financial statements and option chains from Yahoo Finance and returns them as pandas dataframes.

▶Repo detailsthe review · specs · pros & cons · install

What it is

yfinance is a Python library that fetches historical prices, dividends, company financial statements and option chains from Yahoo Finance's public endpoints and returns them as pandas dataframes. It handles the request details, caching and rate limiting behind one simple call.

What it is good for. The situation where you want to test an idea about markets and the first obstacle is that every data provider wants a subscription before you have written a line. It is also the quickest way to build a table of prices for a hobby portfolio.

Stars25,217
LicenceApache-2.0
Latest1.7.0 (2026-08-26, ungh; pypi.org is blocked by robots.txt from this sandbox)
Good
  • Free, and it covers shares, indices, currencies, funds and cryptocurrency in one interface.
  • The output is a pandas dataframe, so it drops straight into the rest of the Python analysis world with no conversion.
  • Very widely used, which means almost every question has been asked and answered somewhere.
Watch for
  • It is not affiliated with Yahoo, and the project says so plainly. Yahoo's terms describe the data as being for personal use, so read them before building anything commercial on top.
  • The data source is unofficial and can break. When Yahoo changes something the library stops working until a new version appears, which has happened more than once.
  • The history is not clean. Splits, dividends and delisted companies all have edge cases, and a backtest that trusts the raw numbers will flatter itself.
Similar repositories
Install
python3 -m venv venv
source venv/bin/activate
pip install yfinance
python3 -c "import yfinance as yf; print(yf.Ticker('MSFT').history(period='1mo'))"
Screenshots
ranaroussi/yfinance: GitHub preview card

Get the next edition in your inbox

A dozen repositories, opened and checked. The licence read, the last release dated, and the ones that did not make it named with the reason. It is the half most lists leave out.

No tracking pixels. One click to leave. The archive stays free either way.

We use your address to send the edition and nothing else. Confirm by email, leave in one click. How we handle it.