finds.dev← search

// the find

ranaroussi/yfinance

★ 24,258 · Python · Apache-2.0 · updated Jun 2026

Download market data from Yahoo! Finance's API

yfinance is a Python wrapper around Yahoo Finance's undocumented APIs, giving you historical prices, fundamentals, options chains, real-time quotes via WebSocket, and screener queries in a pandas-friendly interface. It's the de facto standard for retail quant/finance hobbyists who need market data without paying Bloomberg. The entire thing is built on an unofficial API that Yahoo has never sanctioned and can break without notice.

The breadth of data is impressive for a free tool: OHLCV history, dividends, splits, earnings calendars, institutional holders, options chains, and now live streaming via WebSocket and protobuf — that's `pricing.proto` doing real work, not a toy. The price repair logic (documented in `doc/source/advanced/price_repair.rst`, with before/after CSVs in `tests/data/`) actively corrects Yahoo's own bad dividend and split adjustments rather than silently serving garbage data. The `curl_cffi` fallback for requests is a practical choice that bypasses some of Yahoo's bot detection without requiring browser automation. Test coverage is unusually thorough for a scraper — dedicated test files per feature, with fixture CSVs for the tricky price repair cases.

The fundamental risk is that this entire library sits on top of undocumented, uncontracted Yahoo APIs — there's a reason `pytest.yml` is named `pytest.yml.disabled`. Any response schema change on Yahoo's end can silently break data fields rather than raising exceptions, which is a bad failure mode for anything financial. The `yahoo-keys.txt` file in `scrapers/` hints at the fragility: they're reverse-engineering key mappings from scraped pages. Rate limiting and auth handling are community-maintained best-effort, not engineered reliability — production use requires your own caching and retry layer on top. Yahoo's ToS explicitly limits this to personal/educational use, so if you're building anything that monetizes this data or runs at scale, you're on legally shaky ground from day one.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →