pytrends 429 TooManyRequestsError: what it means and what to do
Checked on 2026-11-19.
pytrends raises TooManyRequestsError when Google Trends answers one of its requests with HTTP status 429: Google has decided that too many requests came from your address. Your code is not wrong, and upgrading will not help, because the library was archived in April 2025. What is left is to slow down, to wait, or to get the data another way.
What the error means
The full message is:
pytrends.exceptions.TooManyRequestsError: The request failed: Google returned a response with code 429In the library's source, TooManyRequestsError is a subclass of ResponseError, described as the "Exception raised when the backend returns a 429 error code". Status 429 is the web's standard answer for rate limiting: "the user has sent too many requests in a given amount of time" (RFC 6585).
pytrends is, in its README's words, an "Unofficial API for Google Trends" and "not an official or supported API". Its requests go to addresses under trends.google.com/trends/api, and Google limits how many of them it answers. How many is not known: "Rate Limit is not publicly known", the README says.
The issue tracker shows that it is not only heavy use that meets the limit. One user wrote "I can't get past the first request" (issue 558). Another, on version 4.9.2, got the error "for all requests" from one day to the next (issue 588).
Why no update will fix it
The repository carries this banner: "This repository was archived by the owner on Apr 17, 2025. It is now read-only." The latest release on PyPI is 4.9.2, from April 2023, and the README still says "Looking for maintainers!". The issues about 429 that were open when it was archived are still open, and a read-only repository cannot merge a fix.
So the question is not which version to install. It is whether your use fits inside a limit nobody outside Google knows.
What you can do with pytrends
1. Catch the error and wait
The README's caveats give one number: "60 seconds of sleep between requests (successful or not) appears to be the correct amount once you reach the limit."
import time
from pytrends.request import TrendReq
from pytrends.exceptions import TooManyRequestsError
pytrends = TrendReq(hl="en-US", tz=360)
for attempt in range(3):
try:
pytrends.build_payload(["pickleball"], cat=0, timeframe="today 12-m", geo="US", gprop="")
print(pytrends.interest_over_time())
break
except TooManyRequestsError:
print("429 from Google Trends, waiting 60 seconds")
time.sleep(60)That sentence reports a test from the years the library was maintained; it is not a promise by Google. One open issue is titled "Error 429 for the past few days" (issue 614), so stop after a few tries instead of looping forever.
2. Make fewer requests
In the source, build_payload sends a request of its own to get tokens, and interest_over_time(), interest_by_region() and related_queries() each send at least one more. Call only the ones you need, save what you get, and do not fetch the same period twice.
3. Know what retries and backoff_factor do
The README documents two options of TrendReq, retries and backoff_factor. Two things to know before you rely on them:
- With urllib3 version 2, setting either one fails with
TypeError: Retry.__init__() got an unexpected keyword argument 'method_whitelist'. urllib3 removed that option in 2.0.0, and the issue about it (591) is still open. The reporter's workaround ispip install "urllib3<2". - The README's example values,
retries=2, backoff_factor=0.1, wait fractions of a second between tries. That is far from the 60 seconds above.
4. Proxies
The README shows a proxies option "if you want to use proxies as you are blocked due to Google rate limit". That is a way around Google's limit, not a way to stay inside it; you would have to buy and run the proxies, and this guide does not go into it.
Google's own routes
- The Trends API (alpha). Google announced an official Google Trends API on July 24, 2025. It "will be available only to a very limited number of testers", and you apply with a form.
- The Download button. Charts on trends.google.com can be exported as CSV files, by hand.
- The BigQuery dataset. Google publishes the top 25 and the top 25 rising queries as a public dataset. You cannot ask it about a term of your choice.
The guide on getting Google Trends data in Python has the details and the code for each.
An HTTP API instead of the library
Pipefetch has a Trends endpoint: one GET request for one term, answered with interest over time, interest by region and the top and rising related queries.
import os
import requests
res = requests.get(
"https://pipefetch.com/v1/google/trends",
params={"q": "pickleball", "geo": "US", "period": "12m"},
headers={"x-api-key": os.environ["PIPEFETCH_API_KEY"]},
timeout=90,
)
if res.status_code == 404:
print("Too little search volume for this term") # not charged
elif res.status_code == 502:
print("Google Trends turned the request away") # not charged, send it again
else:
res.raise_for_status()
data = res.json()["data"]
print(data["summary"]["averageInterest"], data["summary"]["trendDirection"])
for point in data["interestOverTime"]:
print(point["date"], point["interest"])
for region in data["interestByRegion"][:5]:
print(region["regionName"], region["interest"])
for query in data["relatedQueries"]["rising"][:5]:
print(query["query"], query["formattedValue"])It does not make Google's limit disappear. Google Trends limits how many searches one address may make, ours included. When it turns ours away, the request answers 502 upstream_error, costs nothing and can be sent again. A term with too little search volume answers 404 no_data, which is free as well.
What it leaves out compared with pytrends: related topics, comparisons of several terms in one request (pytrends takes up to five), and city or metro resolution. Regions are countries when geo is left out, and the states or regions of the country when it is given. It is not an official API, and Pipefetch is not affiliated with Google. A request costs 1 credit, and a new account has 100 free credits and needs no card. The reference lists every field.
Which one should you use?
| Situation | Use |
|---|---|
| A few terms now and then, on your own computer | pytrends, with a 60-second wait and a cap on retries |
| One chart, once | The Download button on trends.google.com |
| What is trending, not a term you chose | The BigQuery dataset |
| A product you will run for years on official data | Apply for Google's Trends API alpha |
| A server or a scheduled job that needs one term's data today | An HTTP API such as Pipefetch, or pytrends if its errors are rare enough for you |
Try it with 100 free credits. No card needed. No scraper to build or maintain. Get an API key or read the docs.
APIs used in this guide
More Google guides
- How to get Google search results in Python
- How to get Google Trends data in Python
- Why is Wyoming first in Google Trends?
- How to get Google search results in Node.js
- How to get Google search results into Google Sheets
- How to give an LLM live Google results with tool calling
Guides for other sources
Every source
YouTube
- How to get a YouTube transcript in Python
- How to get a YouTube transcript in Node.js
- YouTube API quota exceeded: what the error means and how to fix it
- How to find a YouTube channel ID from a handle or URL
- How to download YouTube subtitles as SRT or VTT
- youtube-transcript-api RequestBlocked or IpBlocked: why it happens and how to fix it
- How to get YouTube comments in Python
- How to search YouTube from Python
- How to list a YouTube channel's videos in Python
- How to summarize a YouTube video with an LLM in Python
- How to get YouTube transcripts and video stats in Google Sheets
- How to get YouTube video views and likes in Python
- How to get YouTube transcripts in n8n, Make and Zapier
- LangChain YoutubeLoader fails on a server: why, and a loader that works
- How to get a YouTube channel's subscriber count in Python
- How to give Claude or Cursor access to YouTube (MCP server)
- How to get YouTube comments in Node.js
- How to analyze YouTube comments with an LLM in Python
- How to list a YouTube channel's Shorts in Python
- How to search YouTube from JavaScript
- How to get an Instagram follower count in Python
- Instagram Basic Display API alternatives: what to use after the shutdown
- Instaloader 401 Unauthorized, 429 and "Login required": what to do
- How to calculate an Instagram engagement rate in Python
- How to get an Instagram follower count in Node.js
- How to get Instagram follower counts in Google Sheets
- How to get Instagram Reel views in Python
Websites
- Clearbit Logo API alternatives: get a company logo from its domain
- How to extract email addresses from a website in Python
- How to turn a web page into Markdown in Python
- How to detect what a website is built with, in Python
- How to get the contact emails and phone numbers of websites in Google Sheets
- How to build a LangChain tool that reads web pages and searches Google
- How to turn a web page into Markdown in JavaScript for RAG
- How to extract social media links from a website in Python
- How to get a website's favicon in Python
- How to check robots.txt in Python before you fetch a page
TikTok
- How to get a TikTok video's views and likes in Python
- How to get the comments of a TikTok video in Python
- How to get a TikTok follower count in Python
- TikTok Research API: who can get access, and what to do if you cannot
- How to get TikTok video views, likes and shares in Node.js
- How to get TikTok views, likes and follower counts in Google Sheets
- How to get a Facebook Page's posts without app review
- Is there a Facebook Marketplace API?
- Facebook Groups API alternatives after its removal in 2024
- How to get a Facebook Page's follower count and contact details in Python
Threads
- How to get LinkedIn company data in Python
- How to search LinkedIn jobs from Python
- How to get a LinkedIn company page's latest posts in Python