{
  "id": 20557998,
  "title": "pytrends 429 TooManyRequestsError: why it happens and 3 ways to fix it (2026)",
  "url": "https://urgent.news/2026/11/18/pytrends-429-toomanyrequestserror-why-it-happens-and-3-ways-to-fix-it",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-18T06:51:14.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/logicbase_systems/pytrends-429-toomanyrequestserror-why-it-happens-and-3-ways-to-fix-it-2026-4o2o"
  },
  "original_language": "en",
  "account": "Pytrends 429 TooManyRequestsError occurs when Google returns a response with code 429, indicating too many requests. This happens because pytrends doesn't use an official API and sends the same requests as trends.google.com. Google rate-limits these requests, so when Google answers with HTTP status 429, pytrends raises TooManyRequestsError. This error can happen regardless of the device used (laptop, cloud server, or shared IP).\n\nTo fix the 429 error, three methods are presented: sending fewer requests, backoff on 429, and caching everything for free. The first method involves reusing one TrendReq object instead of creating one per keyword and batching up to five keywords per payload. The second method suggests backoff exponentially on TooManyRequestsError, with some random jitter, instead of retrying immediately. The third method recommends caching results on disk, as last year's weekly interest doesn't change.\n\nThe code provided implements these fixes, creating a TrendReq() once, building payload, fetching interest over time, and caching results on disk. The code also includes a function to handle requests with backoff on 429 errors and cache the results. The script ran successfully on November 18, 2026, fetching both batches and reading results from trends_cache/ without contacting Google the second time.",
  "summary": "Disclosure: I built the Apify Actor mentioned in fix 3, so I'm biased. Apify links here are referral links. Fixes 1 and 2 don't need it at all. Your Google Trends script worked yesterday. Today it stops with: pytrends.exceptions.TooManyRequestsError: The request failed: Google returned a response with code 429 Here is what that error means, what state pytrends is in today, and three ways to get…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}