Skip to content

How to Scrape Google Trends: Interest Over Time, Regions and Related Queries

Scrape Google Trends for any search term, country and time range, with no code or one API call, then plot the timeline in Python. A real coffee-vs-tea run with its output, log and exact cost, plus where pytrends and Google's own API stand today.

Published
Reading time
8 min read
Pixel-art robot with an orange >_ on its terminal head pulls a chart slip with a rising line out of a monitor showing the Google Trends logo and a climbing line chart, and drops it into a crate
In this article
  1. What data you can get from Google Trends
  2. How to scrape Google Trends without code
  3. How to scrape Google Trends with Python
  4. A real run: coffee vs. tea in Germany
  5. What it costs
  6. pytrends and the official Google Trends API
  7. What to watch out for
  8. Is it legal to scrape Google Trends?
  9. Why Scrape.ly for Google Trends data
  10. FAQ
  11. Can you scrape Google Trends for free?
  12. How do I scrape Google Trends with Python?
  13. Is there an official Google Trends API?
  14. Can I compare more than five terms?
  15. Why is the last data point lower?

To scrape Google Trends, send a search term, a country and a time range to a scraper that reads Trends' public explore page, and save what it returns: the interest-over-time timeline, interest by region and city, and the top and rising related queries. The quickest way is a ready-made scraper you run in the cloud, from a web form or one API call, then load the timeline into Python or a spreadsheet.

This guide covers both, plus a Python script that turns the result into a chart. Everything comes from a real run on 22 October 2026: coffee vs. tea in Germany over three months, with the exact input, the output, the log and the cost. It also explains where pytrends and Google's official Trends API stand today.

One result covers one search term (or one comparison of up to five terms). The Google Trends Scraper on Scrape.ly writes these fields:

Field What it holds
searchTerm, inputUrlOrTerm The term or explore URL you asked for
geo, timeRange, url Country, time range and the matching Trends explore link
interestOverTime_timelineData The timeline: time (Unix seconds), formattedTime, value, hasData, isPartial
interestOverTime_averages Per-term averages when you compare several terms
interestBy Interest by country, for worldwide searches
interestBySubregion Interest by state or region, for a country search
interestByCity, interestByMetro City and metro breakdowns, when Trends publishes them
relatedQueries_top The most common related searches, scored 0–100
relatedQueries_rising Fast-growing related searches, with "Breakout" or a percentage
relatedTopics_top, relatedTopics_rising Related topics, only with includeRelatedTopics on

Google Trends shows relative interest, not search volume: every number is scaled so the highest point in the request is 100. You won't find absolute search counts here or anywhere else on Trends.

  1. Open the Google Trends Scraper in the Scrape.ly Store.
  2. Pick a ready-made input. We used the preset Coffee vs tea in Germany. "Try this input" opens it in the console.
  3. Change the terms, country and range to yours. This is the exact input of our run:
json
{
  "searchTerms": ["coffee", "tea"],
  "maxItems": 10,
  "timeRange": "today 3-m",
  "geo": "DE",
  "category": "",
  "isMultiple": false,
  "maxConcurrency": 3,
  "maxRequestRetries": 4,
  "includeRelatedTopics": false,
  "proxyConfiguration": { "useScrapelyProxy": true, "scrapelyProxyGroups": ["RESIDENTIAL"] }
}
  1. Start the run. The Output tab opens on interest over time, one row per day or week.
  2. Export the dataset as JSON, CSV or Excel.

The fields that matter most:

  • searchTerms: one result per term. Tick isMultiple and write "coffee, tea" as one entry to compare up to five terms on the same chart.
  • timeRange: a preset from now 1-H (past hour) to all (2004 onward). Leave it empty for the past 12 months, or set customTimeRange to YYYY-MM-DD YYYY-MM-DD.
  • geo: a country code such as US or DE, or empty for worldwide. A country adds subregions, and cities when Trends has them.
  • startUrls: paste a trends.google.com explore link instead; its query, country and dates win over the fields.
  • includeRelatedTopics: also fetch related topics. It loads each term in a browser, which adds roughly 10 to 60 seconds per term.

Create an API token in the dashboard under Settings → API & Integrations and export it as SCRAPELY_TOKEN. Install the client and the two plotting libraries: pip install scrapely-client-python pandas matplotlib.

This script runs the scraper, turns each term's timeline into a pandas column, skips the partial last day, and saves a chart:

python
import os
import pandas as pd
import matplotlib.pyplot as plt
from scrapely_client import ScrapelyClient

client = ScrapelyClient(os.environ["SCRAPELY_TOKEN"], api_url="https://api.scrape.ly")

