Google Trends

pytrends alternative: move your Google Trends code to a maintained API

For years pytrends was how Python developers got Google Trends data. Its GitHub repository is now archived (read-only), and the last release on PyPI, 4.9.2, came out in April 2023. Google rate-limits Trends heavily, so pytrends scripts that used to work now stop with HTTP 429 "Too Many Requests" errors, and nobody is fixing the library any more. This guide maps each pytrends call to a maintained alternative, so you can migrate without rewriting your analysis.

3 min readUpdated October 2026By Rimu Labs

Your options

  1. Keep pytrends and slow down. Sleep between requests, retry with backoff and send fewer keywords per payload. That can keep a small script alive, but it breaks again whenever Google changes the internal endpoints pytrends relies on.
  2. The official Google Trends API. Google announced an official API in July 2025. It's an alpha with access by application only, so most projects can't use it yet.
  3. A maintained hosted API. Our Google Trends Scraper runs on Apify. It paces and retries requests for you and returns the same data pytrends did, as JSON. You call it from Python with Apify's official client.

The quickest fix: change one import

rimulabs-trends is a free, open-source (MIT) drop-in for pytrends' TrendReq that runs on the hosted API above. It returns the same pandas DataFrames, so the rest of your script stays as it is.

pip install rimulabs-trends
# from pytrends.request import TrendReq
from rimulabs_trends import TrendReq

pytrends = TrendReq()   # reads your Apify token from the APIFY_TOKEN environment variable
pytrends.build_payload(["crm", "erp"], timeframe="today 12-m", geo="US")
df = pytrends.interest_over_time()

It supports interest_over_time(), interest_by_region(), related_queries(), trending_searches() and realtime_trending_searches(). Source and issues are on GitHub. To call the API directly instead, the mapping below shows each input and output.

pytrends calls and their replacements

pytrendsGoogle Trends Scraper
build_payload(kw_list, timeframe, geo, cat, gprop)Input searchTerms, timeRange, geo, category, searchType
interest_over_time()interestOverTime: [{date, value, isPartial}]. Set "compare": true to put up to 5 keywords on one 0–100 scale, like a multi-keyword payload
interest_by_region()interestByRegion: [{geoCode, geoName, value}]
related_queries()relatedQueries.top and relatedQueries.rising
trending_searches(), realtime_trending_searches()"mode": "trendingNow" with trendingGeos, e.g. ["US", "GB"]
related_topics(), top_charts(), suggestions()Not available

Timeframes: now 1-H → past-hour, now 4-H → past-4-hours, now 1-d → past-day, now 7-d → past-7-days, today 1-m → past-30-days, today 3-m → past-90-days, today 12-m → past-12-months, today 5-y → past-5-years, all → since-2004. A custom "2026-01-01 2026-06-30" becomes startDate and endDate.

gprop: "" → web, images, news, froogle → shopping, youtube.

Before and after

A typical pytrends script:

from pytrends.request import TrendReq

pytrends = TrendReq(hl="en-US", tz=360)
pytrends.build_payload(["crm", "erp"], timeframe="today 12-m", geo="US")
df = pytrends.interest_over_time()   # one column per keyword

The same DataFrame from the maintained API (pip install apify-client pandas):

import pandas as pd
from apify_client import ApifyClient  # apify-client 3.x

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("rimulabs/google-trends-insights").call(run_input={
    "searchTerms": ["crm", "erp"],
    "compare": True,                 # one 0-100 scale, like a pytrends payload
    "timeRange": "past-12-months",
    "geo": "US",
    "sections": ["interestOverTime"],
})
rows = [
    {"date": p["date"], "keyword": r["keyword"], "value": p["value"]}
    for r in client.dataset(run.default_dataset_id).iterate_items()
    for p in r["interestOverTime"]
]
df = pd.DataFrame(rows).pivot(index="date", columns="keyword", values="value")

Each keyword record also carries a plain-language summary in insights (average, latest and peak interest, and whether the trend is rising, falling or stable), so you may not need your own smoothing code.

Trending searches

run = client.actor("rimulabs/google-trends-insights").call(run_input={
    "mode": "trendingNow",
    "trendingGeos": ["US", "GB"],
    "maxTrendingPerGeo": 20,
})

A real result for the US on 18 October 2026, shortened:

{
  "geo": "US",
  "title": "oilers",
  "approxTraffic": "1000+",
  "publishedAt": "2026-10-18T03:00:00.000Z",
  "news": [{ "title": "Zach Hyman tallies goal for Edmonton Oilers on the power play", "source": "ESPN", "url": "https://www.espn.com/…" }]
}

Things that work differently

Cost: $3.00 per 1,000 keyword reports, or $0.50 per 1,000 trending searches. A daily job tracking 20 keywords costs about $1.80 a month.

Rimu Labs builds and maintains the Actor mentioned in this guide. The guide was written with help from our AI assistant and checked against real runs in October 2026. Questions or corrections: support@rimulabs.com.