2026-11-22 · Guide
Real-time stock quotes, financials and options in Python — a Yahoo Finance alternative
Scraping Yahoo Finance breaks every few months, and most "free" stock APIs cap you at 5 calls a minute. Here is a cleaner way to get real-time quotes, financial statements, options chains, earnings, analyst targets and technical indicators for any US stock — from one API and one key.
1. Get a key
Subscribe to the Stock Market API on RapidAPI (the BASIC plan is free) and copy your x-rapidapi-key.
2. A tiny client
import requests
HOST = "stock-market-api-real-time-data-fundamentals.p.rapidapi.com"
HEADERS = {"x-rapidapi-host": HOST, "x-rapidapi-key": "YOUR_RAPIDAPI_KEY"}
def get(path, **params):
r = requests.get(f"https://{HOST}{path}", headers=HEADERS, params=params, timeout=30)
r.raise_for_status()
return r.json()
3. Quotes — one or many
q = get("/quote", symbol="AAPL")
print(q["price"], q["change_percent"], q["market_cap"], q["week52_high"])
batch = get("/quotes", symbols="AAPL,MSFT,NVDA,SPY")
for s in batch["quotes"]:
print(s["symbol"], s["price"], "P/E", s["pe_ratio"], "beta", s["beta"])
/quotes takes up to 25 symbols and includes P/E, forward P/E, EPS, beta, margins, ROE and the extended-hours price.
4. Financial statements
fin = get("/financials", symbol="AAPL", period="annual", statement="income")
rev = next(i for i in fin["income"]["items"] if i["key"] == "total_revenue")
print(rev["values"]) # {'2026-09-26': 478834000000, '2025-09-27': ...}
Values are real US dollars (not thousands), with period=quarterly for the last four quarters, and statement=balance, cash_flow or ratios.
5. Options chain
chain = get("/options", symbol="AAPL", limit=50)
for exp in chain["chain"]:
for row in exp["strikes"][:3]:
print(exp["expiration"], row["strike"], "call", row["call"]["last"], "put", row["put"]["last"])
6. Analysts, earnings and insiders
a = get("/analysts", symbol="AAPL")
print(a["consensus_rating"], a["price_target"]) # Hold {'mean': 343.69, 'low': 261, 'high': 425}
e = get("/earnings", symbol="AAPL")
print(e["history"][0]) # reported EPS vs estimate, surprise %
i = get("/insiders", symbol="AAPL", limit=5)
print(i["transactions"][0])
7. Technical indicators and scans
t = get("/technicals", symbol="AAPL", interval="1d")
print(t["summary"]["overall"], t["oscillators"]["rsi_14"], t["oscillators"]["macd"])
oversold = get("/scan", scan="oversold", limit=10)
print([s["symbol"] for s in oversold["stocks"]])
The same /technicals endpoint works for crypto and forex: symbol=BINANCE:BTCUSDT or FX:EURUSD.
8. Calendars
print(get("/calendar/earnings", date="2026-11-24")["earnings"][:3])
print(get("/calendar/ipos", month="2026-11")["upcoming"][:3])
print(get("/calendar/economic", date="2026-11-20", country="united states")["events"][:3])
That's 27 endpoints behind one key — quotes, history, intraday, extended hours, options, fundamentals, ownership, calendars, movers, screeners, technicals and SEC full-text search. See the [full endpoint list](/stock-market-api-real-time-data-fundamentals).
Try it free. Stock Market API - Real-Time Data & Fundamentals has a free plan on RapidAPI — every endpoint included.
Get your free key