Quick answer
Yahoo Finance has no official API; the unofficial chart endpoint (query1.finance.yahoo.com/v8/finance/chart) returns free, keyless daily and intraday history for stocks, ETFs, indices, futures, forex and crypto. It can throttle or change without notice and restricts commercial use, so cache results and use a keyed vendor for production.
Yahoo Finance API at a glance
- Pricing
- Free, no key (unofficial)
- Availability
- Worldwide (unofficial endpoint)
- Paper trading
- Not applicable (data only)
- Integration type
- Public, no key
- In AlgoGP
- Built in: data adapter (Free)
- Endpoint
https://query1.finance.yahoo.com/v8/finance/chart/{symbol}- Symbols
AAPL,7203.T,^GSPC,GC=F,EURUSD=X,BTC-USD- History
- Decades of daily bars; 1h for ~730 days; 1m for ~30 days
- Status
- Unofficial: no SLA, can throttle or change
How the chart endpoint works
Request /v8/finance/chart/AAPL?interval=1d&period1={unix}&period2={unix} (or range=5y). The response holds a timestamp array and an indicators.quote[0] object with parallel open, high, low, close and volume arrays, plus indicators.adjclose for dividend- and split-adjusted closes.
| Interval | How far back |
|---|---|
1m | About the last 30 days, 7 days per request |
5m, 15m, 30m | About the last 60 days |
60m / 1h | About the last 730 days |
1d, 1wk, 1mo | The full listing history |
Yahoo symbol spelling
- US stocks and ETFs: the plain ticker, with a dash for share classes (
BRK-B). - Other exchanges: a suffix (
7203.TTokyo,VOD.LLondon,SAP.DEXetra). - Indices start with a caret (
^GSPC,^NDX,^VIX). - Continuous front-month futures end in
=F(ES=F,CL=F,GC=F). - Currencies end in
=X(EURUSD=X,JPY=X); crypto uses a dash (BTC-USD).
Risks of an unofficial API
Daily bars are stamped at the session open, so a strategy should only act on a bar after its session has closed. AlgoGP’s in-app engine releases each Yahoo bar one interval after its open for exactly this reason.
Use Yahoo Finance in AlgoGP
Open a project, go to the APIs & keys tab and, under Platforms, pick Yahoo Finance as the market data source (market_data.py). The choice is saved to config.json as a new strategy version:
{
"platforms": {
"data": "yahoo-finance",
"broker": "alpaca"
}
}backtest.py and live.py connect to when you run the exported code.Yahoo Finance needs no API key: the generated code calls its public endpoints directly.
Yahoo Finance API: frequently asked questions
Is there an official Yahoo Finance API?
No. Yahoo closed its official API in 2017. The chart endpoint used here is the one the website calls; it is free but unsupported.
Does Yahoo Finance data include dividends?
Yes. adjclose reinvests dividends and adjusts for splits, and events=div,splits returns the corporate actions themselves.
Why is my Yahoo request returning 429?
Too many requests from one IP. Slow down, cache responses and retry with backoff.
Turn Yahoo Finance data into a tested strategy
Backtest an idea in the browser, then export Python whose live loop reads candles straight from Yahoo Finance with your own key.
- Generated Yahoo Finance candle fetcher, closed bars only
- An AI copilot that writes and revises the rules
- Pair it with Alpaca, Binance, OANDA or another broker
Free plan, no card required.
Yahoo Finance alternatives
- Twelve Data API Built into AlgoGP (data)One API for global stocks, forex, crypto and ETFs with 1-minute to monthly bars and a generous free plan.
- Tiingo API Built into AlgoGP (data)Clean, curated end-of-day stock prices back decades, plus crypto and IEX intraday, at hobbyist prices.
- EODHD API Built into AlgoGP (data)EOD Historical Data: global end-of-day and intraday prices for 150k+ tickers, fundamentals, FX and crypto at low cost.
- Massive (Polygon.io) API Built into AlgoGP (data)Institutional-grade US stock, options, forex and crypto aggregates; Polygon.io renamed to Massive in 2025.
Comparisons
Independent guide. AlgoGP is not affiliated with Yahoo Finance. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.