Skip to main content

pytrends-cloud

A drop-in replacement for pytrends, the Google Trends library for Python. Same TrendReq class, same methods and the same pandas DataFrames, but the requests to Google run in the cloud behind rotating proxies, so this no longer stops your script:

pytrends.exceptions.TooManyRequestsError: The request failed: Google returned a response with code 429

The original pytrends repository is archived and no longer maintained, while Google keeps rate-limiting it. pytrends-cloud keeps your code and swaps the transport.

Change one line

# from pytrends.request import TrendReq
from pytrends_cloud import TrendReq

pytrends = TrendReq(hl="en-US", tz=360)  # reads your APIFY_TOKEN, see below
pytrends.build_payload(["python", "javascript", "rust"], timeframe="today 12-m")
pytrends.interest_over_time().tail(3)

Real output, run on 14 November 2026:

            python  javascript  rust  isPartial
date
2026-10-25      34           4    15      False
2026-11-01      33           4    16      False
2026-11-08      31           4    15       True

Install

pip install pytrends-cloud

Python 3.9 or newer. Dependencies: requests and pandas, like pytrends.

Get a token (free)

  1. Create a free Apify account: https://console.apify.com/sign-up
  2. Copy your API token: https://console.apify.com/settings/integrations
  3. Set it once:
export APIFY_TOKEN="apify_api_..."      # Windows PowerShell: $env:APIFY_TOKEN = "apify_api_..."

or pass it directly: TrendReq(apify_token="apify_api_...").

What it costs

Each call runs the Google Trends Scraper on Apify and is billed to your Apify account, per result:

Per call $0.0025 start fee
Per result $0.002 per search term and data type (the package asks for compact output: one result holds a whole series)
Example interest_over_time() for 3 terms: about $0.0085
Free plan Apify's free plan includes $5 of usage every month: about 600 calls like the one above, no card needed

Put a ceiling on any call with TrendReq(max_charge_usd=0.05).

What is supported

pytrends method pytrends-cloud
build_payload(kw_list, cat, timeframe, geo, gprop) ✅ up to 5 terms, named ranges ("today 5-y", "now 7-d"…) or dates ("2024-01-01 2024-06-30", "2024-01-01T00 2024-01-07T23"), one geo or a list of geos to compare one term across regions
interest_over_time() ✅ same DataFrame: one int column per term, isPartial, date index
interest_by_region(resolution, inc_low_vol, inc_geo_code) ✅ COUNTRY, REGION, CITY, DMA, low-volume regions, geoCode column
related_queries() ✅ {term: {"top": df, "rising": df}}
related_topics() ✅ same shape and columns; Google currently returns no related topics for most searches, so you get None (pytrends raised an IndexError there)
trending_searches(pn) ✅ from Google's daily trending feed; pn is a name ("united_states") or a code ("US")
today_searches(pn) ✅ a Series of today's trending searches
realtime_trending_searches(pn, count) ✅ different columns: title, approxTraffic, pubDate, newsItems (Google retired the realtime endpoint pytrends used)
suggestions, categories, top_charts, multirange_interest_over_time, get_historical_interest ❌ raise NotImplementedError: open an issue if you need one

Differences from pytrends

  • Speed. A data call takes about 5 to 10 seconds, the time of one cloud run. Results are cached per TrendReq, so calling the same method twice runs once.
  • Ignored arguments. tz, timeout, proxies, retries, backoff_factor and requests_args are accepted, so your code runs unchanged, and ignored: the requests to Google are made in the cloud. Use run_timeout (seconds, at most 300) instead.
  • Exceptions. pytrends_cloud.exceptions has the same ResponseError and TooManyRequestsError, plus AuthenticationError for a missing or refused token. If pytrends is still installed, they subclass its own exceptions, so except clauses written against pytrends.exceptions keep catching them.
  • Regions. Inside a country other than the US, resolution="REGION" or "CITY" is applied; pytrends silently ignored it there.
  • No silent zeros. If a run stops early and one of your terms comes back without data while the others have some, you get a ResponseError instead of a column of zeros.

Without Python

The same data (with up to 25 terms per run, schedules, webhooks and exports to CSV, Excel or Google Sheets) is available as an Apify Actor: https://apify.com/bibian/google-trends-scraper

Disclaimer

Not affiliated with Google, nor with the authors of pytrends. Google Trends figures are aggregated and anonymized by Google.

License

MIT

Metadata

Release files for pytrends-cloud 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytrends-cloud 0.1.0
File Size Uploaded Provenance Actions
pytrends_cloud-0.1.0.tar.gz 19.2 kB With provenance Details for pytrends_cloud-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytrends-cloud 0.1.0
File Interpreter ABI Platform Actions
pytrends_cloud-0.1.0-py3-none-any.whl Python 3 none any Details for pytrends_cloud-0.1.0-py3-none-any.whl

Total release size: 34.3 kB

Release files / pytrends_cloud-0.1.0.tar.gz

Download URL pytrends_cloud-0.1.0.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
66ddaa77a9714290ed9a310852ed0204ff9df058f009d01991a759d52b32c374
BLAKE2b-256 checksum
How to use checksums
8702c591647bdf58dda839eab550be3845d5633a9c052b43c8008bccca1760a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Release files / pytrends_cloud-0.1.0-py3-none-any.whl

Download URL pytrends_cloud-0.1.0-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f67f613c27b3d60084bcc8786056469378586576bbf0f9428bf01927fbf23d14
BLAKE2b-256 checksum
How to use checksums
6cb8542de369f019ae008077e4ce811ae5784bc152ce855af94791bc80b20f38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Security for pytrends-cloud 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pytrends_cloud-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page