pytrends
Pseudo API for Google Trends
What it is and what it does
pytrends is an unofficial wrapper around Google Trends that automates downloading trend reports without requiring manual interaction with the web interface. It uses requests, pandas, and lxml to fetch and parse data on keyword search interest, geographic distribution, related searches, and trending topics. The package supports configurable parameters like time ranges, geographic regions, categories, and Google properties (web, images, news, YouTube, shopping).
The library is designed for developers who need programmatic access to Google Trends data for research, monitoring, or analysis. It handles connection details like proxies, retries, and backoff strategies to work around Google's rate limiting. However, because it reverse-engineers an unofficial API, it is inherently fragile—any backend changes by Google can break functionality, and the package has been abandoned since April 2023 with no active maintenance.
Use it for:
- Track keyword search volume trends over time for SEO research or market analysis
- Compare search interest across multiple geographic regions to identify regional demand patterns
- Monitor trending searches in real time or retrieve historical trending data for news/content planning
- Discover related topics and queries to a keyword for content ideation or competitive analysis
- Automate bulk trend data collection for academic research or business intelligence dashboards
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides an unofficial interface to download and analyze Google Trends data, including search interest over time, regional breakdowns, related topics, and trending searches.
No—not recommended for new projects. While the package is permissively licensed and has low install friction, it is abandoned (last release April 2023, repository archived) with no active maintenance. Google's backend changes will break the unofficial API without fixes. Use only if you have an existing codebase already depending on it and can tolerate potential breakage; for new work, seek an officially supported alternative or Google's official APIs.
Install
pytrends on PyPI
pip
pip install pytrendsuv
uv add pytrendspoetry
poetry add pytrendsInstalling pytrends
Before you install
Low install friction with common dependencies (requests, pandas, lxml). However, the package is abandoned as of 2023-04-13 and the repository is archived; maintenance has ceased and Google API changes will break functionality without fixes.
License in practice
Licensed under Apache 2.0 (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
from pytrends.request import TrendReq
pytrends = TrendReq(hl='en-US', tz=360)
pytrends.build_payload(['Blockchain'], cat=0, timeframe='today 5-y')
df = pytrends.interest_over_time()
Requires Python 3.7 or later; Google may have changed their backend since the last release, potentially breaking API calls.
Verify before relying
- Whether Google has changed their backend since the last release, potentially breaking the unofficial API
- Current reliability and success rate of API calls against Google's actual endpoints
- Whether proxy and retry logic still effectively circumvent rate limiting
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — requests, pandas, lxml |
| Maintenance | abandoned — 1,219 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 1,587,165/month — #3,737 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytrends-4.9.2-py3-none-any.whl
Keywords: google, trends, api, search
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
trendspyFetch and analyze Google Trends data including…
permissive · top 15,000 on PyPI
TikTokApiUnofficial Python wrapper for retrieving public…
permissive · top 15,000 on PyPI
eventregistryQuery news articles and events from Event…
permissive · top 15,000 on PyPI
openmeteo-requestsFetches weather data from the Open-Meteo API…
permissive · top 15,000 on PyPI
gnewsGNews searches Google News RSS feeds and…
permissive · top 15,000 on PyPI
twikitTwikit is a Twitter scraper library that lets…
permissive · top 15,000 on PyPI
keepaQuery Amazon product data and pricing history…
permissive · top 15,000 on PyPI
yahooqueryRetrieves financial data from Yahoo Finance…
permissive · top 15,000 on PyPI
baostockBaoStock retrieves historical China stock…
permissive · top 15,000 on PyPI
tushareFetches historical and real-time Chinese stock…
permissive · top 15,000 on PyPI