Google Finance has no API. Google shut its Finance API down in October 2012 and pointed users to the GOOGLEFINANCE function in Google Sheets, which works in a spreadsheet but not from code. To get quotes into Python, you read Google Finance's public pages. Our API does that, and the script below turns a watchlist into two CSVs.
What Google offers instead
Google's replacement for the old API is a spreadsheet formula. The Portfolio API and the Finance Gadgets and Tools API closed together, and Google's product manager pointed users to GOOGLEFINANCE in Google Sheets. It returns attributes such as price, marketcap, pe and high52, plus daily history, with quotes that may be delayed up to 20 minutes and aren't sourced from every market. Its historical data can't be downloaded or read through the Sheets API or Apps Script. For a few prices in a sheet you watch yourself, it is the better pick.
Google Finance quotes with ToolzerHub
We make ToolzerHub. Our Google Finance API returns Google Finance's public data as JSON through two routes, each a GET with the x-api-key header at 1 credit a call:
/v1/google-finance/quote?symbol_or_url=...returns one listing: price, stats, company profile, analysts, related tickers, news and charts./v1/google-finance/search?query=...returns matching listings across exchanges.
export TOOLZERHUB_API_KEY=your_key
curl -G -H "x-api-key: $TOOLZERHUB_API_KEY" \
--data-urlencode "symbol_or_url=NVDA:NASDAQ" \
"https://api.toolzerhub.com/v1/google-finance/quote"
A trimmed data object for NVDA:NASDAQ:
{
"symbol": "NVDA:NASDAQ",
"name": "NVIDIA Corp",
"type": "stock",
"currency": "USD",
"price": 202.9201,
"change": -3.7698975,
"change_percent": -1.823938,
"previous_close": 206.69,
"after_hours": { "price": 203.58, "change": 0.9450073, "change_percent": 0.4663594 },
"updated_at": "2026-11-04T17:15:22Z",
"stats": { "open": 203.5, "high": 206.79, "low": 200.94, "year_high": 243.37, "year_low": 164.27, "volume": 68140824, "market_cap": 4891644325256.348, "pe_ratio": 25.614546, "dividend_yield": 0.49351034 },
"analysts": { "consensus": "StrongBuy", "count": 33, "buy": 33, "hold": 0, "sell": 0, "price_target_low": 275, "price_target_high": 465, "price_target_mean": 322.5, "currency": "USD" }
}
The same call carries 54 individual analyst ratings, 4 related tickers, 22 news items, 34 intraday bars of 5-minute OHLCV and 22 daily bars in chart.month. Crypto (BTC-USD) and non-US stocks (RELIANCE:NSE, priced in INR) use the same route. A search for "apple" returns AAPL:NASDAQ, the Frankfurt listing APC:FRA in EUR, and a Kalshi market with type other, so filter on type.
Save a watchlist to CSV
The script takes ticker symbols or company names and writes two files. A term with a colon or dash goes straight to /quote; a name goes through /search first and keeps the first stock, index, fund or crypto row. quotes.csv gets one row per listing, and daily_closes.csv gets each listing's month of daily closes. Save it as google_finance_quotes.py and install requests (pip install requests).
import csv
import os
import sys
import time
import requests
BASE = "https://api.toolzerhub.com/v1/google-finance"
HEADERS = {"x-api-key": os.environ.get("TOOLZERHUB_API_KEY", "")}
FIELDS = ["symbol", "name", "type", "currency", "price", "change_percent", "previous_close",
"market_cap", "pe_ratio", "dividend_yield", "year_low", "year_high",
"analyst_consensus", "price_target_mean", "updated_at"]
def get(path, params, tries=3):
for attempt in range(tries):
r = requests.get(f"{BASE}/{path}", headers=HEADERS, params=params, timeout=60)
if r.status_code in (429, 500, 502, 503, 504) and attempt < tries - 1:
time.sleep(5 * (attempt + 1))
continue
r.raise_for_status()
return r.json()["data"]
def resolve(term):
# "NVDA:NASDAQ", "BTC-USD" and Google Finance links go straight to /quote; names go through /search.
if ":" in term or "-" in term or term.startswith("http"):
return term
results = get("search", {"query": term})["results"]
stocks = [x for x in results if x["type"] in ("stock", "index", "fund", "crypto")]
if not stocks:
sys.exit(f"no listing found for {term!r}")
print(f"{term} -> {stocks[0]['symbol']} ({stocks[0]['name']})")
return stocks[0]["symbol"]
def main(terms, out="quotes.csv"):
with open(out, "w", newline="", encoding="utf-8") as f, \
open("daily_closes.csv", "w", newline="", encoding="utf-8") as g:
quotes = csv.DictWriter(f, fieldnames=FIELDS)
closes = csv.writer(g)
quotes.writeheader()
closes.writerow(["symbol", "date", "close", "volume"])
for term in terms:
q = get("quote", {"symbol_or_url": resolve(term)})
stats, analysts = q.get("stats") or {}, q.get("analysts") or {}
quotes.writerow({
"symbol": q["symbol"], "name": q["name"], "type": q["type"],
"currency": q["currency"], "price": q["price"],
"change_percent": round(q["change_percent"] or 0, 2),
"previous_close": q["previous_close"], "market_cap": stats.get("market_cap"),
"pe_ratio": stats.get("pe_ratio"), "dividend_yield": stats.get("dividend_yield"),
"year_low": stats.get("year_low"), "year_high": stats.get("year_high"),
"analyst_consensus": analysts.get("consensus"),
"price_target_mean": analysts.get("price_target_mean"),
"updated_at": q["updated_at"],
})
for bar in (q.get("chart") or {}).get("month", []): # about 22 trading days
closes.writerow([q["symbol"], bar["time"][:10], bar["close"], bar["volume"]])
print(f"{len(terms)} quotes saved to {out}, daily closes to daily_closes.csv")
if __name__ == "__main__":
if len(sys.argv) < 2:
sys.exit('usage: python google_finance_quotes.py NVDA:NASDAQ "apple" BTC-USD ...')
if not HEADERS["x-api-key"]:
sys.exit("set TOOLZERHUB_API_KEY first")
main(sys.argv[1:])
python google_finance_quotes.py NVDA:NASDAQ apple microsoft tesla RELIANCE:NSE toyota BTC-USD ETH-USD .INX:INDEXSP makes 13 calls: 9 quotes and 4 searches. We ran it twice on those 9 terms, and it finished in 30.9 and 38.6 seconds.
What the watchlist showed
Each run saved 9 rows to quotes.csv, and the 4 names resolved to AAPL:NASDAQ, MSFT:NASDAQ, TSLA:NASDAQ and TM:NYSE. Part of the file:
| symbol | type | currency | price | change_percent | analyst_consensus |
|---|---|---|---|---|---|
| NVDA:NASDAQ | stock | USD | 202.75 | -1.91 | StrongBuy |
| AAPL:NASDAQ | stock | USD | 354.34 | 6.76 | Buy |
| MSFT:NASDAQ | stock | USD | 556.15 | 6.75 | StrongBuy |
| TSLA:NASDAQ | stock | USD | 385.74 | -3.2 | Buy |
| RELIANCE:NSE | stock | INR | 1,311 | 0.24 | StrongBuy |
| TM:NYSE | stock | USD | 200.1 | 3.68 | |
| BTC-USD | crypto | USD | 80,276.1841 | 3.8 | |
| ETH-USD | crypto | USD | 2,423.8391 | 6.69 | |
| .INX:INDEXSP | index | 7,698.72 | 1.71 |
Blank cells follow the listing type. The S&P 500 row has no currency, market cap or P/E, and the crypto rows have no stats or analyst block. Toyota came back without an analyst consensus, and Reliance's updated_at is hours earlier than the US rows because NSE closes before US markets open.
daily_closes.csv holds 22 closes for each stock and the index, while the crypto rows include weekends. During US trading, a US stock's last daily close is the day before and equals previous_close (206.69 for Nvidia), so today's move is in price.
What it costs
The 9-listing watchlist is 13 credits with names and 9 with symbols; a daily refresh of 20 symbols is about 600 credits a month. The 100 free credits a month run the watchlist several times; $19 buys 10,000 credits that never expire, and plans for higher volume cover bigger watchlists. Set your key, pass your tickers, and your first quotes.csv is ready in under a minute.
For other Google products whose official API stops short, see our Google Maps reviews API post and YouTube search API quota.
We are not affiliated with Google.