Skip to main content

google-trends-scraper-api

A Google Trends scraper for Python. Pulls the currently trending searches for a country, each with an approximate traffic figure and the news stories Google attached to it, through ScrapingBee's Google Trends scraper.

Verified against the live API on 2026-08-25: 10 trends returned for US, 15 credits charged.

Install

pip install google-trends-scraper-api

Scrape Google Trends

from google_trends_scraper_api import GoogleTrendsScraper

scraper = GoogleTrendsScraper("YOUR-API-KEY")

for trend in scraper.trending("US"):
    print(trend.traffic, trend.title)
500+ john f kennedy center for the performing arts
200+ policía
200+ aura farming

Key from app.scrapingbee.com, 1,000 credits free.

The custom_google requirement

Google properties are not fetched like ordinary pages. Send a trends.google.com URL through the HTML API without the right flag and the request is refused outright:

{"errors": {"query": {"custom_google": ["If you wish to scrape Google, use the custom_google=True parameter!"]}}}

This client sets custom_google=true on every call, so you never hit that error. It is also why a trends call costs 15 credits rather than the 1 to 5 a plain page would.

What a Trend carries

Attribute Value
title The trending query
traffic Google's bucket, as a string such as "500+"
traffic_value 500, parsed from the bucket so you can sort and filter
published RFC 822 timestamp from the feed
link Google Trends URL for the query
picture Representative image
news List of {title, url, source, picture} stories

traffic is deliberately imprecise on Google's side. It reports a floor, not a count, which is why traffic_value is named a value rather than a volume.

Filtering to what matters

Ten trends a country is a small feed, and most of it is noise for any given business. Threshold on the bucket floor:

trends = scraper.trending("GB")
big = GoogleTrendsScraper.above(trends, 500)

for trend in big:
    print(trend.title, trend.traffic)
    for story in trend.news[:2]:
        print("   ", story["source"], story["title"])

Several markets at once

snapshot = {}
for market in ["US", "GB", "DE", "JP"]:
    snapshot[market] = [t.title for t in scraper.trending(market)]

print(snapshot["US"][:3], snapshot["JP"][:3])

Four markets is 60 credits. Hourly across four markets is 1,440 a day, so check the balance before scheduling:

print(scraper.usage())

That call is free and capped at 6 per minute.

Cost

Call Credits
One trending feed 15 observed
usage() 0
HTTP 500 0

Failures are not charged, so retrying costs nothing. Tiers on the pricing page.

Scope of this client

This wraps the trending-searches feed, which is the surface that returns reliable structured data today. Google's interest-over-time and comparison widgets sit behind an internal token exchange and are not covered here.

For search-demand work that needs numbers rather than a live feed, the Google search API with related searches and related questions is the more dependable route, and Google News covers the coverage side of a spike.

Arbitrary Google URLs

fetch exposes the underlying call if you want a different Google surface with the flag already set:

response = scraper.fetch("https://trends.google.com/trending/rss?geo=FR")
print(response.headers["Spb-cost"], len(response.text))

Scope

Public, pre-login content only. Scraping behind login credentials is prohibited by the ScrapingBee terms. Keep API keys out of AI coding assistants.

MIT licensed. Repository

Metadata

Release files for google-trends-scraper-api 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 google-trends-scraper-api 0.1.0
File Size Uploaded
google_trends_scraper_api-0.1.0.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for google-trends-scraper-api 0.1.0
File Interpreter ABI Platform
google_trends_scraper_api-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.0 kB

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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