# Agentic Google News API (`wallysystems/agentic-google-news-api`) Actor

Low-cost Google News search API for AI agents, automations, monitoring workflows, and developers. Returns structured news results from Google News RSS with pay-per-result pricing.

- **URL**: https://apify.com/wallysystems/agentic-google-news-api.md
- **Developed by:** [Wally Systems](https://apify.com/wallysystems) (community)
- **Categories:** News, Agents, Developer tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.00005 / actor start

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

## Agentic Google News API

`agentic-google-news-api` is a compact Google News search API for AI agents, MCP workflows, automations, brand monitoring, and market monitoring. It reads Google's public RSS search feeds with ordinary HTTP requests—no browser automation, proxies, LLMs, or paid data providers.

Each article becomes one normalized default-dataset item, so an agent can retrieve JSON, JSONL, CSV, or the Apify dataset API directly after a run.

### What it does

- Searches one to twenty Google News queries in a selected country and language.
- Supports optional `from` and `to` dates in `YYYY-MM-DD`.
- Keeps at most 100 valid records per query.
- Removes duplicate articles deterministically by retaining the first occurrence in input-query and feed order.
- Isolates a failed query so successful queries still return results.
- Uses bounded concurrency, request timeouts, and exponential retries only for transient failures.

It does not scrape full articles or use browser automation. `articleUrl` is `null` unless the RSS record already provides a direct non-Google-News URL; `googleNewsUrl` is always the RSS link.

### Input

```json
{
  "queries": ["OpenAI", "AI regulation"],
  "country": "US",
  "language": "en",
  "maxResultsPerQuery": 50,
  "from": "2026-08-01",
  "to": "2026-08-14",
  "deduplicate": true
}
```

`queries` is required and accepts 1–20 non-empty strings. `country` defaults to `US`, `language` to `en`, `maxResultsPerQuery` to `100` (and cannot exceed it), and `deduplicate` to `true`.

### Output

Every dataset item has this stable machine-readable shape:

```json
{
  "query": "OpenAI",
  "title": "Example headline",
  "source": "Example Publisher",
  "sourceDomain": "example.com",
  "publishedAt": "2026-08-14T08:30:00.000Z",
  "googleNewsUrl": "https://news.google.com/rss/articles/...",
  "articleUrl": null,
  "language": "en",
  "country": "US",
  "fetchedAt": "2026-08-14T09:00:00.000Z"
}
```

Nullable fields are explicitly `null` when Google omits them or their value is not reliable. All usable dates are normalized to ISO-8601 UTC.

### Pay-per-event and agentic payments

The extraction path calls `Actor.pushData(article, 'news-result')` once per retained article. On Apify, this is the official atomic dataset-item/pay-per-event path: records that are discarded as duplicates, malformed, from a failed query, or absent are never charged. If the caller's event limit is reached, the Actor stops accepting additional results.

Set the price for the `news-result` event in Apify Console after deployment. Pricing stays out of extraction code. An Actor using pay per event, limited permissions, and no Standby mode meets the current technical conditions for Apify agentic payments such as x402; final Store eligibility is determined by Apify after configuration and publication. See [DEPLOY.md](DEPLOY.md).

### Local development

Requires Node.js 20 or later.

```bash
npm install
npm test
npm run build
```

To run locally, place an `INPUT.json` file in `storage/key_value_stores/default/` (Apify local-storage convention), then run:

```bash
npm start
```

To validate the live public RSS endpoint without writing data:

```bash
npm run smoke
```

To exercise local pay-per-event accounting, run the Actor with `ACTOR_TEST_PAY_PER_EVENT=true`; Apify writes its local charging events to `storage/datasets/charging-log/`.

### Deployment

The repository includes the Actor manifest, schemas, Dockerfile, source, tests, and deploy guidance. Install the Apify CLI, authenticate it, and follow [DEPLOY.md](DEPLOY.md). The intended Store positioning is Google News API, Google News search API, real-time news data, news search for AI agents, brand monitoring, market monitoring, MCP workflows, and x402/agentic payments.

### Operational notes

Google News RSS is a public external source and its coverage, links, and query behavior may change. The Actor deliberately returns only RSS metadata and never claims complete coverage or direct publisher URLs it has not reliably received.

# Actor input Schema

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

One to twenty Google News search phrases, processed in the supplied order.

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

Two-letter country selector used for Google News edition and results.

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

Language code used for the Google News edition and results.

## `maxResultsPerQuery` (type: `integer`):

Maximum valid RSS records retained for each query. Must be from 1 to 100.

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

Optional inclusive start date in YYYY-MM-DD, added to the Google News search.

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

Optional end date in YYYY-MM-DD, added to the Google News search.

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

When enabled, retain the first matching article across all queries in input order.

## Actor input object example

```json
{
  "queries": [
    "OpenAI",
    "artificial intelligence regulation"
  ],
  "country": "US",
  "language": "en",
  "maxResultsPerQuery": 100,
  "from": "2026-08-01",
  "to": "2026-08-14",
  "deduplicate": true
}
```

# Actor output Schema

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

Normalized Google News article records in the default dataset.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("wallysystems/agentic-google-news-api").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("wallysystems/agentic-google-news-api").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 '{}' |
apify call wallysystems/agentic-google-news-api --silent --output-dataset

```

## MCP server setup

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

```

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/cyCrWn9GcfA5HGID2/builds/UV0aUublHz72f9AEx/openapi.json
