Urgent.News

What's breaking now, across thousands of outlets.

Tech

pytrends keeps failing with 429 Too Many Requests? Here's a drop-in fix

If you use pytrends for Google Trends data, you have probably seen this more and more often: pytrends.exceptions.TooManyRequestsError: The request failed: Google returned a response with code 429 Two things changed: pytrends was archived in April 2025. The repository is read-only, so nobody is fixing the blocking. Google's official Trends API is still in closed alpha (announced July 2025), and…

If you're using pytrends to access Google Trends data, you may have encountered the error "429 Too Many Requests." Two recent changes have worsened the situation: pytrends was archived in April 2025, and Google's official Trends API is still in closed alpha. Google is rate-limiting Trends more strictly than ever, especially when accessed from cloud servers, Colab, or CI runners, which is where most scripts run.

The usual workarounds, such as adding "time.sleep()" between calls, setting "retries" or "backoff_factor=", or rotating your own proxies, only partially solve the problem. These methods require managing proxies, cookies, consent pages, and captchas, which can be more time-consuming than the analysis itself.

A drop-in replacement library was created to maintain the pytrends interface while moving the complex parts (sessions, proxies, retries) to a managed scraper. This library uses Apify's free plan, costing about $4 per 1,000 keywords, only for the keywords where all data is successfully retrieved. The code change involves only one import: "from gtrends_api import TrendReq" instead of "from pytrends.request import TrendReq".

After building the payload with your keywords, timeframe, and location, you can retrieve the data in the same DataFrame shape as pytrends. The API provides functionality for interest over time, regions, related queries, and trending searches. The underlying Google Trends Scraper solves the issue of comparing values from different batches by using an anchor term, putting a stable keyword in every batch and rescaling all batches onto the same 0–100 scale. This is helpful for ranking long keyword lists.

If you prefer not to use Python, the same scraper is available as a browser-based option, which can be scheduled and exported to Excel or Google Sheets, or integrated with tools like Make, Zapier, or n8n. The library is MIT-licensed, and the project welcomes issues and pull requests on GitHub.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

RobotOps: Keeping Robot Fleets Ready for Real Work

Introduction A robot does not finish its job when it leaves the test bench. It still needs care once people start using it.

  • RobotOps manages entire robot fleets, handling monitoring, maintenance, and troubleshooting.
  • Software updates require testing in simulations to avoid safety concerns and physical issues.

What QA Taught Me About DevOps

When I started moving from QA and validation toward Cloud and DevOps, I initially thought I had to leave my QA background behind. I was wrong.

More from Tuesday 29 September →