pytrends is no longer maintained and breaks constantly on Google's 429 Too Many Requests. This is a small, dependency-light client that keeps working:
- Exponential backoff with jitter and a fresh session (new cookies) on every retry
- Optional proxy rotation - pass a function that returns a new proxy URL per session
- Partial results are kept - if one widget fails you still get the others
- Interest over time, interest by region, related queries (top + rising)
pip install requests
git clone https://github.com/janik4321sdfa/google-trends-api-python
cd google-trends-api-pythonfrom gtrends import keyword_report
r = keyword_report("electric bike", geo="US", timeframe="today 12-m")
print(r["interestOverTime"][:3])
print(r["interestByRegion"][:5])
print(r["relatedQueries"]["rising"][:5])With your own rotating proxies:
from gtrends import TrendsClient
client = TrendsClient(proxy_factory=lambda session_id: f"http://user-session-{session_id}:pass@proxy.example:8000")
report = client.keyword_report("ai agents", geo="GB")Timeframes use the Google Trends syntax: now 7-d, today 1-m, today 3-m, today 12-m, today 5-y, 2024-01-01 2024-12-31.
Google Trends rate-limits single IPs hard. For hundreds or thousands of keywords per day, use the hosted version with residential IP rotation and pay only for successful keywords:
Google Trends Scraper on Apify - $3 per 1,000 keywords, failed keywords are never charged.
Related: Google Trending Now - Keyword Suggestions - Google Flights (Python)
MIT - unofficial, not affiliated with Google.