google-trends-scraper-api
v0.1.0
Published
Google Trends scraper for Node. Scrape trending searches with traffic estimates and related news as structured data.
Downloads
180
Maintainers
Readme
google-trends-scraper-api
Node client that reads Google's trending searches for a country and hands them back as objects, each with a traffic bucket and the news stories Google pinned to it. Built on ScrapingBee's Google Trends scraper. No dependencies, Node 18+.
Live run on 2026-08-25: 10 trends for US, 15 credits.
npm install google-trends-scraper-apiWhat is trending right now
const { GoogleTrendsScraper } = require("google-trends-scraper-api");
const scraper = new GoogleTrendsScraper(process.env.SCRAPINGBEE_API_KEY);
for (const t of await scraper.trending("US")) {
console.log(t.traffic, t.title, `(${t.news.length} stories)`);
}1000+ measles (3 stories)
1000+ daniel diemer (3 stories)
500+ military aircraft (3 stories)Google needs a special flag
Point the HTML API at any google.com or trends.google.com URL without it and the request is
rejected before it leaves:
{"errors": {"query": {"custom_google": ["If you wish to scrape Google, use the custom_google=True parameter!"]}}}Every call from this client sets custom_google=true already, which is also why a trends read is
15 credits rather than the 1 to 5 an ordinary page costs.
Shape of a trend
{
title: "measles",
traffic: "1000+", // Google's bucket, as text
trafficValue: 1000, // parsed floor, for sorting and filtering
published: "Mon, 25 Aug 2026 ...",
link: "https://trends.google.com/trends/explore?q=measles",
picture: "https://...",
news: [{ title, url, source, picture }]
}traffic is a floor rather than a count. Google publishes buckets, so treat trafficValue as
"at least this many" and never as a measurement.
Cutting the noise
A country feed is ten entries and most will not concern you. Threshold, then read the attached coverage to decide whether a spike is relevant:
const trends = await scraper.trending("GB");
for (const t of GoogleTrendsScraper.above(trends, 500)) {
console.log(t.title, t.traffic);
t.news.slice(0, 2).forEach(n => console.log(" ", n.source, "-", n.title));
}Comparing markets
const markets = ["US", "GB", "DE", "JP"];
const snapshot = {};
for (const geo of markets) {
snapshot[geo] = (await scraper.trending(geo)).map(t => t.title);
}
console.log(snapshot);Four markets is 60 credits a pass. Hourly is 1,440 a day, so look before you schedule:
console.log(await scraper.usage());Free call, six a minute.
Cost
| Call | Credits |
| --- | --- |
| One country feed | 15 observed |
| usage() | 0 |
| HTTP 500 | 0 |
Nothing is charged for a failure. Plan tiers.
What this covers, and what it does not
The trending feed is the surface that reliably returns structured data. Interest-over-time and the comparison widgets sit behind an internal token exchange and are out of scope here.
Need demand signals with real numbers? Pair the Google search API with its related-searches and related-questions surfaces instead. To explain a spike rather than spot it, reach for Google News.
Any other Google URL
const res = await scraper.fetch("https://trends.google.com/trending/rss?geo=FR");
console.log(res.headers.get("spb-cost"));Notes
Public content only. Scraping behind a login is prohibited by the ScrapingBee terms. Keep your key away from AI coding assistants.
MIT. Repo
