Google Trends is one of the first tools people open for keyword research. Is this topic growing or fading? Which of two names do people search for more? What related searches are taking off? For one quick question the website is fine. It gets slow when you want a dozen comparisons, several countries, or a table you can rerun next month.
The website has a download button on each chart, so the manual route is: set up the comparison, download the CSV, repeat for every chart, then merge the files. Every chart is scaled so its highest point is 100, which means numbers from different downloads aren't on the same scale, so you have to keep track of which file came from which comparison. Scripting it yourself runs into the other problem: Google often answers automated Trends requests with "too many requests".
This tutorial uses an Apify Actor that collects Trends data and returns one row per search term and data type, with summary columns plus the full timeline.
Disclosure: I built and maintain this Actor. It is a paid tool ($1.50 per 1,000 results). One result is a whole timeline or a whole related-queries list, not a single data point.
What you can do with the data
- Compare keywords on one scale. Put up to 5 terms on one line and they share one 0-100 scale, like the Compare button on the website.
- Check seasonality and direction before you plan content: is interest higher this year than last year?
- Find content ideas. Rising related queries show what people started searching for recently.
- See where interest is. Interest by region gives every country, state, city or US metro with its value.
Step 1: Set up a run in Apify Console
Open Google Trends Scraper and click Try for free. The main fields:
| Field | What it does |
|---|---|
Search terms (searchTerms) |
One line per search. Up to 5 terms on one line, separated by commas, are compared on one scale. A Google Trends explore URL also works. |
What data to get (dataTypes) |
Any of interestOverTime, interestByRegion, relatedQueries, trendingNow. Default: interest over time and related queries. |
Locations (geos) |
Empty for worldwide, or codes like US, GB, US-CA. Each line runs once per location. |
Time range (timeRange) |
From pastHour to past5Years or all (2004 to now), or custom with startDate and endDate. Default past12Months. |
Category (category) |
Google Trends category id, e.g. 5 Computers & Electronics, 71 Food & Drink. Default 0 (all). |
Google search type (property) |
web (default), images, news, youtube, shopping. |
Region level (regionLevel) |
auto, city or metro (US only), for interest by region. |
Max results (maxItems) |
Default 1,000. |
Trending now has its own options (trendingGeos, trendingHours, trendingCategories and more) and doesn't need search terms.
Step 2: Run it and export
Say you're planning content about note-taking apps for a US audience and want to know which app to write about first. My first run compared three of them over 5 years:
{
"searchTerms": ["notion, obsidian, evernote"],
"dataTypes": ["interestOverTime", "relatedQueries"],
"geos": ["US"],
"timeRange": "past5Years",
"maxItems": 20
}
It took about 12 seconds and saved 6 results: a timeline and a related-queries list for each term. The averages came back almost equal: 47 for notion, 48 for obsidian, 5 for evernote. The related queries showed why that's misleading. The top rising queries for "obsidian" were about a Pokemon card set ("pokemon obsidian flames", "obsidian flames charizard"), and the top queries for "obsidian" included "obsidian minecraft" and "obsidian crystal". For "notion", the list included "notion meaning" and "notion definition". Both words mean other things.
So the second run added the Computers & Electronics category:
{
"searchTerms": ["notion, obsidian, evernote"],
"dataTypes": ["interestOverTime", "relatedQueries"],
"geos": ["US"],
"timeRange": "past5Years",
"category": 5,
"maxItems": 20
}
About 15 seconds, 6 results. Here is the "obsidian" timeline, with the 262 weekly points cut down to the first two and last two:
{
"type": "interestOverTime",
"searchTerm": "obsidian",
"comparedWith": ["notion", "evernote"],
"geo": "US",
"timeRange": "past5Years",
"startDate": "2021-11-02",
"endDate": "2026-11-02",
"category": 5,
"categoryName": "Computers & Electronics",
"resolution": "WEEK",
"averageInterest": 38,
"peakInterest": 88,
"peakDate": "2026-04-12T00:00:00Z",
"latestInterest": 44,
"latestDate": "2026-10-25T00:00:00Z",
"firstInterest": 8,
"dataPoints": 262,
"timeline": [
{"date": "2021-10-31T00:00:00Z", "value": 8, "isPartial": false},
{"date": "2021-11-07T00:00:00Z", "value": 12, "isPartial": false},
{"date": "2026-10-25T00:00:00Z", "value": 44, "isPartial": false},
{"date": "2026-11-01T00:00:00Z", "value": 41, "isPartial": true}
],
"url": "https://trends.google.com/trends/explore?date=today+5-y&geo=US&q=notion%2Cobsidian%2Cevernote&cat=5"
}
With the category, the averages changed to 53 for notion, 38 for obsidian and 16 for evernote. The top related queries for "obsidian" became "obsidian sync", "obsidian notes" and "obsidian app". The last week is marked isPartial: true because it isn't over yet, and latestInterest skips it.
The category doesn't remove everything, though. "obsidian flames" was still the top rising query for "obsidian" in the second run, so you still need to read the lists before you trust them.
Step 3: Do it from Python
pip install apify-client pandas
from apify_client import ApifyClient
import pandas as pd
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("pipiagent/google-trends-scraper").call(run_input={
"searchTerms": ["notion, obsidian, evernote"],
"dataTypes": ["interestOverTime", "relatedQueries"],
"geos": ["US"],
"timeRange": "past5Years",
"category": 5,
})
items = list(client.dataset(run.default_dataset_id).iterate_items())
# One column per term, weekly values, without the unfinished last week
series = {}
for item in items:
if item["type"] != "interestOverTime":
continue
timeline = pd.DataFrame(item["timeline"])
timeline = timeline[~timeline["isPartial"]]
series[item["searchTerm"]] = timeline.set_index(pd.to_datetime(timeline["date"]))["value"]
wide = pd.DataFrame(series)
print(wide.groupby(wide.index.year).mean().round(1))
# Last 52 weeks vs the 52 weeks before, in percent
change = (wide.tail(52).mean() / wide.iloc[-104:-52].mean() - 1) * 100
print(change.round(1))
# Rising related queries, minus the ones that are clearly about something else
rising = pd.DataFrame([
{"searchTerm": item["searchTerm"], **query}
for item in items if item["type"] == "relatedQueries"
for query in item["rising"]
])
noise = ["flames", "pokemon", "charizard"]
rising = rising[~rising["query"].str.contains("|".join(noise))]
print(rising.sort_values("growthPercent", ascending=False).head(12)[["searchTerm", "query", "growthText"]])
With my second run, the yearly averages looked like this (2021 covers only November and December):
notion obsidian evernote
2021 19.3 10.4 14.8
2022 45.1 20.7 23.1
2023 57.1 31.5 20.1
2024 57.3 39.0 15.2
2025 61.3 46.3 11.0
2026 52.5 60.0 7.3
And the year-over-year change was -15.6% for notion, +27.4% for obsidian and -33.8% for evernote. With all categories, the same calculation said +13.0% for notion. That's the difference the category filter made, and it changes which article you'd write first. The filtered rising list included "obsidian copilot", "obsidian kanban", "logseq vs obsidian" and "amplenote", which are usable topic ideas.
What it costs
You pay per saved result: $1.50 per 1,000 results. One search term gives one result per data type, and a 5-year timeline with 262 weekly values is still one result. There is no start fee and no monthly rental.
- Each of my test runs: 6 results, $0.009.
- 20 terms with interest over time, by region and related queries: 60 results, $0.09.
- Trending now, 50 searches in each of 10 countries: 500 results, $0.75.
Terms with no data produce no result and cost nothing. You can set a maximum charge per run in the run options.
Limitations
From the README, and worth reading before a large project:
- Google rate-limits Trends heavily. The Actor paces requests, retries and switches addresses, and both of my runs went through with no retries. But at busy times Google can refuse every address for tens of minutes, and keyword runs started then fail. The Actor keeps what it saved and lists what failed. Split very large runs into smaller ones. Trending now uses a different Google service and is less affected.
- A misspelled or made-up term can look like a block. Google sometimes answers nonsense terms with "too many requests". Check spelling first.
- Values are relative, not search counts. Only terms on the same line share a scale. Values from different runs or lines can't be compared directly.
- Google samples its data. The same query run twice can differ by a few points.
- Related topics are not included, because Google returns an empty list to automated visitors. Related queries need enough search volume; rare terms often have none.
- Metro areas exist only for the US, and city-level data is often empty.
Related tools
To see what's being written about a rising query, Google News Scraper exports articles by keyword and date range. For video keyword research, YouTube Search Scraper exports search results with view counts and (estimated) upload dates.
The input form and more examples are on the Google Trends Scraper store page. If something doesn't work the way this article says, open an issue there and I'll look into it.
Top comments (0)