pytrends is Dead: The Best Google Trends Alternatives in 2026
pytrends breaks constantly, the maintainer has stepped back, and the official Google Trends API is still not public. The alternatives that actually work in 2026.
The actor referenced in this article. Pay only for results delivered.
pytrends was a beloved Python library for accessing Google Trends data. It was unofficial (Google has no public Trends API), maintained by a single developer, and worked well enough for years. Today it is effectively dead.
TL;DR: pytrends hasn’t been meaningfully updated since 2022 and fails consistently on cloud servers because Google blocks datacenter IPs from widgetdata endpoints. Working alternatives: direct HTTP with a residential proxy, a managed Google Trends scraper at $0.004/keyword-report, or SerpAPI at $75/month for 5,000 searches. Google Keyword Planner gives absolute volumes for free.
Here is the current state of pytrends and every alternative worth considering.
What Happened to pytrends
pytrends works by reverse-engineering Google Trends’ internal API. The library has not had a meaningful update since 2022. GitHub issues report consistent 429 errors, empty data returns, and API format changes that the library does not handle.
The root technical problem: Google moved the widgetdata API behind datacenter IP blocking. pytrends runs from your local machine (residential IP) and may work interactively, but runs from cloud servers — which is where you actually want to use it — get blocked.
The library also does not handle Google’s XSSI prefix ()]}',\n) correctly in all cases, and the req= parameter encoding for newer Trends features has changed.
Alternative 1: Direct HTTP with Explore + Widgetdata
The architecture that actually works:
- Call
/trends/api/exploreto get widget tokens (no residential IP needed) - Call
/trends/api/widgetdata/*with those tokens using a residential proxy
This is not a public API — it is the same reverse-engineering approach as pytrends, done correctly.
import requests
import json
import re
import urllib.parse
def get_trends(keyword: str, timeframe: str = 'today 12-m', geo: str = 'US', proxy: str = None) -> dict:
session = requests.Session()
proxy_config = {'https': proxy} if proxy else None
# 1. Seed NID cookie
session.get('https://trends.google.com/trends/', proxies=None, timeout=10)
# 2. Get widget tokens (no proxy needed)
explore_params = {
'hl': 'en-US',
'tz': '-330',
'req': json.dumps({
'comparisonItem': [{'keyword': keyword, 'geo': geo, 'time': timeframe}],
'category': 0,
'property': '',
}),
'token': 'APP6_UEAAAAAZ...', # Not needed for explore
}
explore_url = 'https://trends.google.com/trends/api/explore'
resp = session.get(explore_url, params=explore_params, timeout=15)
# Strip XSSI prefix
data = json.loads(resp.text.lstrip(")]}',\n"))
widgets = data.get('widgets', [])
results = {}
# 3. Fetch each widget's data (requires residential proxy)
for widget in widgets:
widget_id = widget.get('id')
endpoint_map = {
'TIMESERIES': 'multiline',
'GEO_MAP': 'comparedgeo',
'RELATED_QUERIES': 'relatedsearches',
'RELATED_TOPICS': 'relatedsearches',
}
if widget_id not in endpoint_map:
continue
endpoint = endpoint_map[widget_id]
widget_url = f'https://trends.google.com/trends/api/widgetdata/{endpoint}'
widget_resp = session.get(
widget_url,
params={
'hl': 'en-US',
'tz': '-330',
'req': json.dumps(widget['request']),
'token': widget['token'],
},
proxies=proxy_config,
timeout=20,
)
widget_data = json.loads(widget_resp.text.lstrip(")]}',\n"))
results[widget_id] = widget_data
return results
Requires: A residential proxy for the widgetdata calls. Works from cloud infrastructure.
Alternative 2: Google Trends Pro (Managed)
Our Google Trends Pro actor implements the explore + residential widgetdata pattern with automatic proxy rotation. No proxy subscription required — Apify’s RESIDENTIAL pool is included.
from apify_client import ApifyClient
client = ApifyClient('YOUR_API_TOKEN')
run = client.actor('themineworks/google-trends-pro').call(run_input={
'keywords': ['python scraping', 'apify', 'bright data'],
'timeframe': 'today 12-m',
'geo': 'US',
'includeRelatedQueries': True,
'includeInterestByRegion': True,
})
for item in client.dataset(run['defaultDatasetId']).iterate_items():
print(item['keyword'])
print(f" Peak interest: {max(p['value'] for p in item['interest_over_time'])}")
rising = item.get('related_queries', {}).get('rising', [])
print(f" Rising queries: {[r['query'] for r in rising[:3]]}")
Alternative 3: Google Keyword Planner (Absolute Volumes)
If you need absolute search volumes rather than relative trends indices, Google Keyword Planner (part of Google Ads) is the authoritative source. Requires a Google Ads account (free to create, no spending required).
The limitation: Keyword Planner gives monthly search volume estimates in ranges (1K-10K), not precise numbers, and only updates monthly.
Alternative 4: Third-Party SEO Tools
Ahrefs, Semrush, and Moz all provide keyword volume data from their own panel-based estimates. These are more accurate for absolute volumes than Google Trends, but cost $99-299/month.
For trend direction (rising vs declining), Google Trends remains more accurate than SEO tool estimates because it uses real Google search data rather than panel extrapolation.
Alternative 5: SerpAPI with Google Trends Endpoint
SerpAPI offers a Google Trends endpoint that abstracts the scraping layer. Pricing is per API call. The data quality matches direct Google Trends access.
import requests
params = {
'engine': 'google_trends',
'q': 'python scraping',
'date': 'today 12-m',
'api_key': 'YOUR_SERPAPI_KEY',
}
data = requests.get('https://serpapi.com/search', params=params).json()
Cost: SerpAPI charges $75/month for 5,000 searches. More expensive than direct access at scale.
Comparison Table
| Option | Monthly Cost | Requires Proxy | Maintenance | Reliability |
|---|---|---|---|---|
| pytrends (cloud) | Free | Yes | DIY | Low |
| Direct HTTP (correct) | Proxy cost only | Yes | DIY | High |
| Google Trends Pro | Usage-based | No | None | High |
| SerpAPI | $75+ | No | None | High |
| Google Keyword Planner | Free | No | None | Medium (absolute vol only) |
Bottom Line
pytrends is not worth maintaining in 2026 for cloud usage. The direct HTTP approach works but requires a residential proxy subscription and maintenance when Google updates its API. For most developers, a managed solution is the practical choice — you pay a small per-query cost and get reliable data without any infrastructure work.
Frequently Asked Questions
Is pytrends still maintained in 2026?
pytrends has not received a meaningful update since 2022. The maintainer has effectively stepped back from the project. Current GitHub issues document consistent failures including 429 errors on cloud servers, empty data returns, and broken XSSI prefix handling. It is not recommended for production or any cloud-based deployment.
What replaced pytrends for production Google Trends data?
The most robust replacement is a direct HTTP implementation using Google’s explore/widgetdata endpoint pattern with a residential proxy for the widgetdata calls. Managed services like Google Trends Pro abstract this entirely. SerpAPI’s Google Trends endpoint costs $75/month for 5,000 searches. Google Keyword Planner provides absolute monthly volumes for free but not trend direction.
Why does Google Trends block datacenter IPs?
Google Trends blocks datacenter IP ranges — AWS, GCP, Azure — from accessing the widgetdata API endpoints where interest over time, related queries, and regional breakdowns live. The explore endpoint works from any IP to return widget tokens, but the actual data requests require a residential or mobile IP.
What does Google Trends Pro cost compared to pytrends plus a proxy?
pytrends is free but requires a residential proxy subscription ($30–100/month) to work reliably on cloud infrastructure. Google Trends Pro charges $0.006 per keyword report with zero charge on failures. For production workloads with 100–500 keywords per month, the managed option is cost-competitive with DIY costs once developer time is factored in.
Does Google Keyword Planner give the same data as Google Trends?
No. Google Keyword Planner gives monthly search volume estimates from Google Ads data, in ranges like 1K–10K per month. Google Trends gives relative search interest indexed 0–100 showing trend direction over time. Use Keyword Planner for absolute volumes; use Trends for understanding whether a topic is rising, declining, or seasonal.
Explore the scraper referenced in this article — see inputs, outputs, and pricing, then run it on Apify.
Frequently asked questions
Is pytrends still working in 2026? +
pytrends works from residential IP addresses but fails consistently from cloud servers and Docker containers. Google blocks datacenter IP ranges from the widgetdata endpoints where actual trend data lives.
What is the best pytrends alternative in 2026? +
For production use, a managed scraper like Google Trends Pro handles the residential IP routing automatically. For light local use, pytrends with a residential proxy still works.
Why does pytrends return empty data arrays? +
Empty data usually means the widgetdata request was blocked by Google. The explore endpoint returns a 200 with widget tokens, but the downstream widgetdata calls return 429s from datacenter IPs.
Can I get Google Trends data without pytrends? +
Yes. The Google Trends Pro actor on Apify provides reliable trend data including interest over time, interest by region, and related queries without any proxy setup.
Zestimate vs Redfin Estimate: Which Home Value Is More Accurate?
Redfin publishes a 1.85% median error rate on listed homes. What that hides, why Zestimate and Redfin Estimate disagree, and how to test accuracy in your own ZIP.
Best Threads Scrapers Compared (2026): Prices, Success Rates, and What Each One Misses
Eight Threads scrapers on the Apify Store compared with public data: price per 1,000 posts, start fees, run success, ratings, and modes. Including where ours is not the right pick.
X API Pay-Per-Use vs Scraping in 2026: What 10,000 Tweets Actually Costs
X killed the $200/month Basic tier for new developers and moved to metered pricing at $0.005 per post read, capped at 2M reads a month. Here is the real cost math against a pay-per-result scraper, and the cases where the official API is still the right call.