# Google News Scraper — Free Headlines by Keyword & Country (`datarock/google-news-scraper`) Actor

Free Google News scraper: headlines, source and publish time by keyword or topic, for several countries and languages per run. JSON, CSV, Sheets.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 — Free Headlines by Keyword, Topic & Country

Get the latest Google News headlines for any keyword or topic: headline, publisher, publisher website, publish time, rank, related coverage and the Google News link. Several queries and several countries/languages in one run; schedule it and get **only new articles** since the last run.

> **Free.** No usage fee; a run only uses a little Apify platform compute from your credits.

### Features

- **Keywords or topics**: search any phrase (operators work: `"exact phrase"`, `OR`, `-word`, `site:example.com`, `when:7d`) or pick topics `TOP_STORIES, WORLD, NATION, BUSINESS, TECHNOLOGY, ENTERTAINMENT, SPORTS, SCIENCE, HEALTH`.
- **50 countries**: `US`, `GB`, `DE`, `FR`, `IN`, `BR`… The language is chosen per country automatically; override with `language` or per edition, e.g. `CH:fr`, `US:es`.
- **Time window**: past hour, 12 h, 24 h, 7 days, month, year, or your own `from`/`to` dates.
- **Can't run for hours**: `maxRunSeconds` (default 300 s) stops the run cleanly and keeps results; `maxItems` caps the run.
- **Reliable**: every feed is retried up to 5 times with backoff; one bad query or country never stops the run; each query that fails gets its own item with `status` and `errorMessage`. The run only fails if *every* feed failed.
- **Only new since last run** for alerts (Slack, Sheets, n8n, Make, Zapier).
- **Flat output** for CSV / Google Sheets.

Free limits: up to **5 queries/topics per run** (extra ones are skipped with a warning) and **500 articles per run** (hard limit). One feed returns up to 100 articles per query × country; `splitByDay` can return more for one query, up to the 500-per-run limit.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `queries` | string\[] | – | Keywords or phrases (max 5 incl. topics) |
| `topics` | string\[] | `[]` | Google News topics |
| `countries` | string\[] | `["US"]` | ISO-2 codes, optionally `CC:lang` |
| `language` | string | native | Force a language, e.g. `en`, `de`, `en-GB` |
| `maxItemsPerQuery` | integer | 100 | 1–500 per query × country (above 100 needs `splitByDay`) |
| `period` | enum | `7d` | `any, 1h, 12h, 1d, 7d, 1m, 1y` (search queries only) |
| `from` / `to` | date | empty | Custom range `YYYY-MM-DD` (inclusive); overrides `period` |
| `splitByDay` | boolean | false | Fetch each day separately + dedupe (bounded by the 500-per-run limit) |
| `maxItems` | integer | 500 | Cap for the whole run, 1–500 |
| `maxRunSeconds` | integer | 300 | Clean stop at this time; unfinished queries get `status: skipped` |
| `outputFormat` | enum | `nested` | `nested` or `flat` |
| `onlyNewSinceLastRun` | boolean | false | Skip articles returned by earlier runs of the same input |
| `stateKey` | string | auto | Custom name for that memory |
| `proxyConfiguration` | object | none | Not needed normally |

No input at all = US top stories.

### Output

| Field | Description |
|---|---|
| `dataType` | `googleNews` |
| `status` | `ok`; per query: `no_results`, `skipped`, `error`, `rateLimited`, `invalid_input` |
| `query` / `topic` | What returned the article |
| `country` / `language` | Edition |
| `rank` | Position in the feed (1 = top) |
| `title` | Headline (publisher suffix removed); `titleWithSource` keeps Google's original |
| `source` / `sourceUrl` | Publisher name and website |
| `publishedAt` | ISO 8601 |
| `googleNewsUrl` / `articleId` | Google News link (redirects to the publisher) and its id |
| `related` / `relatedCount` | Other outlets covering the same story (topic feeds); flat: `relatedTitles`, `relatedSources` |
| `feedUrl` | The exact RSS URL used |
| `coverageNote` | Set when a feed/window hit Google's ~100-article cap (results may be incomplete) |
| `errorMessage` | Only on non-ok items |
| `scrapedAt` | ISO 8601 |

