pytrends alternative: get Google Trends data in Python without 429 errors

The Kwerix Google Trends API is a pytrends alternative that gets the same Google Trends data from Python: interest over time, interest by region and related queries. pytrends was archived on April 17, 2025, while the Google Trends API keeps running, handles HTTP 429 rate limits and costs $1.50 per 1,000 keywords.

KwerixPublished

pytrends alternative illustration: an archived, locked box next to a running data pipeline

Fact sheet: pytrends alternative

Alternative to
pytrends alternative
Also known as
alternative to pytrends, pytrends replacement
Alternative to
pytrends
Type
Open-source library
Status
Archived on April 17, 2025 (read-only)
Website
github.com/GeneralMills/pytrends

What is the pytrends library?

The pytrends library is an unofficial, open-source Python library that downloads reports from Google Trends through the website’s internal endpoints. The library had 3,700 stars and 892 forks on GitHub, and its owner archived the repository on April 17, 2025, which makes it read-only.

Why do developers need a pytrends alternative?

Developers need a pytrends alternative for 3 reasons.

  1. No maintenance. The pytrends repository is archived, so a change on the Google Trends side breaks scripts with no fix coming.
  2. HTTP 429 errors. Google answers bursts of requests from one IP with HTTP 429 «Too Many Requests», and the pytrends issue tracker holds the reports (issue #561 among them).
  3. 5 terms per request. pytrends sends one Google Trends request per payload of up to 5 terms, so ranking a longer keyword list needs manual rescaling.

The Google Trends API and pytrends read the same Google Trends data and differ in 5 criteria.

CriterionpytrendsKwerix Google Trends API
StatusArchived on April 17, 2025Maintained Apify Actor
HTTP 429 handlingManual (sleep, proxies, retries)Automatic retry on a fresh session with rotating residential proxies
CostFree$1.50 per 1,000 keywords, no start fee
Keywords on one scaleUp to 5 per requestAny number, with a shared anchor
Outputpandas DataFramesJSON, CSV or Excel, one row per keyword

There are 4 steps to migrate a pytrends script to the Google Trends API.

  1. Install the Apify client with pip install apify-client.
  2. Replace TrendReq() and build_payload() with one call to the Actor kwerix/google-trends-api.
  3. Switch on the data you need: includeInterestByRegion, includeInterestOverTime or compareKeywords.
  4. Read the rows from the run’s dataset instead of the DataFrames.
from pytrends.request import TrendReq

pytrends = TrendReq(hl="en-US", tz=360)
pytrends.build_payload(["sunscreen", "retinol"], timeframe="today 5-y", geo="US")
over_time = pytrends.interest_over_time()
by_region = pytrends.interest_by_region()
related = pytrends.related_queries()
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("kwerix/google-trends-api").call(run_input={
    "keywords": ["sunscreen", "retinol"], "geo": "US", "timeRange": "today 5-y",
    "includeInterestOverTime": True, "includeInterestByRegion": True,
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["keyword"], row["interestByRegion"][:3], row["risingQueries"][:3])

The Google Trends API covers 5 of the pytrends data methods with fields in the same row.

pytrends methodGoogle Trends API inputOutput field
interest_over_time()includeInterestOverTime: trueinterestOverTime, averageInterest, trendSlopePctPerYear
interest_by_region()includeInterestByRegion: trueinterestByRegion
related_queries()includeRelatedQueries: true (default)topQueries, risingQueries, breakoutQueries
trending_searches(), realtime_trending_searches()mode: "trending"one row per trend with searchVolumeLabel
related_topics()not availableGoogle returns related topics empty through its API

Where does the pytrends alternative lead?

The pytrends alternative leads to the full Google Trends API, which adds the seasonality summary, the publish-by date and the comparison of any number of keywords.

  • The Google Trends API returns every pytrends data type plus seasonality and a common scale, at $1.50 per 1,000 keywords.

pytrends alternative FAQ

Does pytrends still work?

No, not reliably. pytrends still installs with pip, but its repository has been read-only since April 17, 2025, so it receives no fixes when Google changes Google Trends, and bursts of requests end in HTTP 429 errors.

Is pytrends free?

Yes. pytrends is a free, open-source library. The Google Trends API costs $1.50 per 1,000 keywords, and Apify's free plan covers about 3,300 keywords every month.

Is the Kwerix Google Trends API open source?

No. The Actor runs on Apify, while its code examples for Python, JavaScript, cURL and MCP are open source under the MIT license on GitHub.

Sources