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

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.
- No maintenance. The pytrends repository is archived, so a change on the Google Trends side breaks scripts with no fix coming.
- 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).
- 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.
pytrends and the Google Trends API compared
The Google Trends API and pytrends read the same Google Trends data and differ in 5 criteria.
| Criterion | pytrends | Kwerix Google Trends API |
|---|---|---|
| Status | Archived on April 17, 2025 | Maintained Apify Actor |
| HTTP 429 handling | Manual (sleep, proxies, retries) | Automatic retry on a fresh session with rotating residential proxies |
| Cost | Free | $1.50 per 1,000 keywords, no start fee |
| Keywords on one scale | Up to 5 per request | Any number, with a shared anchor |
| Output | pandas DataFrames | JSON, CSV or Excel, one row per keyword |
How to migrate from pytrends to the Google Trends API
There are 4 steps to migrate a pytrends script to the Google Trends API.
- Install the Apify client with
pip install apify-client. - Replace
TrendReq()andbuild_payload()with one call to the Actorkwerix/google-trends-api. - Switch on the data you need:
includeInterestByRegion,includeInterestOverTimeorcompareKeywords. - 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])Which pytrends methods map to which Google Trends API fields?
The Google Trends API covers 5 of the pytrends data methods with fields in the same row.
| pytrends method | Google Trends API input | Output field |
|---|---|---|
interest_over_time() | includeInterestOverTime: true | interestOverTime, averageInterest, trendSlopePctPerYear |
interest_by_region() | includeInterestByRegion: true | interestByRegion |
related_queries() | includeRelatedQueries: true (default) | topQueries, risingQueries, breakoutQueries |
trending_searches(), realtime_trending_searches() | mode: "trending" | one row per trend with searchVolumeLabel |
related_topics() | not available | Google 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.