To scrape Google Finance, request the public quote page for a ticker, such as google.com/finance/quote/AAPL:NASDAQ, and read the label and value pairs: price, open, high, low, market cap, P/E ratio, EPS, beta and the 52-week range. The page answers a plain HTTP request; the work is parsing it into numbers. We did it for five stocks on 20 November 2026.
Below: the script, its real output, and the second half most tutorials skip, joining the quotes with three months of daily prices to get returns, volatility and drawdown. That is when scraped pages become financial data.
What a Google Finance quote page contains
Each quote page has the same blocks: the current price with the day's change and a timestamp, a key-stats list, a chart, related stocks and a news feed. Fetched as Markdown through our Web Scraping API, the key stats arrive as one label per line followed by its value:
AAPL:NASDAQ
Apple Inc
$349.69
...
Open
$352.86
High
$354.34
...
Mkt. cap
5.08T
...
P/E ratio
38.95
That fragment is from a read at 10:36 New York time; the parsed run below was 2 minutes later, so its price differs by 50 cents. The format is what matters: a label line, then a value line with a currency sign or a suffix (K, M, B, T or %). A parser needs to find each label and convert the next line into a number.
| Label on the page | Example value | Parsed as |
|---|---|---|
| Open, High, Low | $352.86 | 352.86 |
| Mkt. cap | 5.08T | 5.08 trillion |
| P/E ratio, EPS, Beta | 38.95 | 38.95 |
| Dividend | 0.31% | 0.31 |
| 52-wk high, 52-wk low | $360.83 | 360.83 |
| No. of employees | 167K | 167,000 |
Step 1: scrape the quote pages in Python
The script sends each quote URL to the Data API, which returns the page as Markdown, then parses the lines. This is the code we ran at 10:38 New York time on 20 November 2026:
import os, re, sys, requests, pandas as pd
sys.stdout.reconfigure(encoding="utf-8")
API = "https://api.quanticdata.io/v1"
headers = {"Authorization": f"Bearer {os.environ['QUANTICDATA_API_KEY']}"}
TICKERS = ["AAPL:NASDAQ", "MSFT:NASDAQ", "NVDA:NASDAQ", "GOOGL:NASDAQ", "AMZN:NASDAQ"]
LABELS = ["Open", "High", "Low", "Mkt. cap", "P/E ratio", "Dividend", "52-wk high",
"52-wk low", "EPS", "Beta", "No. of employees"]
def number(text):
"""'$352.86' -> 352.86, '5.08T' -> 5.08e12, '0.31%' -> 0.31, '167K' -> 167000"""
m = re.match(r"[$€£]?(-?[\d,.]+)\s*([KMBT%]?)", text.strip())
if not m:
return None
value = float(m.group(1).replace(",", ""))
return value * {"K": 1e3, "M": 1e6, "B": 1e9, "T": 1e12}.get(m.group(2), 1)
rows = []
for t in TICKERS:
r = requests.post(f"{API}/scrape", headers=headers, timeout=120,
json={"url": f"https://www.google.com/finance/quote/{t}", "format": "markdown"})
md = r.json()["payload"]["content"]
lines = [l.strip() for l in md.splitlines() if l.strip()]
i = lines.index(t) # the quote block starts at the ticker line
row = {"ticker": t.split(":")[0], "price": number(lines[i + 2])}
for label in LABELS: # each stat is a label line followed by its value
if label in lines:
row[label] = number(lines[lines.index(label) + 1])
rows.append(row)
quotes = pd.DataFrame(rows).set_index("ticker")
quotes["Mkt. cap"] = (quotes["Mkt. cap"] / 1e12).round(2)
print(quotes[["price", "Mkt. cap", "P/E ratio", "EPS", "Beta", "52-wk high", "52-wk low"]].to_string())
quotes.to_csv("google_finance_quotes.csv")
Output (market cap in trillions of US dollars):
price Mkt. cap P/E ratio EPS Beta 52-wk high 52-wk low
ticker
AAPL 349.19 5.08 38.95 8.98 1.07 360.83 243.42
MSFT 495.06 3.68 25.88 19.15 1.05 559.15 349.20
NVDA 137.09 3.30 14.73 9.31 2.21 243.37 136.98
GOOGL 279.19 3.42 14.58 19.15 1.23 408.61 272.11
AMZN 256.05 2.76 20.70 12.37 1.49 287.20 196.00
Five pages at $0.0015 each cost $0.0075. Note the parser keys on labels, not positions: if Google adds a stat or reorders the list, the script still finds "P/E ratio". If a label is renamed, that column comes back empty, which is easy to spot in a daily job.
Step 2: add price history and compute the numbers analysts use
A quote page is a snapshot. Returns, volatility and drawdown need a daily series. We took it from our Yahoo Finance collector, run once from Claude through the MCP server with include_history on:
run_collector { "slug": "yahoo_finance", "input": { "symbols": ["AAPL", "MSFT", "NVDA", "GOOGL", "AMZN"],
"range": "3mo", "interval": "1d", "include_history": true, "max_results": 5 }, "async": true }
Five rows, one per ticker, each carrying its open, high, low, close and volume per day, at $0.001 per quote. The second script joins them with the Google Finance table:
import os, sys, requests, numpy as np, pandas as pd
sys.stdout.reconfigure(encoding="utf-8")
RUN_ID = "YOUR_RUN_ID" # yahoo_finance, 5 symbols, range 3mo, interval 1d, 20 Nov 2026
API = "https://api.quanticdata.io/v1/scraper/collectors/runs/"
headers = {"Authorization": f"Bearer {os.environ['QUANTICDATA_API_KEY']}"}
rows = requests.get(API + RUN_ID, headers=headers, timeout=60).json()["payload"]["results"]
# OHLCV history -> one close-price column per ticker
close = pd.DataFrame({r["symbol"]: pd.Series({h["date"][:10]: h["close"] for h in r["history"]})
for r in rows}).sort_index()
print(f"{len(close)} trading days, {close.index[0]} to {close.index[-1]}")
ret = close.pct_change().dropna()
stats = pd.DataFrame({
"3m_return_%": (close.iloc[-1] / close.iloc[0] - 1) * 100,
"ann_vol_%": ret.std() * np.sqrt(252) * 100,
"max_drawdown_%": ((close / close.cummax()) - 1).min() * 100,
}).round(1)
quotes = pd.read_csv("google_finance_quotes.csv", index_col="ticker") # from the Google Finance step
print(stats.join(quotes[["P/E ratio", "Beta"]]).to_string(), "\n")
print("correlation of daily returns:")
print(ret.corr().round(2).to_string())
66 trading days, 2026-08-20 to 2026-11-20
3m_return_% ann_vol_% max_drawdown_% P/E ratio Beta
AAPL 12.2 21.6 -4.9 38.95 1.07
MSFT 3.0 27.4 -10.9 25.88 1.05
NVDA -36.5 44.2 -42.5 14.73 2.21
GOOGL -18.5 35.3 -23.2 14.58 1.23
AMZN -1.8 32.8 -9.8 20.70 1.49
correlation of daily returns:
AAPL MSFT NVDA GOOGL AMZN
AAPL 1.00 0.44 -0.04 0.19 0.22
MSFT 0.44 1.00 0.21 0.40 0.59
NVDA -0.04 0.21 1.00 0.10 0.08
GOOGL 0.19 0.40 0.10 1.00 0.65
AMZN 0.22 0.59 0.08 0.65 1.00
The joined table already says something a single quote page does not. Over the three months to 20 November 2026, Apple rose 12.2% with the lowest volatility of the five and a P/E near 39. Nvidia fell 36.5% from start to end, with a 42.5% peak-to-trough drawdown and 44.2% annualised volatility, and its P/E had dropped to 14.73. Amazon and Alphabet had the most correlated daily returns, 0.65. This is description, not advice; it shows what the joined data can answer.
Google Finance or a collector: which source for which field
| Need | Better source | Why |
|---|---|---|
| P/E, EPS, beta, market cap, employees | Google Finance quote page | All on one page, one request per ticker |
| Daily or intraday price history | Yahoo Finance collector | Open, high, low, close and volume as typed rows, up to 50 symbols per run |
| Indices and currency pairs | Yahoo Finance collector | Takes symbols such as ^GSPC and EURUSD=X |
| Company filings and fundamentals over years | Regulatory filings (for US companies, SEC EDGAR) | The primary source the other figures are derived from |
Web scraping for financial data: what to get right
- Timestamp every row. Store when you read the page and the quote time the page shows. A price without a time is not data.
- Parse into numbers once, at the edge. Convert "$352.86", "5.08T" and "0.31%" in one function and test it. See data parsing for the general method.
- Keep a steady, modest rate. A watchlist of a few hundred tickers polled every few minutes is a light load; spread requests over time rather than firing them all at once.
- Collect the same tickers every day. Over time the snapshots form a panel data you can analyse across companies and dates.
- Respect the terms. Quote pages are public, but their use is governed by the site's terms, and market data can carry exchange licensing terms when you redistribute it. For figures you trade or report on, a licensed market-data feed is the supported route; scraped pages suit research, monitoring and dashboards.
New to scraping in Python? Start with web scraping with Python. For other financial sources, from currency rates to LEI records and crypto prices, browse the collectors.


