# Google News Scraper (`muhammad4hmed/google-news-scraper`) Actor

Scrape Google News search results, topic sections, local news and top headlines in any language and edition. Publisher, timestamp and snippet per article, with cross-feed deduplication.

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

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Google News Scraper

Scrape **search results**, **topic sections**, **local news** and **top headlines** from Google News — in any language and edition, in one run.

### What it covers

Most Google News Actors do search only. This one fetches every feed type Google exposes:

- **Search** — with Google News operators (`tesla source:reuters`, `"climate policy"`) and a recency filter (`1h`, `1d`, `7d`).
- **Topics** — WORLD, BUSINESS, TECHNOLOGY, ENTERTAINMENT, SPORTS, SCIENCE, HEALTH, or a topic id lifted from a Google News URL.
- **Places** — local news for a named city or region.
- **Top headlines** — the front page of the chosen edition.
- **Any edition** — combine language and country (`de`/`DE`, `es-419`/`MX`, `en-GB`/`GB`) to read the news as that audience sees it.

Every article carries its **publisher**, **publication timestamp**, snippet, and which feed produced it. Duplicate stories across feeds are removed by default.

### Input

| Field | Type | Description |
|---|---|---|
| `queries` | array | Search terms; Google News operators supported |
| `topics` | array | Section names or topic ids |
| `places` | array | Local news by place name |
| `includeTopHeadlines` | boolean | Add the edition's front page |
| `language` / `country` | string | Edition, e.g. `en-US` / `US` |
| `timeFilter` | string | `1h`, `12h`, `1d`, `7d` — search only |
| `maxArticlesPerFeed` | integer | Up to 100 (Google's own ceiling) |
| `maxItems` | integer | Total cap (`0` = no limit) |
| `deduplicate` | boolean | Drop stories already seen in another feed |
| `concurrency` / `requestDelayMs` | integer | Throughput controls |
| `proxyConfiguration` | object | Optional — not required |

#### Example

```json
{
  "queries": ["openai", "tesla"],
  "topics": ["TECHNOLOGY"],
  "places": ["London"],
  "includeTopHeadlines": true,
  "language": "en-US",
  "country": "US",
  "timeFilter": "7d"
}
```

### Output

```json
{
  "title": "The first anti-AI protester to be jailed has a message for OpenAI…",
  "url": "https://news.google.com/rss/articles/CBMiWkFVX3lxTFBZ…",
  "publisher": "The Guardian",
  "publishedAt": "2026-08-13T17:02:46.000Z",
  "snippet": "The first anti-AI protester to be jailed has a message…",
  "source": "search:openai",
  "sourceType": "search",
  "language": "en-US",
  "country": "US"
}
```

A feed that fails produces an item with an `error` field rather than disappearing.

### Notes and limits

- **Article links are Google News redirect URLs.** Google no longer exposes the publisher's direct URL in its feed — the link resolves to the article in a browser, but it is not a clean publisher link. The `publisher` field gives you the outlet name, which is what most pipelines actually need. Any tool claiming otherwise is either following each link (slow and costly) or returning stale data.
- **Google caps each feed at roughly 100 articles.** Ask for more and you get what exists. To widen coverage, use more queries, topics or editions rather than a bigger limit.
- **Snippets are Google's own**, not full article text — usually the headline plus the outlet.
- **Editions matter.** The same query in `en-US`/`US` and `de`/`DE` returns genuinely different coverage, not translations.

### Local development

```bash
npm install
npm run build
node dist/main.js     # reads storage/key_value_stores/default/INPUT.json
```

# Actor input Schema

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

Each query returns up to "Max articles per feed" results. Google News search operators work here, e.g. `tesla source:reuters` or `"climate policy"`.

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

Section names such as WORLD, BUSINESS, TECHNOLOGY, ENTERTAINMENT, SPORTS, SCIENCE, HEALTH — or a full topic id from a Google News URL.

## `places` (type: `array`):

Local news sections by place name, e.g. `London` or `San Francisco`.

## `includeTopHeadlines` (type: `boolean`):

Add the main front-page feed for the chosen edition.

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

Interface language code, e.g. `en-US`, `de`, `fr`, `es-419`.

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

Two-letter edition code, e.g. `US`, `GB`, `DE`. Combined with language it selects the Google News edition.

## `timeFilter` (type: `string`):

Limit search results by age, e.g. `1h`, `12h`, `1d`, `7d`. Applies to search queries only. Leave empty for no limit.

## `maxArticlesPerFeed` (type: `integer`):

Google returns roughly 100 per feed at most.

## `maxItems` (type: `integer`):

Stop after this many articles in total. 0 means no limit.

## `deduplicate` (type: `boolean`):

The same story often appears in several feeds; keep only its first occurrence.

## `concurrency` (type: `integer`):

How many feeds to fetch in parallel.

## `requestDelayMs` (type: `integer`):

Raise if you see rate-limit warnings.

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

Optional. Google News RSS works without a proxy.

## Actor input object example

```json
{
  "queries": [
    "openai"
  ],
  "topics": [],
  "places": [],
  "includeTopHeadlines": false,
  "language": "en-US",
  "country": "US",
  "timeFilter": "",
  "maxArticlesPerFeed": 100,
  "maxItems": 0,
  "deduplicate": true,
  "concurrency": 3,
  "requestDelayMs": 400,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped news articles.

# 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": [
        "openai"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammad4hmed/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": ["openai"] }

# Run the Actor and wait for it to finish
run = client.actor("muhammad4hmed/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": [
    "openai"
  ]
}' |
apify call muhammad4hmed/google-news-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,muhammad4hmed/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/CogheGANybtEk3LwW/builds/753KZT7Wvhr1ow6qf/openapi.json