A `RUN_REPORT` record in the key-value store summarises feeds, successes, failures, items and duration.

```json
{ "dataType": "googleNews", "query": "bundesliga", "topic": null, "country": "DE", "language": "de", "rank": 1,
  "title": "FC Bayern: …", "source": "SPORT1", "sourceUrl": "https://www.example.com", "publishedAt": "2026-10-23T16:30:24.000Z",
  "googleNewsUrl": "https://news.google.com/rss/articles/<articleId>", "relatedCount": 0, "status": "ok", "errorMessage": null, "scrapedAt": "2026-10-23T17:27:33.016Z" }
```

### Only new since last run

Article ids already returned are kept in your named key-value store `google-news-state` under a key derived from `queries + topics + countries + language` (or your `stateKey`); last 20,000 ids, per country.

### Trend → news

Run *Google Trending Now*, take each `term` and pass them as `queries`.

Not affiliated with Google. You are responsible for using the data lawfully.

# Actor input Schema

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

Keywords or phrases (Google News operators work: quotes, OR, -word, site:). Free: up to 5 queries per run (extra ones are skipped with a warning).

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

Google News sections: TOP_STORIES, WORLD, NATION, BUSINESS, TECHNOLOGY, ENTERTAINMENT, SPORTS, SCIENCE, HEALTH. Each topic counts as a query.

## `countries` (type: `array`):

ISO 2-letter codes (US, GB, DE, FR, IN, BR...). Language is picked per country automatically; override per edition with 'CH:fr' or 'US:es'.

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

Force one language for all plain country codes, e.g. en, de, es, en-GB. Empty = native language of each country.

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

Up to 100 from one feed; up to 500 with 'Split into daily windows' (still bounded by the 500-per-run limit).

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

Free limit: 500 articles per run (hard cap). Lower it to keep runs small.

## `maxRunSeconds` (type: `integer`):

The run stops cleanly and saves results when this time is reached; unfinished queries get status 'skipped'. Prevents runaway runs.

## `period` (type: `string`):

Applies to search queries. Ignored when a custom date range is set. Topics ignore it.

## `from` (type: `string`):

Custom range start (YYYY-MM-DD), search queries only.

## `to` (type: `string`):

Custom range end, inclusive (YYYY-MM-DD). Empty = today.

## `splitByDay` (type: `boolean`):

Google News feeds stop at ~100 articles. This fetches each day of the range/time window separately and removes duplicates, so you get far more articles per query. Bounded by the free limit of 500 articles per run.

## `outputFormat` (type: `string`):

'flat' turns the related-coverage list into text columns.

## `onlyNewSinceLastRun` (type: `boolean`):

For schedules: skip articles already returned by earlier runs with the same queries/topics/countries/language (state kept in your named key-value store 'google-news-state', last 20,000 articles).

## `stateKey` (type: `string`):

Custom name for the 'only new' memory, to share or separate it between schedules.

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

Optional; not needed for normal use. Enable only if you see status 'rateLimited'.

## Actor input object example

```json
{
  "queries": [
    "artificial intelligence",
    "tesla"
  ],
  "topics": [],
  "countries": [
    "US"
  ],
  "maxItemsPerQuery": 100,
  "maxItems": 500,
  "maxRunSeconds": 300,
  "period": "7d",
  "splitByDay": false,
  "outputFormat": "nested",
  "onlyNewSinceLastRun": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

All articles with status, as JSON/CSV/Excel.

## `articlesTable` (type: `string`):

No description

## `runReport` (type: `string`):

No description

# 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",
        "tesla"
    ],
    "countries": [
        "US"
    ]
};

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

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

```

## MCP server setup

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