Yahoo Finance API: Quotes, History and News as JSON
Perceptlayer's Yahoo Finance API returns what the Yahoo Finance site shows as JSON through five endpoints: search, quote, history, fundamentals and news. Each successful call costs 1 credit, and the quote endpoint takes a comma-separated symbols list, so one call can price a whole watchlist. This guide resolves tickers, reads quotes, pulls daily candles, fundamentals and headlines from recorded responses, then sizes a daily watchlist job in credits.
Which Yahoo Finance endpoints are there?
There are five endpoints, one per question you'd ask about a security: which symbol is this, what does it trade at, how has it moved, what do the company's numbers look like, and what's being written about it. All five are GET requests to https://api.perceptlayer.com/v1/yahoo-finance/, all cost 1 credit, and each takes a single required parameter. Only history has optional parameters.
| Path | Returns | Required | Optional | Credits |
|---|---|---|---|---|
/v1/yahoo-finance/search |
Matching symbols and related news | q |
none | 1 |
/v1/yahoo-finance/quote |
Quotes for one or more symbols | symbols |
none | 1 |
/v1/yahoo-finance/history |
Price candles and dividend events | symbol |
range, interval |
1 |
/v1/yahoo-finance/fundamentals |
Profile, statistics, earnings, statements | symbol |
none | 1 |
/v1/yahoo-finance/news |
Headlines for a symbol | symbol |
none | 1 |
The data is collected from publicly available sources and returned as found at the time of the call. It suits research, dashboards, enrichment and agents that need a reference reading on a ticker. It is not an execution feed, and nothing in this guide is investment advice. If you're weighing Yahoo's own offerings or other routes to the same data, compare their terms and coverage yourself against what you need.
Which parameters does each endpoint take?
Each endpoint takes one required string, and history adds two optional enums. The API documents only types, length limits and allowed values, so this table lists exactly that and nothing about defaults or page sizes. Keep symbols in the form the search endpoint returns them, such as AAPL, and the symbol and symbols values will line up across calls.
| Endpoint | Parameter | Type | Required | Documented constraint |
|---|---|---|---|---|
search |
q |
string | yes | Up to 100 characters |
quote |
symbols |
string | yes | Up to 200 characters |
history |
symbol |
string | yes | Up to 20 characters |
history |
range |
string | no | One of 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max |
history |
interval |
string | no | One of 1d, 1wk, 1mo |
fundamentals |
symbol |
string | yes | Up to 20 characters |
news |
symbol |
string | yes | Up to 20 characters |
The Yahoo Finance API page has a playground where you can run each endpoint with your key before you write code.
How do you find the right ticker?
Search by company name with q, then keep the symbol whose quote_type matches what you want. A name can match more than one instrument: in the recorded search for apple, the first result is the Nasdaq-listed equity and the second is a single-stock future on the CME. Filtering on quote_type keeps futures and other instruments out of an equity watchlist.
curl "https://api.perceptlayer.com/v1/yahoo-finance/search?q=apple" \
-H "X-API-Key: $API_KEY"
{
"query": "apple",
"quotes": [
{
"symbol": "AAPL",
"short_name": "Apple Inc.",
…
"quote_type": "EQUITY",
"exchange": "NMS",
"exchange_display": "NASDAQ",
"sector": "Technology",
"industry": "Consumer Electronics",
"score": 377565
},
{
"symbol": "SAAPL=F",
"short_name": "Apple Inc Stock Futures,Dec-202",
…
"quote_type": "FUTURE",
"exchange": "CME",
…
"score": 30144
}
],
"news": [
…
],
"source": "yahoo_finance"
}
The search response also carries a news array. In the recordings, its two items have the same uuid values as the two items in the news endpoint's response for AAPL.
How do you get quotes for a whole watchlist?
Send every ticker in one comma-separated symbols value and you get one entry per symbol in quotes. The recorded request asked for AAPL,MSFT (the comma is URL-encoded as %2C) and returned both in a single 1-credit call. The 200-character limit on symbols sets how many tickers fit; split longer lists across calls and check that every symbol you sent came back.
curl "https://api.perceptlayer.com/v1/yahoo-finance/quote?symbols=AAPL%2CMSFT" \
-H "X-API-Key: $API_KEY"
{
"quotes": [
{
"symbol": "AAPL",
"short_name": "Apple Inc.",
…
"price": 351.91,
"change": -0.869995,
"change_percent": -0.246611,
"volume": 36248936,
"market_cap": 5114019971072,
"day_high": 355.36,
"day_low": 349.67,
"fifty_two_week_high": 360.83,
"fifty_two_week_low": 243.42,
"currency": "USD",
"exchange": "NasdaqGS",
"market_state": "POST"
},
{
"symbol": "MSFT",
"price": 506.24,
"change": -11.75,
…
"market_state": "POST"
}
],
"source": "yahoo_finance"
}
Values are plain numbers, not display strings, so they go straight into a database. Store market_state with each row: the recorded quotes were taken with market_state POST, and a reading taken at another time of day may carry a different state.
Do quote and fundamentals agree?
Not field for field. Both recordings show an AAPL price of 351.91, but the quote's change is -0.869995 while the fundamentals response has fulldayChange of -2.350006. They are different fields from different endpoints, and the API doesn't document how each is computed. Pick one endpoint per metric and stick with it, so your history doesn't mix definitions.
How do you pull price history?
Call history with a symbol, a range and an interval. The response holds a candles array with date, timestamp, open, high, low, close, volume and adjusted_close, plus an events object. This is the recorded one-month, daily request for AAPL, trimmed to two candles:
curl "https://api.perceptlayer.com/v1/yahoo-finance/history?symbol=AAPL&range=1mo&interval=1d" \
-H "X-API-Key: $API_KEY"
{
"symbol": "AAPL",
"currency": "USD",
…
"range": "1mo",
"interval": "1d",
"candles": [
{
"date": "2026-10-19",
"timestamp": 1792416600,
"open": 340.7799987792969,
"high": 346,
"low": 340.1199951171875,
"close": 342.94000244140625,
"volume": 34573200,
"adjusted_close": 342.67962646484375
},
…
],
"events": {
"dividends": [
{
"date": "2026-11-12T14:30:00Z",
"amount": 0.27
}
]
},
"source": "yahoo_finance"
}
Prices arrive as long floats, so round them for display, not for storage. Keep both close and adjusted_close: they differ in the recording, and which one you chart or compute returns from is a modelling decision you may want to revisit. One call returns the whole range, so a backfill of a year of daily candles for one ticker is a single 1-credit call with range=1y.
What do fundamentals and news add?
fundamentals returns the company context a quote lacks, and news returns recent headlines for a symbol. Together they turn a price table into something an analyst or an agent can reason about. Both take one symbol and cost 1 credit.
The fundamentals response for AAPL has five blocks. profile holds name, sector, industry, country and employees. statistics is a flat object of about a hundred values, including marketCap, trailingPE, forwardPE, dividendYield, beta, totalRevenue and freeCashflow; date fields such as exDividendDate are Unix timestamps. earnings has the next date in dates and estimate ranges. analyst_targets carries target figures and a trend of recommendation counts by period. statements holds reported values with type, as_of_date, period_type and reported_value:
{
"symbol": "AAPL",
…
"profile": {
"name": "Apple Inc.",
"sector": "Technology",
"industry": "Consumer Electronics",
"employees": 167000,
…
},
"statistics": {
…
"dividendYield": 0.0031,
"exDividendDate": 1794441600,
…
"trailingPE": 39.27567,
…
"marketCap": 5114019971072,
…
},
…
"statements": {
"income": [
…
{
"type": "annualTotalRevenue",
"as_of_date": "2024-09-30T00:00:00Z",
"period_type": "12M",
"currency_code": "USD",
"reported_value": 391035000000
}
],
"balance_sheet": [ … ],
"cash_flow": [ … ]
},
"source": "yahoo_finance"
}
Analyst targets and recommendation counts are figures published on the site, returned as found. Treat them as data points to display or compare, not as a signal to act on.
The news response is a list of items with uuid, title, publisher, link, published_at, image_url and related_tickers. Not every headline is about the symbol you asked for: in the AAPL recording, one item's related_tickers are AVGO and MU. Filter on related_tickers if you only want items that tag your symbol, and de-duplicate on uuid across days.
How do you run a daily watchlist job?
The job below makes one quote call for the whole list and one news call per ticker, then appends rows to two CSV files. It reads only fields that appear in the recorded responses, waits on 429 and 503 using Retry-After, and skips news items it has already stored by uuid.
import csv
import datetime
import os
import time
import requests
API_KEY = os.environ["API_KEY"]
BASE = "https://api.perceptlayer.com/v1/yahoo-finance"
WATCHLIST = ["AAPL", "MSFT"]
def get(path, params, attempts=3):
for _ in range(attempts):
r = requests.get(f"{BASE}/{path}", params=params,
headers={"X-API-Key": API_KEY}, timeout=60)
if r.status_code in (429, 503):
time.sleep(int(r.headers.get("Retry-After", "5")))
continue
r.raise_for_status()
return r.json()
raise RuntimeError(f"gave up on {path} {params}")
today = datetime.date.today().isoformat()
quotes = get("quote", {"symbols": ",".join(WATCHLIST)}).get("quotes", [])
missing = set(WATCHLIST) - {q.get("symbol") for q in quotes}
if missing:
print("not returned:", ", ".join(sorted(missing)))
with open("quotes.csv", "a", newline="") as f:
out = csv.writer(f)
for q in quotes:
out.writerow([today, q.get("symbol"), q.get("price"), q.get("change_percent"),
q.get("volume"), q.get("currency"), q.get("market_state")])
seen = set()
if os.path.exists("news.csv"):
with open("news.csv", newline="") as f:
seen = {row[1] for row in csv.reader(f) if len(row) > 1}
with open("news.csv", "a", newline="") as f:
out = csv.writer(f)
for symbol in WATCHLIST:
time.sleep(1)
for item in get("news", {"symbol": symbol}).get("news", []):
if item.get("uuid") in seen or symbol not in item.get("related_tickers", []):
continue
seen.add(item["uuid"])
out.writerow([symbol, item["uuid"], item.get("published_at"),
item.get("publisher"), item.get("title"), item.get("link")])
The one-second pause keeps the job within the free tier's 1 request a second; paying accounts run at least 5 a second. Every error returns an HTTP status and a JSON body with code, message and request_id; the errors docs list the codes. Requests have no idempotency key, so a client timeout can hide a call that succeeded and was billed. Keep the timeout generous.
What does a Yahoo Finance watchlist cost per ticker?
The batched quote is the cheap part: one call a day prices the whole list for 1 credit, as long as the symbols fit in 200 characters. Per-ticker calls such as news, history and fundamentals cost 1 credit each. Add up the calls per day, multiply by the days, and that's the monthly bill in credits.
| Job, 20 tickers | Arithmetic | Credits a month |
|---|---|---|
| One-off backfill: 1 year of daily candles | 20 × 1 call × 1 credit | 20 (once) |
| Daily batched quote | 1 call × 30 days × 1 credit | 30 |
| Daily news per ticker | 20 × 30 days × 1 credit | 600 |
| Weekly fundamentals | 20 × 4 weeks × 1 credit | 80 |
| Total for the month | 30 + 600 + 80 | 710, plus 20 for the backfill |
The first month comes to 730 credits. The 100 free credits on signup cover the backfill and a few days of the full job. At 710 credits a month, the Starter pack's 10,000 credits last 14 months of usage, but purchased credits last 12 months, so plan on a year. Drop daily news and the job falls to 110 credits a month. The credits docs explain how debits work, and pricing has what credits cost.
To start, run search and quote in the playground on the quote endpoint page, then get a free API key and schedule the script. Other finance sources are listed under finance APIs.
APIs in this post
Frequently asked questions
How much does a Yahoo Finance API call cost?
Each successful call to any of the five endpoints costs 1 credit, and failed calls cost nothing and return X-Credits-Used: 0. The quote endpoint takes several symbols in one symbols value, so a watchlist quote is 1 credit for the whole list. Every response carries X-Credits-Used and X-Credits-Remaining, so a job can log its own spend.
Is the data real time?
The data is collected from publicly available sources and returned as found at the time of the call. The quote response includes market_state, which was POST in the recorded call, so store it with each reading. Don't use this API as an execution feed; it suits research, dashboards, enrichment and agents.
How far back does price history go?
The history endpoint takes range with values from 1d up to 10y, ytd and max, and interval with 1d, 1wk or 1mo. One call returns the whole range as candles, each with open, high, low, close, volume and adjusted_close, plus dividend events. The API doesn't document how far max reaches, so check it for your symbols in the playground.
How do I find the right symbol for a company?
Call search with the company name in q. Each result in quotes carries symbol, quote_type, exchange_display, sector and industry. In the recorded search for apple, the first result is the EQUITY AAPL and the second is a FUTURE, so filter on quote_type before adding a symbol to a watchlist.
Can an AI agent use the Yahoo Finance API?
Yes. Through the MCP server at https://perceptlayer.com/mcp, an agent finds the endpoints with search_endpoints, reads their parameters with get_endpoint (both free) and runs one with call_endpoint, which spends credits only on success and reports the credits used and remaining. The AI agents docs show how to connect it.