# How to Scrape Google Finance with Python

> Scrape Google Finance with Python: five quote pages read on 20 November 2026, price, market cap, P/E, EPS and beta parsed, then joined with 3 months of history.

[Home](https://quanticdata.io/) / [Blog](https://quanticdata.io/blog/) / How to Scrape Google Finance with Python

# How to scrape Google Finance with Python, and turn quotes into financial data

Web scraping · Nov 20, 2026 · 7 min read · By [Aldo Morese](https://quanticdata.io/about/), founder of QuanticData

![Scraping Google Finance on 20 November 2026: five quote pages, AAPL, MSFT, NVDA, GOOGL and AMZN, are read as Markdown through the Web Scraping API and parsed in Python into price, market cap, P/E, EPS and beta; the card shows Apple at 349.19 dollars, a P/E of 38.95 and a market cap of 5.08 trillion, joined with 66 trading days of history.](https://quanticdata.io/blog/scrape-google-finance/hero.webp?v=20261120h)

On this page

- [What a Google Finance quote page contains](https://quanticdata.io/blog/scrape-google-finance/#what-a-google-finance-quote-page-contains)
- [Step 1: scrape the quote pages in Python](https://quanticdata.io/blog/scrape-google-finance/#step-1-scrape-the-quote-pages-in-python)
- [Step 2: add price history and compute the numbers analysts use](https://quanticdata.io/blog/scrape-google-finance/#step-2-add-price-history-and-compute-the-numbers-analysts-us)
- [Google Finance or a collector: which source for which field](https://quanticdata.io/blog/scrape-google-finance/#google-finance-or-a-collector-which-source-for-which-field)
- [Web scraping for financial data: what to get right](https://quanticdata.io/blog/scrape-google-finance/#web-scraping-for-financial-data-what-to-get-right)

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.

**Run it on the free credit.** Every QuanticData account gets $2 of free API usage per month.

[Start free — $2/month included](https://quanticdata.io/signup/?utm_source=blog&utm_medium=website&utm_campaign=blog-lead&utm_content=scrape-google-finance) · [Explore Web Scraping API](https://quanticdata.io/web-scraping-api/)

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](https://quanticdata.io/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:

```python
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.

**Try it on your own targets.** Every QuanticData account gets $2 of free API usage per month.

[Start free — $2/month included](https://quanticdata.io/signup/?utm_source=blog&utm_medium=website&utm_campaign=blog-inline&utm_content=scrape-google-finance) · [Explore Web Scraping API](https://quanticdata.io/web-scraping-api/)

## 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](https://quanticdata.io/collectors/stock-data-api/), 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:

```python
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

1. **Timestamp every row.** Store when you read the page and the quote time the page shows. A price without a time is not data.
2. **Parse into numbers once, at the edge.** Convert "$352.86", "5.08T" and "0.31%" in one function and test it. See [data parsing](https://quanticdata.io/blog/data-parsing/) for the general method.
3. **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.
4. **Collect the same tickers every day.** Over time the snapshots form a [panel data](https://quanticdata.io/blog/panel-data/) you can analyse across companies and dates.
5. **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](https://quanticdata.io/blog/how-to-web-scraping-using-python/). For other financial sources, from currency rates to LEI records and crypto prices, browse the [collectors](https://quanticdata.io/collectors/).

### Sources & further reading

- [Google Docs Editors Help: GOOGLEFINANCE function](https://support.google.com/docs/answer/3093281)
- [U.S. Securities and Exchange Commission: EDGAR full-text search and company filings](https://www.sec.gov/edgar/search/)
- [pandas documentation: Time series and date functionality](https://pandas.pydata.org/docs/user_guide/timeseries.html)

## FAQ

Quick answers on scrape google finance.

[Something else? Ask us](mailto:hello@quanticdata.io)

### Can you scrape Google Finance?

Yes. Google Finance quote pages are public and answered a plain HTTP request in our test on 20 November 2026. Fetch google.com/finance/quote/TICKER:EXCHANGE, read the label and value pairs, and convert them to numbers. Check the site terms for how you may use and share the data.

### How do I scrape Google Finance with Python?

Send the quote URL to a scraping API or fetch it with requests, take the page as Markdown or HTML, find each label such as "P/E ratio" and parse the next value into a number. Our script reads five quote pages and returns price, market cap, P/E, EPS, beta and the 52-week range.

### Does Google Finance have an API?

Google documents one route to Google Finance data: the GOOGLEFINANCE function in Google Sheets, which returns quotes and history inside a spreadsheet. Outside Sheets, people read the public quote pages, as in this guide, or use another market-data source such as our Yahoo Finance collector.

### How do I get historical stock prices?

Use a source with a daily series. Our Yahoo Finance collector returns open, high, low, close and volume for up to 50 symbols per run with include_history on, at $0.001 per quote; we pulled 66 trading days for five stocks in one run.

### Is web scraping financial data legal?

Reading public pages is generally possible, but it is governed by each site's terms and the law that applies to you and to how you use the data. Market data can carry exchange licensing terms when redistributed. For trading or reporting, use a licensed feed; take advice for your jurisdiction when in doubt.

### How much does it cost to scrape Google Finance?

With the Web Scraping API a successful page costs $0.0015, so five quote pages cost $0.0075 and a 500-ticker watchlist read once costs $0.75. Failed requests are not billed, and every account has $2 of free API usage per month.

## Read quote pages as clean text

Public pages as Markdown from $0.0015, and price history as typed rows from the Yahoo Finance collector at $0.001 per quote. Start with $2 of free API usage every month.

[Start free — $2/month included](https://quanticdata.io/signup/?utm_source=blog&utm_medium=website&utm_campaign=blog-end&utm_content=scrape-google-finance) · [Explore Web Scraping API](https://quanticdata.io/web-scraping-api/)

## Related reading

- [Web Scraping Project Ideas, Started for Real](https://quanticdata.io/blog/web-scraping-project-ideas/): Web scraping · Five web scraping project ideas, each one started for real on 20 November 2026: a price tracker, a library release dashboard, a question analysis, an open-source landscape and a topic timeline, with the code, the first run and what to build next.
- [Retry-After Header: Read It, Wait, Retry](https://quanticdata.io/blog/retry-after-header/): Web scraping · Retry-After tells a client how long to wait before the next request, as a number of seconds or as an HTTP date. Below: both formats, a Python and a Node helper we ran against a real 429 on 20 November 2026 (each waited 10 seconds and then got 200), the rate-limit headers of the QuanticData API, and how one batch job replaced 20 calls.
- [How to Use an API Key: curl, Python and JS](https://quanticdata.io/blog/how-to-use-an-api-key/): Web scraping · An API key is a secret string you send with every request so the service knows which account is calling. Nothing is installed: you add one header. Below: the same call in curl, Python, JavaScript and PowerShell, run on 20 November 2026 against the QuanticData API, the exact 401 messages for the usual mistakes, and how to keep the key out of your code.

---

Source: https://quanticdata.io/blog/scrape-google-finance/ · Site index for AI: https://quanticdata.io/llms.txt
