Yahoo Finance API
Overview
Yahoo Finance provides unofficial access to stock quotes, historical prices, currency exchange rates, and cryptocurrency data through community-maintained libraries and endpoints. There has been no official public API since 2017, but many developers use wrapper libraries like yfinance (Python) to pull this data reliably. Be aware that the underlying endpoints can change without notice, so build in error handling.
Beginner Tip
Use the yfinance Python library instead of calling Yahoo Finance endpoints directly — it handles authentication headers and URL changes automatically.
Measurement Record
What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.
- Request
- GET https://query1.finance.yahoo.com/v8/finance/chart/AAPL?interval=1d&range=5d
- Result
- HTTP 200 · application/json · 1,609 bytes
- Response time
- 41 ms (median of 3) · fastest 34 ms
- Transport
- TLSv1.3 · TLS_AES_128_GCM_SHA256 · certificate issued by DigiCert Inc
- Browser CORS
- No Access-Control-Allow-Origin header — call it from a server, not the browser
- Served by
- ATS
- Recorded
- 2026-08-10
Fields Returned
Top-level fields present in the response we captured, with the type and value we actually received.
| Field | Type | Value received |
|---|---|---|
| chart | object | {2 fields} |
Captured Response
Captured from a real request to https://query1.finance.yahoo.com/v8/finance/chart/AAPL?interval=1d&range=5d on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.
{
"chart": {
"result": [
{
"…": "(3 more fields)"
}
],
"error": null
}
} Implementation Example
Calls a real endpoint of this API. Replace any placeholder credentials with your own key.
// Using unofficial internal endpoint (no guarantees)
const symbol = "AAPL";
const url = `https://query1.finance.yahoo.com/v8/finance/chart/${symbol}?interval=1d&range=5d`;
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
const meta = data.chart.result[0].meta;
console.log(`Symbol: ${meta.symbol}`);
console.log(`Current Price: $${meta.regularMarketPrice}`);
console.log(`Currency: ${meta.currency}`);
console.log("⚠️ Warning: This is an unofficial endpoint and may break without notice"); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
How This API Fails
We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.
Returned an HTML error page rather than JSON — worth knowing if your client assumes every response can be parsed as JSON.
{
"chart": {
"result": null,
"error": {
"code": "Bad Request",
"description": "Invalid input - interval=!!!invalid!!! is not supported. Valid intervals: [1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 4h, 1d, 5d, 1wk, 1mo, 3mo]"
}
}
} Common Errors & Troubleshooting
Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.
Measured Score Breakdown
Live HTTP request to the API endpoint
Fully tested on Aug 10, 2026
Technical Specifications
Similar APIs
View All →Alpha Vantage
⭐ Beginner's PickAlpha Vantage delivers free real-time and historical stock, forex, and cryptocurrency data through a simple REST API.
Polygon
Polygon.io is a comprehensive market data API providing real-time and historical stock, forex, and cryptocurrency data.
Finnhub
⭐ Beginner's PickFinnhub is a popular financial API offering real-time stock quotes, company fundamentals, news, forex rates, and cryptocurrency data through both REST and WebSocket connections.
Twelve Data
⭐ Beginner's PickTwelve Data provides real-time and historical stock, forex, cryptocurrency, and ETF market data through a clean and well-documented REST API.
Binlist
⭐ Beginner's PickBinlist gives you free access to a database of Bank Identification Numbers (BINs), the first 6-8 digits of any credit or debit card number that identify the issuing bank and card type.