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

v0.1.0

Published

News scraper API for Google News. Scrape Google News results as structured JSON with title, source, snippet and date.

Readme

google-news-scraper-api

Node client that turns a query into Google News articles as JSON. Built on ScrapingBee's Google News scraper API. Zero dependencies, Node 18+.

Checked against the live endpoint on 2026-08-25. Calls charged 10 credits.

npm install google-news-scraper-api

Build a media monitor

The whole job is four steps: query, page, dedupe, store. Everything below is those four.

1. Query

const { GoogleNewsScraper } = require("google-news-scraper-api");

const scraper = new GoogleNewsScraper(process.env.SCRAPINGBEE_API_KEY);
const articles = await scraper.search("openai", { country_code: "us" });

articles.forEach(a => console.log(a.date, a.source, a.title));

Each article arrives with title, link, snippet, source, domain, date, relative_date, position and page. date is an ISO timestamp, which is the one you want for sorting; relative_date is the "3 hours ago" string meant for humans.

2. Page

const wide = await scraper.paginate("climate policy", 5, { country_code: "us" });

Paging stops the moment a page returns empty, so asking for five pages of a thin query does not spend five pages of credits.

3. Dedupe

Wire stories get syndicated. The same piece shows up under different publishers and across queries, and a monitor that skips this reports the same story five times:

const raw = [];
for (const q of ["openai", "anthropic", "mistral ai"]) {
  raw.push(...await scraper.paginate(q, 2, { country_code: "us" }));
}
const unique = GoogleNewsScraper.deduplicate(raw);
console.log(raw.length, "->", unique.length);

4. Store

searchRaw hands back meta_data alongside the results when you want the resolved Google URL and page count recorded with the batch:

const payload = await scraper.searchRaw("openai", { country_code: "us" });
console.log(payload.meta_data.url);

Two parameters that change the results

await scraper.search("acme corp", { nfpr: true });          // stop Google "correcting" the brand
await scraper.search("acme corp", { date_range: "d" });     // tighten the recency window

nfpr deserves attention on brand monitoring. Google silently rewrites unfamiliar names to something it thinks you meant, and the run then tracks the wrong word entirely.

search_type=news will not run with device: "mobile"; that combination is unsupported.

Budget

| Call | Credits | | --- | --- | | One query | 10 observed, 15 documented standard | | usage() | 0 | | HTTP 500 | 0 |

console.log(await scraper.usage());

Free, six calls a minute. Pricing tiers.

Sibling surfaces

search_type swaps the same endpoint onto search, shopping, images, lens, ads and AI Mode. There is also a Google News RSS API and the lighter Fast Search.

Notes

Public content only; scraping behind a login is prohibited by the ScrapingBee terms. Keep your key away from AI coding assistants.

MIT. Docs . Repo