Sitemap

Handling pytrends 429 errors: a hosted Google Trends workflow in Python

5 min readOct 21, 2026

--

If a Python script that reads Google Trends starts returning HTTP 429, retrying the same request in a tight loop is unlikely to help. You need to reduce the work, handle refusals, and decide how much of that maintenance belongs in your application.

Disclosure: I built and maintain the SusLabs Google Trends Scraper on Apify. This article explains the trade-offs and shows how to use it from Python. Writing disclosure: This article was drafted with AI assistance and reviewed against the Actor source code, saved run data and the maintainer’s technical review.

Press enter or click to view image in full size
AI-generated SusLabs cover illustration. The decorative chart is not measured data; the comparison figures below come from a saved 21 October 2026 run.

Start by reducing the work

A trend report can involve several upstream requests: the timeline, regional interest and related queries are separate panels. If you only need a timeline, avoid requesting the other panels. Cache completed historical work, limit concurrency, and use bounded backoff rather than immediate repeated retries.

These measures can reduce refusals; they cannot guarantee a successful response. There is no universal pause duration that resets Google’s limits for every session or network.

The original pytrends repository was archived on 17 April 2025. Its interface supports retries, backoff and a list of proxies, but operating a dependable data pipeline still requires handling upstream changes and incomplete responses.

Google also announced an official Trends API alpha in July 2025. Check Google’s current access process before choosing a route. The scraper below is an independent SusLabs product; it is not Google’s official API.

When a hosted Actor helps

For an occasional manual check, exporting from the Trends website may be sufficient. For a scheduled research job, a hosted tool lets you consume structured results while it handles connections, retries and storage.

The SusLabs Actor tries direct requests first and can fall back to residential proxies. It retries refused panels separately and marks a report partial when a requested panel remains unavailable. A completed run does not necessarily mean every requested report was delivered, so your client should inspect the result status.

Compare three keywords from Python

Install the client:

pip install "apify-client>=3,<4"

Set APIFY_TOKEN in your environment, then run this example. It starts a paid Actor run through your Apify account, with a $0.05 maximum event charge. Use the live listing to confirm pricing first.

import os
from datetime import timedelta
from decimal import Decimal
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("suslabs/google-trends-scraper").call(
run_input={
"mode": "compare",
"searchTerms": ["ChatGPT", "Gemini", "Claude"],
"geo": "US",
"timeRange": "today 12-m",
"sections": ["interestOverTime", "interestByRegion", "relatedQueries"],
},
memory_mbytes=512,
run_timeout=timedelta(seconds=180),
max_total_charge_usd=Decimal("0.05"),
)
if run is None or run.status != "SUCCEEDED":
raise RuntimeError("Actor did not succeed; inspect the run before using results")
for row in client.dataset(run.default_dataset_id).iterate_items():
if row.get("type") in {"_summary", "status"}:
continue
if row.get("status") != "ok" or not row.get("dataComplete"):
print("Report unavailable or incomplete:", row.get("errorCode"))
continue
# Compare mode wraps keyword reports in a comparison group.
for report in row.get("perKeyword") or [row]:
print(
report["searchTerm"],
report.get("averageInterest"),
report.get("trendDirection"),
)

The group contains the individual keyword reports, a ranking and a shared-scale timeline. For separate keyword reports, choose "mode": "keywords"; those timelines are normalized independently.

Read the numbers on the right scale

Google Trends reports relative interest, not absolute search counts. Independently normalized reports cannot establish that one keyword is searched more often than another. Compare mode requests up to five terms together on one scale; longer lists are grouped, and separate groups should not be treated as one shared scale without explicit normalization.

In a saved US comparison collected on 21 October 2026, the Actor’s Google-provided average indices were 78 for ChatGPT, 29 for Gemini and 20 for Claude. Their shares of the sum of those three averages were 61.417%, 22.835% and 15.748%. Those are shares within this selected-term comparison, not shares of AI users or the entire search market. Fresh runs can differ because Google samples and revises its data.

Get SusLabs’s stories in your inbox

Join Medium for free to get updates from this writer.

The Actor’s changePercent field compares the last quarter of complete measurable observations with the first quarter. It should not be labeled year-over-year growth. Use matching periods when you need a year-over-year comparison, and exclude a partial current bucket from complete-period analysis.

Map a pytrends workflow

  • Keyword list, country, timeframe: searchTerms, geo, timeRange
  • Category and search property: categoryId, property
  • Interest over time: interestOverTime
  • Interest by region: interestByRegion; select regionResolution
  • Top and rising related queries: relatedQueries.top and .rising
  • Trending searches: mode: "trending"

This is a workflow mapping, not a claim that every pytrends method or DataFrame shape is identical. Related topics are not currently offered by this Actor.

What gets charged

At the Free-tier prices checked on 21 October 2026, prices per 1,000 result events are:

  • Complete keyword report: $2.00
  • Complete comparison group, up to five keywords: $5.00
  • Trending search item: $1.00
  • Topic-suggestion result: $1.50

There is also a $0.00005 Actor start event per GB, with at least one event per start. At the default 512 MB, one complete comparison group therefore costs $0.00505 in event fees. Failed, empty, partial and unchanged reports have no result event charge; the startup event still applies. Additional sampling, comparison groups and daily-estimate baseline/windows can add billable events. A partial daily estimate can still charge for its complete baseline and usable fitted windows. Higher plans have discounted event prices. Check the listing before running.

Monitoring and integrations

Monitoring can retain a baseline and label observations NEW, UPDATED or UNCHANGED. Tolerance settings reduce alerts from sampling variation; they do not eliminate false positives. Newly complete time buckets can count as updates even when the numeric values barely move. Keep the monitor name stable and avoid overlapping runs for the same monitor.

You can export datasets as JSON or CSV, or connect the Actor to Sheets and automation tools. The local n8n and Make examples are starting points that need your own credentials and an import test. AI clients can access the Actor through Apify’s shared MCP service; it is not a separate SusLabs-hosted MCP server.

Choose the option that fits the job: manual export for a quick check, a maintained client or the official API where available, or a hosted Actor for recurring structured output. Whichever route you choose, preserve the date, region and scale alongside the values.

Try the SusLabs Google Trends Scraper on Apify.

--

--

SusLabs
SusLabs

Written by SusLabs

Practical data tools for research and automation. Creators of Google Trends Scraper on Apify. https://apify.com/suslabs