run = client.actor("querystone/google-trends-scraper").call(
    run_input={"searchTerms": ["coffee", "tea"], "timeRange": "today 3-m", "geo": "DE", "maxItems": 10}
)
print(run.status)  # SUCCEEDED, FAILED, ABORTED or TIMED-OUT

frames = []
for item in client.dataset(run.default_dataset_id).iterate_items():
    points = [p for p in item["interestOverTime_timelineData"] if not p.get("isPartial")]
    frames.append(pd.Series(
        [p["value"][0] for p in points],
        index=pd.to_datetime([int(p["time"]) for p in points], unit="s"),
        name=item["searchTerm"],
    ))

df = pd.concat(frames, axis=1)
print(df.describe().round(1))
print("Peak days:", df.idxmax().dt.date.to_dict())

ax = df.plot(title="Google Trends, Germany, last 3 months")
ax.set_ylabel("Search interest (each term's own peak = 100)")
plt.savefig("trends.png", dpi=150, bbox_inches="tight")

On our run's data it printed 92 complete days per term, a mean of 51.5 for tea and 45.4 for coffee, and peak days of 5 September (tea) and 19 September (coffee). value is a list because a comparison holds one value per term; for a single term, take the first entry.

The same run with curl. It took 9.2 seconds, so the synchronous endpoint works:

shell
curl -X POST "https://api.scrape.ly/v2/actors/querystone~google-trends-scraper/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $SCRAPELY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": ["coffee", "tea"], "timeRange": "today 3-m", "geo": "DE", "maxItems": 10}'

For long term lists, or with related topics on, a run can pass 45 seconds. The call then answers 408 while the run keeps going; don't call it again. Use a client, which waits as long as needed.

Node.js (npm install scrapely-client):

javascript
import { ScrapelyClient } from 'scrapely-client';

const client = new ScrapelyClient({ token: process.env.SCRAPELY_TOKEN, baseUrl: 'https://api.scrape.ly' });

const run = await client.actor('querystone/google-trends-scraper').call({
  searchTerms: ['coffee, tea'],
  isMultiple: true,
  timeRange: 'today 5-y',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].interestOverTime_averages, items[0].relatedQueries_top?.slice(0, 5));

For AI agents, add the MCP server at https://api.scrape.ly/mcp. In Cursor (~/.cursor/mcp.json):

json
{
  "mcpServers": {
    "scrapely": {
      "url": "https://api.scrape.ly/mcp",
      "headers": { "Authorization": "Bearer YOUR_TOKEN" }
    }
  }
}

In Claude Code, run claude mcp add --transport http scrapely https://api.scrape.ly/mcp and sign in with /mcp. Then ask: "Use scrapely to run querystone/google-trends-scraper for 'coffee, tea' as a comparison in Germany over 5 years and tell me which months peak." See the MCP docs.

A real run: coffee vs. tea in Germany

We ran the "Coffee vs tea in Germany" preset on 22 October 2026. It returned 2 results (one per term) in 9.2 seconds and was charged $0.0053. Each result held 93 daily points from 22 July to 22 October 2026; the last one was marked isPartial because the day wasn't over.

Term Days Mean Peak day Top region Second region Top related query Top rising query
tea 92 51.5 Sep 5, 2026 Hesse (100) Berlin (36) green tea innisfree green tea seed hyaluronic serum
coffee 92 45.4 Sep 19, 2026 Hesse (100) Thuringia (48) coffee machine nordpass login

Days and means exclude the partial day, as in the Python script. The other top related queries were bubble tea, black tea, ice tea and white tea, and coffee table, black coffee, iced coffee and coffee friend. Each result also carried 16 German states and 200 city rows.

Two observations you can check in the data. Both terms spike on nearly the same days in early and mid-September, so before you read a spike as demand for your product, compare it with a control term. And the rising list for a short, broad term like "coffee" picks up unrelated breakouts, such as a password-manager login. Filter rising queries by a word list before you use them for content ideas.

The log, without the platform's start-up lines:

Text
2026-10-22T18:25:51.902Z [Scrapely] Container started (setup 0.9 s)
2026-10-22T18:25:53.623Z [scrapely.actor] INFO  [Scrapely] Initializing API storage for run c9322a9d7f2f48edb
2026-10-22T18:25:53.723Z [scrapely.proxy_configuration] INFO  Platform proxy access check succeeded.
2026-10-22T18:25:53.725Z [scrapely.actor] INFO  Fetching 2 Trends result(s).
2026-10-22T18:25:59.403Z [scrapely.actor] INFO  [Status message]: Saved 2 of 2 results.
2026-10-22T18:26:00.282Z [Scrapely] Container state: status=exited exitCode=0 oomKilled=false

