Google Trends is one of the most useful free datasets on the web: it tells you how search interest in any term rises and falls over time, where in the world people are searching for it, and which related queries are heating up right now. The catch is that the web UI is built for eyeballing one chart at a time. If you want to compare hundreds of keywords, track interest week over week, or feed trend signals into a model, you need a Google Trends scraper that pulls the numbers out programmatically.
This guide covers every practical way to scrape Google Trends in 2026 — the pytrends Python library, the underlying JSON endpoints, commercial scraper APIs, and plain CSV export — plus how to handle the rate limits that trip up most people on their first run.
What data you can pull from Google Trends
Before writing any code, it helps to know what the platform actually exposes:
- Interest over time — a normalized 0–100 series showing relative search interest for one or more terms over your chosen window.
- Interest by region — the same score broken down by country, sub-region, metro, or city.
- Related queries — for each term, the top associated searches and the rising ones (fast-growing queries that may not be in the top 10 yet). A "Breakout" label means a query grew by more than 5000% in the period.
- Related topics — like related queries, but grouped into Google's entity/topic model rather than raw strings.
- Trending searches — daily and real-time trending searches by country.
Two things about the numbers matter for anyone building a scraper. First, values are normalized, not absolute — 100 is the peak of the series you requested, not a search count. Second, scores are only comparable within a single request. If you want to rank five keywords against each other, you must query them together, in one payload, or the 0–100 scales won't line up. This single fact quietly breaks a lot of naive trend datasets.
Method 1 — Scrape Google Trends with Python (pytrends)
The fastest route to a Google Trends scraper in Python is pytrends, a community-maintained "pseudo-API" that talks to the same internal endpoints the website uses and hands you clean pandas DataFrames.
pip install pytrends pandas
A first pull — interest over time for three terms in the US over the last 12 months, then straight to CSV export:
import pandas as pd
from pytrends.request import TrendReq
pytrends = TrendReq(hl="en-US", tz=360)
kw_list = ["web scraping", "data extraction", "screen scraping"]
pytrends.build_payload(kw_list, timeframe="today 12-m", geo="US")
# Interest over time (normalized 0-100 for each keyword)
iot = pytrends.interest_over_time()
print(iot.head())
# Google Trends export to CSV
iot.to_csv("trends_interest_over_time.csv")
build_payload is where you set the scope: the keyword list (up to five per request), timeframe (for example "today 5-y", "today 12-m", "now 7-d", or an explicit "2024-01-01 2025-12-31"), geo ("" for worldwide, "US", "GB", "US-CA", and so on), and optionally cat (a numeric category ID) and gprop ("" for web, or "images", "news", "youtube", "froogle" for shopping).
Related and rising queries
The rising queries are where the marketing value lives — they surface demand before it peaks:
related = pytrends.related_queries()
top = related["web scraping"]["top"]
rising = related["web scraping"]["rising"]
print(rising.head(10)) # fast-growing queries, "Breakout" = >5000% growth
Interest by region
region = pytrends.interest_by_region(resolution="COUNTRY", inc_low_vol=True)
print(region.sort_values("web scraping", ascending=False).head(10))
Swap resolution for "REGION", "DMA" (US metros), or "CITY" to drill down.
Trending searches
trending = pytrends.trending_searches(pn="united_states")
print(trending.head(20))
Method 2 — The endpoints behind Google Trends
pytrends is a convenience wrapper over Google Trends' own internal API, and it's worth understanding what it does under the hood — because when the library breaks (it periodically does, whenever Google changes something), you'll want to reproduce the calls yourself. The flow is a two-step handshake:
- A request to an
exploreendpoint returns a widget token for each panel (timeline, geo map, related queries). - Each widget is then fetched from its own
*/multiline,*/comparedgeo, or*/relatedsearchesendpoint, passing that token plus a URL-encoded JSONreqdescribing your keywords, timeframe, and geo.
The responses are JSON with a short anti-scraping prefix ()]}',) that you strip before parsing. Because the token ties every widget request to an initial session, you generally load the explore response first and carry its tokens and cookies forward — the same pattern used for any hidden JSON API. This is a reliable, browser-free approach, but you own the maintenance when the payload format shifts.
There is also movement toward an official Google Trends API, which Google began piloting in limited alpha in 2025. If it reaches general availability, it will be the cleanest and most stable option — worth checking availability before you commit to an unofficial route. Until then, treat any unofficial endpoint as something that can change without notice.
Method 3 — Commercial Google Trends scraper APIs
If you'd rather not babysit endpoints and rotate infrastructure yourself, several SERP/scraper API providers offer a hosted Google Trends endpoint. You send a keyword, timeframe, and geo; they handle rendering, proxies, and blocking, and return structured JSON. This is the pragmatic choice when you need reliability at volume and don't want trend collection to become a standing maintenance task. Expect to pay per request, and confirm the provider returns the specific widgets you need (interest over time, by region, related queries) rather than just a screenshot.
Method 4 — Manual CSV export from the UI
For a one-off, you don't need code at all. Open trends.google.com, enter your terms, set the window and region, and click the download icon on any panel to get a Google Trends CSV export. It's perfect for a quick pull, but it doesn't scale — every keyword set is a manual click, and comparing many terms means many exports you then have to stitch together. That's exactly the pain a scraper removes.
Handling rate limits (the 429 problem)
The single most common failure when you scrape Google Trends is HTTP 429 Too Many Requests. Google aggressively throttles the Trends endpoints, and a tight loop will get you blocked within a dozen calls. Four things keep a scraper alive:
1. Back off exponentially. Wrap every request in a retry with growing delays:
import time
from pytrends.request import TrendReq
from pytrends.exceptions import TooManyRequestsError
def safe_interest_over_time(pytrends, kw_list, **kwargs):
for attempt in range(5):
try:
pytrends.build_payload(kw_list, **kwargs)
return pytrends.interest_over_time()
except TooManyRequestsError:
wait = 5 * (2 ** attempt) # 5s, 10s, 20s, 40s, 80s
print(f"429 - backing off {wait}s")
time.sleep(wait)
raise RuntimeError("Still rate-limited after retries")
2. Rotate IPs. Trends limits are per-IP, so rotating proxies — ideally residential proxies for the toughest cases — are the real fix at scale. pytrends accepts a proxy pool directly:
pytrends = TrendReq(
hl="en-US", tz=360,
timeout=(10, 25),
proxies=["https://user:pass@proxy-host:port"],
retries=3, backoff_factor=0.6,
)
3. Throttle deliberately. A few seconds of time.sleep() between payloads beats hammering the endpoint and getting cut off for an hour.
4. Batch smartly. Five keywords per request is the ceiling. To compare more, use a shared anchor keyword in every batch, then rescale each batch to that common reference so all series remain comparable.
Worked example — find the most-searched products in a niche
Say you run electronics retail and want to know which devices to feature. Google Trends turns that into a quick, data-backed comparison instead of a guess. The workflow:
- Compare the broad players in one request so the scores are comparable — for example the major phone brands — and see who leads over the last 12 months.
- Pull the rising related queries for the top brands to discover the specific models gaining momentum (a
related_queries()call per brand). - Re-compare at the product level — put the leading models head-to-head in a single payload to rank actual demand.
brands = ["samsung", "apple", "google pixel", "xiaomi", "oneplus"]
pytrends.build_payload(brands, timeframe="today 12-m", geo="")
brand_interest = pytrends.interest_over_time().drop(columns="isPartial")
leader_order = brand_interest.mean().sort_values(ascending=False)
print(leader_order) # who leads on average
pytrends.build_payload(["samsung"], timeframe="today 12-m")
print(pytrends.related_queries()["samsung"]["rising"].head(10)) # hot models
The output is a live, defensible input to a merchandising or ad strategy — the same research that used to take a week of manual chart-reading, done in a loop. Pair it with keyword research scraping and search volume data and you have a full demand-forecasting picture.
Finding correlated search terms (the Google Correlate replacement)
Google once ran a companion tool, Google Correlate, that did the inverse of Trends: you gave it a time series — say, your website's weekly organic traffic exported from Google Analytics — and it returned the search queries whose popularity moved most closely with your curve, ranked by Pearson correlation. It was a genuinely clever way to surface seasonal drivers and content ideas you'd never have guessed.
Google Correlate was shut down in December 2019, so any old tutorial pointing you to it is a dead end. The good news: the technique is easy to reproduce yourself with a Trends scraper and a few lines of pandas. You pull the Trends series for a set of candidate queries, join each against your own time series, and compute the correlation coefficient:
import pandas as pd
from pytrends.request import TrendReq
pytrends = TrendReq(hl="en-US", tz=360)
# `traffic`: your own DataFrame, indexed by date, with a "visits" column
candidate_terms = ["data mining", "machine learning", "analytics",
"python tutorial", "e-commerce"]
scores = {}
for term in candidate_terms:
pytrends.build_payload([term], timeframe="2023-01-01 2025-12-31", geo="US")
series = pytrends.interest_over_time()[term]
merged = traffic.join(series, how="inner")
scores[term] = merged["visits"].corr(merged[term]) # Pearson r
time.sleep(3) # be polite
ranked = sorted(scores.items(), key=lambda kv: kv[1], reverse=True)
print(ranked)
The terms at the top of ranked are the ones whose search interest tracks your traffic most tightly — candidates for seasonal planning, editorial calendars, or paid-search direction. A high correlation isn't proof of causation (you'll get spurious matches too), but it's a strong prompt for further digging in Google Search Console and your analytics.
If you'd rather not build this, a handful of commercial tools (trend-discovery products such as Glimpse or Exploding Topics) now fill the Correlate niche with curated rising-term and correlation features. But for most analysts, the DIY loop above — Trends data plus a correlation function — is all Google Correlate ever really was.
Is scraping Google Trends allowed?
Google Trends data is public and free, and pulling it for research or analytics is common practice. That said, the internal endpoints aren't a supported public API, so aggressive automated collection can get your IP throttled or blocked, and you should stay within reasonable rates. For the broader legal picture around automated collection, see is web scraping legal. As always, scrape politely, cache results, and don't re-request data you already have.
FAQ
Does Google Trends have an official API?
Historically no — pytrends and the internal endpoints were the only routes. Google began piloting an official Trends API in alpha in 2025; check its current availability before choosing a method.
Why are my two keyword charts not comparable? Because Trends normalizes each request to its own peak of 100. Query the terms together in one payload, or rescale separate pulls against a shared anchor keyword.
How do I avoid getting blocked? Add exponential backoff, sleep between requests, and route through rotating proxies. At real volume, a hosted scraper API or a managed service removes the problem entirely.
Can I export Google Trends to CSV without coding? Yes — the download icon on each panel in the web UI exports that widget to CSV. It just doesn't scale to many keywords.
Bottom line
For a handful of keywords, manual CSV export is fine. For a real Google Trends scraper, pytrends gets you structured data in minutes, the underlying endpoints give you full control when you need it, and a scraper API or a done-for-you pipeline takes the maintenance off your plate. If you need trend and demand data delivered on a schedule — cleaned, comparable, and ready to import — that's exactly the kind of feed our web scraping service builds and maintains for you, so you can spend your time on the analysis rather than the plumbing.