Yahoo APIfinance.yahoo.com ↗
Search stock tickers and retrieve financial stats, valuation ratios, and ETF holdings from Yahoo Finance. 3 endpoints, structured JSON responses.
What is the Yahoo API?
This API exposes 3 endpoints that cover Yahoo Finance data: ticker search, key stock statistics, and ETF/mutual fund holdings. The get_stock_stats endpoint returns over 10 financial fields per ticker — including PE ratio, PEG ratio, beta, EPS, forward EPS, market cap, 52-week high/low, and volume — while get_holdings surfaces the top holdings for funds like SPY or QQQ with portfolio weight percentages.
curl -X GET 'https://api.parse.bot/scraper/7cd4ecc8-2548-4653-a6b1-48d9356cd29d/search_ticker?query=Apple' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace finance-yahoo-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Yahoo Finance SDK — bounded, re-runnable; every call capped."""
from parse_apis.Yahoo_Finance_API import YahooFinance, TickerNotFound
client = YahooFinance()
# Search for tickers by company name
for ticker in client.tickers.search(query="Microsoft", limit=3):
print(ticker.symbol, ticker.name, ticker.exchange)
# Get detailed stats for a known stock
try:
aapl = client.stocks.get(ticker="AAPL")
print(aapl.ticker, aapl.pe_ratio, aapl.market_cap, aapl.week_high_52)
except TickerNotFound as e:
print("not found:", e.ticker)
# Retrieve top holdings for an ETF
fund = client.funds.get(ticker="SPY")
print(fund.ticker, fund.total_holdings_count)
for holding in fund.holdings.list(limit=3):
print(holding.symbol, holding.company_name, holding.percentage)
print("exercised: tickers.search, stocks.get, funds.get, fund.holdings.list")
Full-text search for stock tickers by company name, symbol, or keyword. Returns matching symbols with company name, exchange, type, sector, and industry. Results are auto-iterated.
| Param | Type | Description |
|---|---|---|
| queryrequired | string | Search query — company name, ticker symbol, or keyword. |
{
"type": "object",
"fields": {
"total": "integer total number of matches",
"results": "array of ticker matches with symbol, name, exchange, quote_type, sector, industry"
},
"sample": {
"data": {
"total": 6,
"results": [
{
"name": "Apple Inc.",
"sector": "Technology",
"symbol": "AAPL",
"exchange": "NASDAQ",
"industry": "Consumer Electronics",
"quote_type": "Equity"
}
]
},
"status": "success"
}
}About the Yahoo API
Ticker Search
The search_ticker endpoint accepts a free-text query — a company name, symbol, or keyword — and returns an array of matching instruments. Each result includes the symbol, name, exchange, quote_type, sector, and industry. The response also includes a total count of matches, and results are auto-iterated so you don't need to manage pagination manually.
Stock Financial Statistics
The get_stock_stats endpoint takes a single ticker parameter (e.g., AAPL, MSFT) and returns a structured object with valuation measures (pe_ratio, forward_pe, peg_ratio, market_cap), trading data (volume, 52_week_low, beta), and earnings figures (eps, forward_eps). All numeric fields are typed — market cap is an integer in USD, price fields are floats — which makes downstream calculations straightforward without additional parsing.
ETF and Mutual Fund Holdings
The get_holdings endpoint is scoped specifically to ETFs and mutual funds. Passing a ticker like SPY, QQQ, or VTI returns up to 10 top holdings, each with a symbol, company_name, percentage weight, and share count. The response also includes an as_of_date field (or null if unavailable) and a total_holdings_count. Calling this endpoint with an individual stock ticker will return an empty holdings list — it is only meaningful for fund-type instruments.
The Yahoo API is a managed, monitored endpoint for finance.yahoo.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when finance.yahoo.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official finance.yahoo.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Screen stocks by PE ratio or PEG ratio to filter overvalued or undervalued equities.
- Build a portfolio tracker that maps company names to ticker symbols using
search_ticker. - Compare beta coefficients across a watchlist to assess portfolio volatility exposure.
- Analyze top ETF holdings to understand index composition and sector concentration.
- Populate a financial dashboard with EPS and forward EPS to track earnings trends.
- Identify stocks near 52-week lows using the
52_week_lowfield fromget_stock_stats. - Resolve ambiguous company names to canonical ticker symbols before querying other data sources.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Yahoo Finance have an official developer API?+
What does `get_holdings` return for a regular stock ticker like AAPL?+
get_holdings will return an empty holdings array. Use search_ticker first if you need to confirm whether a given instrument is a fund before calling get_holdings.Does `get_stock_stats` return historical price data or intraday quotes?+
Does the API return income statement or balance sheet data?+
get_stock_stats such as EPS, PE ratios, market cap, and margins, but does not expose full financial statements (income statement, balance sheet, or cash flow). You can fork it on Parse and revise to add those statement endpoints.How many holdings does `get_holdings` return, and can I get the full list?+
total_holdings_count field reflects how many were returned in the response, not the total number of positions the fund holds. Funds like SPY or VTI hold hundreds of positions; the remaining holdings beyond the top 10 are not currently exposed. You can fork this API on Parse and revise it to add deeper holdings pagination.