What it costs

The Google Trends Scraper charges $0.002 per result, which is $2.00 per 1,000 results. A result is a whole term or comparison with its timeline, regions and related queries, not one data point. A run also pays for the platform resources it uses.

For our run: 2 results × $0.002 = $0.004 in result fees. The total was $0.0053, because the run also used $0.0012 of compute and $0.0001 of residential proxy traffic. Tracking 1,000 keywords costs $2.00 in result fees plus usage of the same kind. The free plan includes $5 of usage every month with no credit card.

Most older tutorials use pytrends, the unofficial Python library. Its GitHub repository is archived (read-only); its last push was on 10 August 2024, and its latest release on PyPI, 4.9.2, dates from April 2023. Code built on it gets no fixes when Trends changes.

Google announced an official Google Trends API in alpha on 24 July 2025, "available only to a very limited number of testers" who apply for access. It offers a rolling five-year window with daily to yearly aggregation and region breakdowns, and its data runs up to two days ago.

So if you need Trends data in a pipeline today, without an application or an unmaintained library, a hosted scraper is the practical route. For an overview of all the ways to get Trends data programmatically, see our Google Trends API page.

What to watch out for

  • Every request is scaled to its own peak. Terms run separately are each scaled 0–100 on their own: our tea mean of 51.5 and coffee mean of 45.4 can't be compared. To compare terms, put them in one comparison with isMultiple (up to five).
  • Overlapping windows don't stitch. Two runs for adjacent date ranges are scaled separately. Run one longer range, or include a shared reference term in each run.
  • Granularity follows the range. Three months gives daily points, the past 12 months weekly, and short ranges like the past hour fewer points.
  • Rate limits. Google Trends rate-limits datacenter addresses, so the scraper uses residential proxies by default and retries up to four times. In a 600-term test, 8 terms still failed after retries; the status message counts them. Split very large lists across runs or use the Google Sheet input.
  • Empty breakdowns. City and metro tables only appear when Trends publishes them for that country. A list stays empty rather than guessed.
  • Related topics are slower. Google shows them only to visitors it trusts, so the scraper loads each term in a browser and some terms can still come back without topics.

Google Trends shows aggregated, relative search interest that anyone can view without an account. The scraper reads only those public pages, and Scrape.ly Store Actors collect only publicly available data that any visitor can see. It contains no personal data, which removes the main privacy-law concern. Google's terms of service still apply to automated access, and how they bind you depends on where you are and how you use the data. Keep request rates reasonable, cite Google Trends as the source when you publish charts, and ask a lawyer if the data feeds a commercial product. This is not legal advice.

  • Works today, for everyone. No alpha application and no unmaintained library: pick a preset and run.
  • The full picture in one result. Timeline, regions, cities and related queries for $0.002 per term, from the past hour back to 2004.
  • Maintained for you. Residential proxies, retries and Trends' page changes are the scraper's job, not yours.
  • Pipelines and agents. Schedules, a REST API, Python and Node clients, Excel exports and an MCP server. Pair it with the Google Search Results scraper tutorial to see who ranks for the terms that are rising, or browse the rest of the 568 scrapers in the Store.

FAQ

Scrape.ly's free plan includes $5 of usage every month with no credit card. At $0.002 per result, our two-term run cost about half a cent, so the free credit covers many keywords each month.

Call the Google Trends Scraper with the scrapely-client-python package, then read interestOverTime_timelineData from each result into pandas, as in the script above. It replaces pytrends, whose repository is archived.

Google announced a Google Trends API alpha on 24 July 2025 for a limited number of approved testers. Until it's generally available, scraping the public Trends pages is how most teams get the data.

Can I compare more than five terms?

Google Trends compares at most five terms on one chart. For more, run several comparisons that share one reference term, then rescale each run against that term.

Why is the last data point lower?

The latest day or week is often incomplete. The scraper marks it with isPartial: true; drop it before you compute averages or trends.

  • google trends
  • seo
  • market research
  • python
  • api

About the author

Actor publisher on the Scrape.ly Store

Search results, AI answers, web pages and market feeds as structured data. For SEO teams, developers and AI builders, plus finance, crypto and sports data for analysts. A Scrapely studio.

//Keep reading\\

The internet is full of data.
Start owning yours.

Scrape.ly gives you the infrastructure, the tooling, and the team to extract, process, and operationalize web data at any scale. Setup takes minutes. The advantage lasts forever.

No credit card. No setup calls.