# Google News Scraper & API - News Monitoring & Real Article URLs (`rel8ble/google-news-scraper`) Actor

Google News scraper and API for news monitoring: search Google News by keyword, topic or city in any language and country. One result = one article: headline, source, publish date, link, real publisher URL (free), related coverage. Hour-to-year and date-range filters. $1.00 per 1,000, no start fee.

- **URL**: https://apify.com/rel8ble/google-news-scraper.md
- **Developed by:** [Giovanni Rich](https://apify.com/rel8ble) (community)
- **Categories:** News
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google News Scraper & API - News Monitoring & Real Article URLs

**Google News scraper** and unofficial **Google News API**: search Google News by keyword, read Google News topics (Top stories, World, Business, Technology...) or local news by city, and get the articles as JSON, CSV or Excel with headline, source, publish date, Google News link, the **real publisher URL** (optional link decoding) and related coverage of the same story. Works for any language and country edition, with **news search** time filters from the past hour to the past year, exact date ranges for **historical news**, and site filters like `reuters.com`.

It reads Google News' public RSS feeds over plain HTTP, with no headless browser: 100 articles arrive in about 2 seconds and 1,000 in under 10. Use it for **news monitoring**, brand and competitor tracking, PR and media analysis, stock and crypto news feeds, and feeding AI agents and RAG pipelines with fresh news.

### What you get

One dataset item per article:

- **Article**: `title` (the outlet name Google appends is removed), `publishedAt` (ISO 8601, UTC), `articleId` (Google's stable ID, use it to deduplicate between runs).
- **Source**: `sourceName` ("Reuters"), `sourceUrl` ("https://www.reuters.com").
- **Links**: `googleNewsUrl` (always), `publisherUrl` (the decoded address on the publisher's site, when **Resolve real publisher URLs** is on), `urlResolved` (true / false), and `url`, which is the publisher URL when it was decoded and the Google link otherwise, so `url` is always usable.
- **Related coverage**: `relatedArticles` - other outlets' articles on the same story (`title`, `sourceName`, `googleNewsUrl`) and `relatedCount`. Topic, top-story and location feeds carry these on most rows (56 of 65 Technology rows in a test run); keyword searches rarely do.
- **Context**: `position` (order saved per query), `feedType` (`search`, `topic`, `top`, `location`), `query`, `topic`, `location`, `searchQuery` (the exact text sent to Google, with `site:` / `when:` / `after:` operators), `language`, `country`, `feedUrl`, `scrapedAt`.

A `RUN_SUMMARY` record in the key-value store lists per-query counts, feed requests made, how many feeds hit Google's 100-article limit, links resolved and why each query stopped.

### Sample output

Real rows from test runs:

| title | sourceName | publishedAt | feedType | query / topic | urlResolved |
|---|---|---|---|---|---|
| Our approach to EU text provenance rules | OpenAI | 2026-10-05T15:12:28.000Z | search | openai | true |
| Fosi Audio Launches DAP Neo Digital Portable Music Player | Forbes | 2026-10-10T04:00:00.000Z | topic | TECHNOLOGY | true |
| Trump really wants to make ‘super intelligence’ happen. Is it going to happen? | CNN | 2026-10-11T16:00:44.000Z | search | artificial intelligence | false |

### Use cases

- **News monitoring**: schedule queries hourly with time range `1h`, or daily with `1d`, and only pay for the fresh articles.
- **Brand, competitor and executive tracking**: one query per name, plus site filters for the outlets you care about.
- **Finance and crypto feeds**: tickers and company names with `1h` / `1d`, pushed to Slack or a database.
- **Media and PR analysis**: count coverage by `sourceName` and day over a date range.
- **Historical research**: `dateFrom` / `dateTo` go back many years (a 2015 date range returned articles in testing).
- **AI agents and RAG**: one call returns structured, dated, sourced headlines; turn on link decoding and pass `publisherUrl` to a content extractor.

### Pricing

**$1.00 per 1,000 articles** (pay per result; failed requests are never charged). The most-used Google News scrapers on the Store charge $2.00-$5.00 per 1,000, several add a start fee, and several charge $0.50-$1.50 per 1,000 extra to decode publisher URLs. Here link decoding costs nothing extra.

| You scrape | You pay |
|---|---|
| 100 articles | $0.10 |
| 1,000 articles | $1.00 |
| 10,000 articles | $10.00 |
| 100,000 articles | $100.00 |

No start fee. The Apify free plan's $5 monthly credit covers about 5,000 articles. The prefilled input (`artificial intelligence`, 20 articles) finishes in about 6 seconds and costs $0.02.

#### Why this one

- **Cheapest of the most-used Google News scrapers**: $1.00 per 1,000 with no start fee and free URL decoding, against $4.00 (data_xplorer), $2.30 + $0.005 per run (automation-lab), $2.00 + $0.005 per run + $1.00 per 1,000 decoded URLs (lhotanova) and $5.00 + $0.09 per run (easyapi).
- **Real publisher URLs at no extra charge**: optional decoding of Google's redirect links to the article on the publisher's site.
- **Keyword, topic and city feeds** in any language and country edition, in one actor.
- **Time filters and date ranges**: past hour to past year, or exact `dateFrom` / `dateTo` for historical news.
- **Fast**: public RSS over plain HTTP, 1,000 articles in under 10 seconds.

### FAQ

**Is it legal to scrape Google News?**
This actor collects only public headline listings: titles, source names, dates and links. No personal-data focus, no login, no article text. Google's RSS terms describe the feeds as meant for personal feed readers, and you're responsible for using the data in line with Google's terms, publishers' rights and applicable law. This is not legal advice.

**Does it need a login, a browser or an API key?**
No. Plain HTTPS requests with normal browser headers to Google News' public RSS feeds.

**How fast is it, and how many articles can I get?**
100 articles take about 2 seconds, 1,000 under 10 (link decoding is rate-limited to roughly 5 articles per second). One Google News request returns at most about 100 articles; set a time window and a higher **Max articles per query** and the scraper searches day by day to go past 100 (`tesla` over 30 days reached 1,000 unique articles). See "How deep can it go?" below.

**Can I schedule it or use it via API, and get only new articles?**
Yes. Schedule the run and set the time range to match (`1h` for hourly, `1d` for daily); keep the `articleId` values you've seen for exact deduplication. Start runs from the Apify API, the JavaScript/Python clients, Make, Zapier, n8n or the Apify MCP server.

**Do I need proxies? How does it avoid blocks?**
No setup needed: requests go through Apify Proxy (datacenter) by default with a session pool. A 429, 403, unusual-traffic or consent page retires that session and the request is retried on a fresh IP (6 retries by default). No blocks occurred in any test run.

**Why are the links news.google.com/rss/articles/... and not the real article?**
That is what Google News publishes, and those links only redirect inside a browser. Turn on **Resolve real publisher URLs** to get the real address in `publisherUrl` and `url`. In testing, 2,033 of 2,033 links were decoded; each link gets 3 attempts on fresh IPs before the row is saved unresolved.

**Which languages and countries work?**
Any Google News edition. Tested: en-US/US, en-GB/GB, de/DE, fr/FR, pt-BR/BR, es-419/MX, ja/JP, zh-TW/TW. The `ceid` parameter is built for you.

### Example inputs for common jobs

Copy one into the JSON tab of the input and adjust.

Hourly brand or executive monitor (schedule it every hour; only the fresh articles are charged):

```json
{ "queries": ["\"OpenAI\"", "\"Sam Altman\""], "timeRange": "1h", "maxItemsPerQuery": 100 }
```

Daily stock news feed with the real article links, ready for a content extractor or an LLM:

```json
{ "queries": ["NVDA stock", "AAPL stock", "TSLA stock"], "timeRange": "1d", "resolveUrls": true }
```

Morning headlines digest for the UK edition (about 35-70 articles per section, about $0.15 for all three):

```json
{ "topics": ["TOP", "BUSINESS", "TECHNOLOGY"], "language": "en-GB", "country": "GB" }
```

Local news for two cities (about 70 articles each):

```json
{ "locations": ["Chicago", "Austin"] }
```

Media analysis: one quarter of coverage on a topic, searched day by day past Google's 100-article limit (up to 2,000 articles, $2.00 at most):

```json
{ "queries": ["electric vehicles"], "dateFrom": "2026-07-01", "dateTo": "2026-09-30", "maxItemsPerQuery": 2000 }
```

What chosen outlets wrote about a competitor in the last week:

```json
{ "queries": ["Rivian"], "sites": ["reuters.com", "bloomberg.com", "techcrunch.com"], "timeRange": "7d" }
```

### How to use

1. Enter one or more **Search queries** (`tesla`, `"climate change" -opinion`, `nvidia OR amd earnings`), and/or pick **Topics** (Top stories, World, Nation, Business, Technology, Entertainment, Sports, Science, Health), and/or type **Locations** (`Chicago`, `Sydney`) for local news.
2. Set **Language** and **Country** (default `en-US` / `US`), a **Time range** (past hour, 12 hours, 24 hours, 7 days, 30 days, year) or **Date from / Date to**, and optionally **Only these sites**. Set **Max articles per query** (default 100).
3. Tick **Resolve real publisher URLs** if you need the article's own address instead of the `news.google.com` link.
4. Click **Start**. Download the results as JSON, CSV, Excel or HTML from the **Output** tab, or pull them through the Apify API, Make, Zapier, n8n or an MCP client.

### Input example

```json
{
    "queries": ["tesla", "openai", "nvidia earnings"],
    "topics": ["TECHNOLOGY"],
    "timeRange": "7d",
    "maxItemsPerQuery": 150,
    "resolveUrls": true
}
```

An exact date range in German, limited to two outlets:

```json
{
    "queries": ["tesla"],
    "language": "de",
    "country": "DE",
    "dateFrom": "2026-09-01",
    "dateTo": "2026-09-05",
    "sites": ["spiegel.de", "handelsblatt.com"],
    "maxItemsPerQuery": 250
}
```

Everything two outlets published in the past 24 hours (no query needed):

```json
{ "sites": ["reuters.com", "bbc.com"], "timeRange": "1d", "maxItemsPerQuery": 100 }
```

### Output example

Real items from a cloud run of the first input above. A keyword search row:

```json
{
    "position": 15,
    "articleId": "CBMiV0FVX3lxTFBndFg3dkRHQWJpbWRzMU1NVXZucE9POUFlMlNZemhnSlNOYTRNSDhEVFhnS3oxSVVEWFN5TDRjd3ZSTVJpdjFvUGQyc092YnVqX2ZxdEhCSQ",
    "title": "Our approach to EU text provenance rules",
    "sourceName": "OpenAI",
    "sourceUrl": "https://openai.com",
    "publishedAt": "2026-10-05T15:12:28.000Z",
    "url": "https://openai.com/index/eu-text-provenance/",
    "publisherUrl": "https://openai.com/index/eu-text-provenance/",
    "urlResolved": true,
    "googleNewsUrl": "https://news.google.com/rss/articles/CBMiV0FVX3lxTFBndFg3dkRHQWJpbWRzMU1NVXZucE9POUFlMlNZemhnSlNOYTRNSDhEVFhnS3oxSVVEWFN5TDRjd3ZSTVJpdjFvUGQyc092YnVqX2ZxdEhCSQ?oc=5",
    "relatedArticles": [],
    "relatedCount": 0,
    "feedType": "search",
    "query": "openai",
    "topic": null,
    "location": null,
    "searchQuery": "openai when:7d",
    "language": "en-US",
    "country": "US",
    "feedUrl": "https://news.google.com/rss/search?q=openai+when:7d&hl=en-US&gl=US&ceid=US:en",
    "scrapedAt": "2026-10-11T17:31:49.608Z"
}
```

A topic row with related coverage (Google links shortened here):

```json
{
    "position": 32,
    "title": "Fosi Audio Launches DAP Neo Digital Portable Music Player",
    "sourceName": "Forbes",
    "sourceUrl": "https://www.forbes.com",
    "publishedAt": "2026-10-10T04:00:00.000Z",
    "url": "https://www.forbes.com/sites/marksparrow/2026/10/10/fosi-audio-launches-dap-neo-digital-portable-music-player/",
    "urlResolved": true,
    "relatedArticles": [
        { "title": "This Portable CD Player Evokes Discman Nostalgia With A MagSafe Twist", "sourceName": "SlashGear", "googleNewsUrl": "https://news.google.com/rss/articles/CBMiigFB...?oc=5" },
        { "title": "The Fosi Audio DISC Nano Is An Ultra-Portable CD Player", "sourceName": "Men's Gear", "googleNewsUrl": "https://news.google.com/rss/articles/CBMiVEFV...?oc=5" },
        { "title": "Fosi Audio DAP Neo Launches as a $79.99 Retro Music Player", "sourceName": "Techaeris", "googleNewsUrl": "https://news.google.com/rss/articles/CBMiekFV...?oc=5" }
    ],
    "relatedCount": 3,
    "feedType": "topic",
    "topic": "TECHNOLOGY",
    "language": "en-US",
    "country": "US"
}
```

### How deep can it go? (read before large runs)

- **One Google News request returns at most about 100 articles**, and there is no page 2. That is a limit of Google News itself.
- To go past 100, set **Max articles per query** above 100 and a time window. The scraper first takes Google's ranked 100, then searches the window **one day at a time** (newest day first, up to 100 per day) and drops duplicates by article ID.
- **Realistic depth**: a busy query yields roughly 50-100 new articles per day this way. Measured: `tesla` over 30 days hit 1,000 unique articles after 14 day-slices; `nvidia earnings` over 7 days ended at 285. A niche query may have 5 a day. Days with more than 100 matching articles are capped at 100 (the `RUN_SUMMARY` shows how many feeds hit the limit); split such a query into narrower ones or add site filters to get more.
- Day slicing needs a window of at least two days: `7d`, `30d`, `1y` or a date range. With `anytime` it walks back 30 days; with only **Date to** set it walks back 30 days from that date. `1h`, `12h` and `1d` are always one request (100 max).
- Topic, top-story and location feeds return what Google shows now (35-70 articles) and cannot be filtered by time or site.

### Speed and reliability (measured)

| Run | Articles | Time | Failed requests |
| --- | --- | --- | --- |
| Cloud, default input (1 query, 20 articles) | 20 | 5 s | 0 |
| Local, 3 queries x 300 (7 days) + 2 topics + 1 location | 1,060 | 3.4 s | 0 |
| Local, 1 query, 30 days, 1,000 articles | 1,000 | 3.9 s | 0 |
| Cloud, 1 query x 100 with link decoding | 100 | 18 s | 0 (100 of 100 links decoded) |
| Cloud, 3 queries x 150 + 1 topic with link decoding (earlier build, 10 parallel decodes; now 30) | 515 | 163 s | 0 (515 of 515 links decoded) |

Filled on every row in these runs: `title`, `sourceName`, `sourceUrl`, `publishedAt`, `url`, `googleNewsUrl`, `articleId`. Link decoding is deliberately rate-limited (at most about 12 links a second), so plan on roughly 5 articles per second with it on.

### API example

Python (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("rel8ble/google-news-scraper").call(run_input={"queries": ["nvidia", "openai"], "timeRange": "1d", "language": "en-US", "country": "US", "maxItemsPerQuery": 100, "resolveUrls": True})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["publishedAt"], "|", item["sourceName"], "|", item["title"], "|", item["url"])
```

One HTTP call that runs the actor and returns the rows (curl):

```bash
curl -X POST "https://api.apify.com/v2/acts/rel8ble~google-news-scraper/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"queries": ["artificial intelligence"], "timeRange": "1d", "maxItemsPerQuery": 50}'
```

### Integrations

- **API**: start runs and read datasets over the Apify REST API or the JavaScript / Python clients.
- **MCP / AI agents**: call it from Claude, ChatGPT or any MCP client through the Apify MCP server; inputs and outputs are documented field by field.
- **No-code**: Make, Zapier, n8n, Google Sheets, Airtable, Slack, webhooks.
- **Scheduling**: run hourly or daily in Apify Schedules with time range `1h` / `1d` for a rolling news feed.

### Limits

- No article text, author or image: Google News lists headlines, and its feed carries no excerpt. Turn on link decoding and send `publisherUrl` to an article extractor for the body text.
- `publishedAt` is the time Google News reports. For older articles Google often gives only the day (time 07:00 or 08:00 UTC).
- Results depend on the language and country edition; the same query returns different outlets for `US` and `GB`.
- An unknown place name in **Locations** still returns a feed, because Google matches it to the nearest place it knows. Check `feedUrl` if a location looks off.
- If Google cannot decode a link, the article is still saved with `urlResolved: false`, the Google link in `url` and the reason in `resolveError`.
- Custom Google News topic IDs and "For you" feeds are not supported.

### How it works (for developers)

Feeds: `https://news.google.com/rss/search?q=<query>&hl=<lang>&gl=<country>&ceid=<country>:<lang>` for searches, `/rss` for top stories, `/rss/headlines/section/topic/<NAME>` for sections and `/rss/headlines/section/geo/<place>` for locations. Time and site filters are Google search operators appended to the query: `when:7d`, `after:2026-09-01 before:2026-09-06`, `site:reuters.com`. Each `<item>` gives title, link, guid, pubDate and source; the `<description>` is an HTML list of the story cluster, which becomes `relatedArticles`. Deep runs chain day slices (`after:D before:D+1`), four in parallel per query, until **Max articles per query** is reached.

Link decoding: `GET /rss/articles/<id>` returns a page with `data-n-a-sg` (signature) and `data-n-a-ts` (timestamp); a `POST` to `/_/DotsSplashUi/data/batchexecute` (rpc `Fbv4je`) with the ID, timestamp and signature returns the publisher URL.

Run it locally:

```bash
npm install
npm test                 # 16 parser tests on saved real feeds and decode responses
node src/main.js         # input in storage/key_value_stores/default/INPUT.json
node scripts/fill.mjs    # field fill rates of the local dataset
```

# Actor input Schema

## `queries` (type: `array`):

What to search Google News for, one query per line, written as you would type it into news.google.com: "tesla", ""climate change" -opinion", "nvidia OR amd earnings". Google operators work (quotes, OR, minus, intitle:). Each query returns up to maxItemsPerQuery articles, one dataset row per article (headline, source, publish date, link) at $0.001 per row. Provide queries, topics, locations, or any mix. Use this for news monitoring, brand or ticker tracking and research. Default \["artificial intelligence"] (demo).

## `topics` (type: `array`):

Optional. Ready-made Google News sections to read instead of, or in addition to, queries: TOP (front-page top stories), WORLD, NATION (news of the selected country), BUSINESS, TECHNOLOGY, ENTERTAINMENT, SPORTS, SCIENCE, HEALTH. Each section returns its current 35-70 headline articles for the chosen language and country, and each row lists related coverage of the same story from other outlets. Time and site filters do not apply to sections. Use this for a daily headlines digest. About $0.04-0.07 per section.

## `locations` (type: `array`):

Optional. City, region or country names, one per line, to read the Google News local feed for that place: "Chicago", "Bavaria", "Sydney". Each place returns its current headline articles (about 70) with related coverage. Time and site filters do not apply. Use this for local news monitoring. About $0.07 per place.

## `language` (type: `string`):

Optional. Article language as a Google language code (the hl parameter): "en-US" (default), "en-GB", "de", "fr", "es", "es-419", "pt-BR", "it", "nl", "pl", "ja", "ko", "hi", "ar", "zh-TW". Google News returns articles written in this language, so pair it with a matching country.

## `country` (type: `string`):

Optional. Two-letter country code of the Google News edition (the gl parameter): "US" (default), "GB", "DE", "FR", "ES", "MX", "BR", "IT", "NL", "PL", "JP", "KR", "IN", "AU", "CA". Decides which outlets rank first and what NATION and TOP contain. The ceid parameter is built from language + country for you.

## `timeRange` (type: `string`):

Optional. Only return articles published within this period: "anytime" (default, the best matches from any date), "1h" (past hour), "12h", "1d" (past 24 hours), "7d" (past week), "30d" (past month), "1y" (past year). Ignored when dateFrom or dateTo is set. Use "1h" or "1d" for scheduled monitoring so each run only costs the fresh articles.

## `dateFrom` (type: `string`):

Optional. First publish date to include, as YYYY-MM-DD (e.g. "2026-09-01"). Sent to Google as the after: operator. Combine with dateTo for an exact date range; overrides timeRange. Use this for historical research and backfills: Google News search reaches back many years.

## `dateTo` (type: `string`):

Optional. Last publish date to include, as YYYY-MM-DD (e.g. "2026-09-30"), inclusive. Sent to Google as the before: operator. Empty = up to today. Overrides timeRange.

## `sites` (type: `array`):

Optional. Publisher domains, one per line, to limit results to: "reuters.com", "bbc.com", "techcrunch.com". Sent to Google as site: filters (several domains are OR-ed). Works with or without queries: sites alone returns the latest articles from those outlets. Use this to follow specific publications.

## `maxItemsPerQuery` (type: `integer`):

Optional. Articles to save per query, topic or location, integer 1-10000. Default 100. Google News returns at most about 100 articles per request, so 100 or less = one fast request (about 2 seconds, $0.10 or less). Above 100 the scraper also searches the time window one day at a time (up to 100 more per day, newest day first) and drops duplicates, so set a timeRange of 7d / 30d / 1y or a dateFrom-dateTo range; with "anytime" it walks back 30 days. Cost = saved articles x $0.001.

## `resolveUrls` (type: `boolean`):

Optional boolean. Google News links look like news.google.com/rss/articles/CBMi... and only redirect inside a browser. true = decode each one to the real article URL on the publisher site (publisherUrl, also copied to url). Costs two extra Google requests per article, so runs take longer (see the README for measured times); the price per result is the same. If a link cannot be decoded the article is still saved with the Google link and urlResolved: false. Turn on when you need to open, crawl or deduplicate the articles themselves. Default false.

## `maxConcurrency` (type: `integer`):

Optional, advanced. Parallel requests, integer 1-20. Default 10. Lower it if you see repeated block retries in the log.

## `maxRequestRetries` (type: `integer`):

Optional, advanced. Retries per feed request on a new IP when Google blocks or times out, integer 0-20. Default 6. Link decoding uses at most 3.

## `proxyConfiguration` (type: `object`):

Optional. Apify Proxy (datacenter) is the default. Switch to the RESIDENTIAL group only if the log shows repeated block retries, for example on very large resolveUrls runs.

## Actor input object example

```json
{
  "queries": [
    "artificial intelligence"
  ],
  "language": "en-US",
  "country": "US",
  "timeRange": "anytime",
  "maxItemsPerQuery": 20,
  "resolveUrls": false,
  "maxConcurrency": 10,
  "maxRequestRetries": 6,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `articles` (type: `string`):

All articles found: position, headline, source name and site, publish date (ISO), article URL (publisher URL when resolveUrls is on), Google News link, related coverage, query / topic / location, language and country.

## `summary` (type: `string`):

Per-query article counts, feed requests made, how many feeds hit the 100-article limit, links resolved and stop reasons.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "queries": [
        "artificial intelligence"
    ],
    "maxItemsPerQuery": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("rel8ble/google-news-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "queries": ["artificial intelligence"],
    "maxItemsPerQuery": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("rel8ble/google-news-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "artificial intelligence"
  ],
  "maxItemsPerQuery": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call rel8ble/google-news-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rel8ble/google-news-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/W1gDay77xUn4bSKjf/builds/a4VbJCmFOV0JTO1EF/openapi.json
