Open-source project
ranaroussi/yfinance avatar
ranaroussi/yfinance

yfinance reads Yahoo Finance's public APIs without Yahoo's blessing, and the licence on the data is not the licence on the code

Download market data from Yahoo! Finance's API

26,005 stars3,505 forksPythonApache-2.0

At a glance

What is it?
yfinance is an Apache-2.0 Python library that pulls prices, search results, sector data and live streams from Yahoo Finance. The code license is clear. The data terms belong to Yahoo, and the project says so repeatedly.
Who is it for?
yfinance fits research notebooks, teaching and personal scripts that need Yahoo Finance prices in pandas without writing HTTP code. It does not fit a commercial product or a redistributed dataset, because the project states the Yahoo API is for personal use and the data rights sit with Yahoo's terms.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 4 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • ranaroussi/yfinance26,005 ★ · +542
Star history
Repository2026-10-082026-11-25
ranaroussi/yfinance25.5k26k

542 Stars in the last 48 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Yahoo owns the data terms, and the README tells you to go read them

yfinance opens with a trademark and affiliation warning. Yahoo!, Y!Finance and Yahoo! finance are registered trademarks of Yahoo, Inc., and the project states it is not affiliated, endorsed or vetted by Yahoo. It describes itself as an open-source tool that uses Yahoo's publicly available APIs, intended for research and educational purposes.

The warning then turns practical. You should refer to Yahoo's terms of use, linked three times, for details on your rights to use the data you download. The README adds that the Yahoo finance API is intended for personal use only. The Legal Stuff section repeats the whole disclaimer under the word AGAIN.

Two licences are in play. The library is distributed under the Apache Software License, with the text in LICENSE.txt. The data coming through it falls under Yahoo's terms. Whether using yfinance is legal cannot be answered by the Apache licence alone, and the README does not claim it can.

One install line pulls in curl_cffi, pandas and a dozen other packages

Installation is a single command:

code
pip install yfinance

The README also notes that you can install without curl_cffi for a requests fallback, and points to the Advanced Installation page of the docs at ranaroussi.github.io/yfinance for those steps.

pyproject.toml shows what the default install brings. Dependencies include beautifulsoup4>=4.11.1, curl_cffi>=0.17 with a comment reading curl_cffi 0.17: security updates, lxml>=4.9.0, multitasking>=0.0.7, numpy>=1.16.5, pandas>=1.3.0, peewee>=3.16.2, platformdirs>=2.0.0, protobuf>=3.19.0, pytz>=2022.5, requests>=2.31 and websockets>=13.0.

An optional repair extra adds scipy>=1.6.3 and scikit-learn>=1.0. Classifiers list Python 3.6 through 3.13 and a Development Status of 4 - Beta, even though the release numbers have reached 1.x.

Prices come back adjusted by default because auto_adjust is True

A note in the README says prices are by default adjusted for dividends, with auto_adjust=True. Anyone comparing yfinance output against a broker statement or a charting site will see numbers that differ from the raw close for any stock that paid dividends. The price adjustment page in the documentation covers the detail, and the README itself gives no formula.

If you store history for backtests, the practical step is to set the argument explicitly instead of relying on the default. A default can change across major versions, and the README does not state whether this one has.

This single parameter explains many of the support questions a price library attracts. A column that looks wrong is often a correct adjusted value read against an unadjusted expectation.

Nine classes cover tickers, bulk downloads, live streams and screeners

The main components listed are Ticker for a single symbol, Tickers for several, and download for market data across multiple tickers in one call. Beyond prices, Market returns information about a market, and Search returns quotes and news from a search term. Sector and Industry give sector and industry information.

Two entries deal with live data: WebSocket and AsyncWebSocket stream market data, synchronous and asyncio flavours respectively. websockets>=13.0 in the dependency list supports them.

Screening uses EquityQuery to build a query and Screener to run it. The README gives no examples of any of these calls. For arguments and return types you need the new documentation website, which the README says is now live, or the source in the yfinance/ package.

Does yfinance still work? Only the Yahoo side can say

The first thing to ask is whether it still works. The repository gives a partial answer. It was last pushed on 2026-11-02 and is not archived. Releases are frequent: 1.5.2 on 2026-07-23, 1.6.0 on 2026-08-13 and 1.7.0 on 2026-08-26.

That cadence shows upkeep, but it cannot guarantee any particular call returns data today. yfinance reads Yahoo's public endpoints, and Yahoo is under no obligation to keep them stable. The README documents no rate limit and no retry policy.

The README also says the project relies on the community to investigate bugs and contribute code, with a CONTRIBUTING.md to follow. The repository holds both CHANGELOG.md and CHANGELOG.rst, so check them against the version you pin before upgrading.

Editorial conclusion

yfinance fits research notebooks, teaching and personal scripts that need Yahoo Finance prices in pandas without writing HTTP code. It does not fit a commercial product or a redistributed dataset, because the project states the Yahoo API is for personal use and the data rights sit with Yahoo's terms. Before building on it, read those three terms-of-use pages the README links, and decide whether auto_adjust=True matches the prices you expect.

Frequently asked questions

Does yfinance still work?

The repository was last pushed on 2026-11-02, is not archived, and released 1.7.0 on 2026-08-26. It depends on Yahoo's public APIs, so availability of any given call is controlled by Yahoo.

Is using yfinance legal?

The code is Apache-2.0, but the README says yfinance is not affiliated with Yahoo, is intended for research and educational purposes, and that the Yahoo API is for personal use only. You should read Yahoo's terms of use for your rights to the data.

how to install yfinance

Run pip install yfinance. To install without curl_cffi and fall back to requests, the README points to the Advanced Installation page of the documentation.

Official sources

  1. License: Apache-2.0
  2. Project website
  3. ranaroussi/yfinance on GitHub
  4. README
  5. Releases
Community

Where developers are discussing it

Posts on Hacker News, dev.to and Lobsters that link to this repository, found by our scan of those communities. 1 in the last 30 days; newest first.

Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/ranaroussi-yfinance.svg)](https://hysenlabs.com/projects/ranaroussi-yfinance)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/ranaroussi-yfinance.svg)](https://hysenlabs.com/projects/ranaroussi-yfinance)

Was this useful?