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)
| File | Size | Uploaded | |
|---|---|---|---|
| google_trends_scraper_api-0.1.0.tar.gz | 6.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| google_trends_scraper_api-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.0 kB
Release files / google_trends_scraper_api-0.1.0.tar.gz
| Download URL | google_trends_scraper_api-0.1.0.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
727f77088a0854e95ee70fed3d943af0619b6884024257bf9694cad7d9492907
|
|
BLAKE2b-256 checksum How to use checksums |
9aa9439873e984aa08af22f2a5fdd78c52b5aef8f1d21256e9ec9ae36ff71ae2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / google_trends_scraper_api-0.1.0-py3-none-any.whl
| Download URL | google_trends_scraper_api-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4b65903d3291e34f083cb0a337974736a978fa9bc0b2b17ca3480c304819d1c
|
|
BLAKE2b-256 checksum How to use checksums |
93a962fb980c57214799ac76f94253987a5166506766a5fadd068592479277ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|