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.
Maintainers
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-apiBuild 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 windownfpr 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.
