npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

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

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-api

What 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