Google Trends guides · Updated 2026-10-03
Google Trends API in Python: your options in 2026
There is still no open, official Google Trends API. Here is what works today, what broke, and which option fits which job.
The options
| Option | Status (Oct 2026) | Good for | Watch out for |
|---|---|---|---|
| pytrends | Archived. Last release 4.9.2 (April 2023) | Existing notebooks, small one-off pulls | 429 errors, broken trending_searches(), no fixes |
| trendspy | Unofficial, last release 0.1.6 (December 2024) | A newer unofficial client, suggested by the former pytrends maintainer | Same rate limits, since it calls the same website endpoints from your IP |
| Official Google Trends API | Alpha since July 2025, approved testers only | Consistently scaled data you can append over time, 5 years, region breakdowns | No open sign-up, no related queries or Trending now |
| Hosted scraper, for example our Apify Actor | Maintained | Many keywords, schedules, cloud servers, Trending now | Pay per result |
1. pytrends (still the most copied code)
from pytrends.request import TrendReq
pt = TrendReq(hl="en-US", tz=0, retries=3, backoff_factor=1)
pt.build_payload(["coffee", "tea"], timeframe="today 12-m", geo="US")
df = pt.interest_over_time() # DataFrame: date index, one column per term, isPartial
regions = pt.interest_by_region() # one row per US state
related = pt.related_queries() # {"coffee": {"top": df, "rising": df}, ...}
If this starts failing with 429, read pytrends 429 error: why it happens and how to fix it.
2. Hosted: same data, no rate-limit handling on your side
Our free MIT client google-trends-python is one file, standard library only. It calls our Google Trends Scraper through the Apify API and returns plain Python objects, or a pytrends-shaped DataFrame.
import gtrends # export APIFY_TOKEN=... (free Apify account)
df = gtrends.interest_over_time_df(["coffee", "tea"], geo="US", timeframe="today 12-m")
regions = gtrends.interest_by_region("coffee", geo="US")[0]["regions"]
related = gtrends.related_queries("coffee", geo="US")["coffee"]["rising"]
trending = gtrends.trending_now(["US", "GB"], hours=24, limit=20)
Or call the Actor directly with the official apify-client package, which is handy for many comparisons in one run:
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("ctriolab/google-trends-scraper").call(run_input={
"searchTerms": ["coffee, tea, matcha", "bitcoin, ethereum"], # one comparison per line
"geo": "US", "timeframe": "today 5-y",
"includeRelatedQueries": True,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item["type"], item.get("term"), item.get("average"))
Disclosure: we make and sell the Google Trends Scraper (about $1.50 per 1,000 results, less on paid Apify plans).
Parameters that work the same everywhere
| Parameter | Values |
|---|---|
timeframe | now 1-H, now 4-H, now 1-d, now 7-d, today 1-m, today 3-m, today 12-m, today 5-y, all, or YYYY-MM-DD YYYY-MM-DD |
geo | Empty for worldwide, a country (US, KR) or a subregion (US-CA, GB-ENG) |
gprop | Web search (default), images, news, youtube, froogle (Google Shopping) |
cat / category | Google Trends category ID, 0 for all |
FAQ
Does Google have a public Trends API?
Not for everyone. Google launched the Google Trends API as an alpha in July 2025 for a limited group of approved testers. Everyone else uses unofficial clients that read the same data as trends.google.com, or hosted services built on them.
Can I compare more than 5 keywords?
Google Trends compares at most 5 terms on one 0-100 scale. For more, run several comparisons that share one anchor term and rescale them against that anchor.
Why are my numbers different from trends.google.com?
Values are relative within each request and Google samples the data, so the same query can differ slightly between runs. Make sure geo, timeframe, category, property (web, youtube, news) and timezone match the website.
Related: pytrends 429 error · Google Trending now data