Yahoo Finance (unofficial) API
Widely-used community endpoints for Yahoo stock quotes and historical data.
What it does
There is no official public Yahoo Finance API (the last one was retired in 2017). ‘Yahoo Finance API’ refers to the undocumented JSON endpoints behind finance.yahoo.com — query1.finance.yahoo.com/v8/finance/chart/{symbol}, /v7/finance/quote, /v10/finance/quoteSummary/{symbol} — used by libraries like yfinance.
Base URL
Authentication
No key. Some endpoints (notably /v7/finance/quote) now require a crumb token plus a matching cookie obtained by first loading a Yahoo page. This changes without notice — a maintained wrapper library is the practical way to keep up.
Code examples
curl -s "https://query1.finance.yahoo.com/v8/finance/chart/AAPL?range=5d&interval=1d" \ -H "User-Agent: Mozilla/5.0"
import yfinance as yf
aapl = yf.Ticker("AAPL")
hist = aapl.history(period="5d")
print(hist["Close"])Rate limits & quotas
Undocumented and actively rate-limited — heavy scraping gets HTTP 429 and IP throttling, and the endpoints, required headers and response shapes have all changed multiple times. There is no support channel and no SLA. Yahoo’s terms do not authorise programmatic use.
Key response fields
| chart.result[0].meta.regularMarketPrice | Latest price (v8 chart endpoint) |
| chart.result[0].timestamp[] + indicators.quote[0] | OHLCV arrays for the range |
| quoteResponse.result[] | Quote objects (v7, needs crumb+cookie) |
| quoteSummary.result[0] | Modules: financialData, summaryDetail, defaultKeyStatistics… |
Common errors
| 401 / "Invalid Crumb" | Missing or stale crumb/cookie pair — refetch both. |
| 429 | Rate limited — slow right down; consider a real data provider. |
| 404 | Unknown symbol, or the endpoint/version was changed or removed. |
| (schema drift) | Fields disappear or move between undocumented revisions — code defensively. |
When to use it (and alternatives)
Acceptable for personal research, notebooks and quick scripts where an occasional break is fine — and then only through a maintained library (yfinance, yahoo-finance2). For anything you ship, use a real API with terms and support: Twelve Data, Finnhub, Polygon.io or Alpha Vantage.
FAQ
Is there a real Yahoo Finance API?
Not a public one. Yahoo shut down its official API in 2017. Everything since is reverse-engineered from the website’s internal calls.
Why does my code work one week and break the next?
Because you are depending on private endpoints Yahoo can and does change — new crumb requirements, renamed fields, moved paths. Pin a wrapper library and expect to update it.
Can I use it in a commercial product?
No — it is neither authorised by Yahoo’s terms nor reliable enough. License data from a provider that sells it.
New to APIs?
Short guides for working with this API — and any other.