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

Unlock timely news insights with our Google News data retrieval tool. Get the latest news on any news at any time, and more. Effortless and powerful. 📰🔍 #NewsData

- **URL**: https://apify.com/epctex/google-news-scraper.md
- **Developed by:** [epctex](https://apify.com/epctex) (community)
- **Categories:** News, SEO tools
- **Security:** Limited permissions
- **Stats:** 620 total users, 13 monthly users, 80.8% runs succeeded, 25 bookmarks
- **User rating**: 5.00 out of 5 stars

## 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

## Actor - Google News Scraper

### Google News scraper

Since Google News doesn't provide a good and free API, this actor should help you to retrieve data from it.

The Google News data scraper supports the following features:

- Keyword Customization - Tailor your news searches with Google News, enabling precise retrieval of articles on topics of interest.

- Multilingual Support - Google News offers language options, ensuring global news coverage for diverse audiences.

- Date Filtering - Stay up-to-date with Google News by narrowing results to specific timeframes, from hours to years.

- Comprehensive Sources - Google News aggregates data from a wide range of Google News categories and topics.

- Effortless Access - With Google News, accessing news data is hassle-free and authentication-free.

- Multi-URL Integration - Combine multiple start URLs for a holistic news retrieval experience.

- No Usage Restrictions - Enjoy unlimited access and retrieval with Google News—no restrictions apply.

- Customizable Language & Region - Adjust language settings to match your preferences and target regions with Google News.

### Bugs, fixes, updates, and changelog

This scraper is under active development. If you have any feature requests you can create an issue from [here](https://github.com/epctex-support/google-news-scraper/issues).

### Input Parameters

The input of this scraper should be JSON containing the list of pages on Google News that should be visited. Required fields are:

- `startUrls`: (Optional) (Array) URLs to start with. It should be search, topic, category, or list URL.

- `search`: (Optional) (String) Keyword that you want to search on Google News.

- `language`: (Optional) (String) This value determines language and region for the news. This setting only applies to Search queries, not the start URLs.

- `date`: (Optional) (String) Date of the news. This setting only applies to Search queries, not the start URLs.

- `maxItems`: (Optional) (Number) You can limit scraped items. This should be useful when you search through the big lists or search results.

- `maxNewsPerEachItem`: (Optional) (Number) You can limit scraped news per each items. This should be useful when you search through the big lists or search results.

- `decodeArticleUrls`: (Optional) (Boolean) When enabled, the actor will resolve and decode Google News article links, adding the final, real article URL to a separate field in the output.

- `proxy`: (Required) (Proxy Object) Proxy configuration.

- `extendOutputFunction`: (Optional) (String) Function that takes a JQuery handle ($) as an argument and returns an object with data.

- `customMapFunction`: (Optional) (String) Function that takes each object's handle as an argument and returns the object with executing the function.

This solution requires the use of **Proxy servers**, either your own proxy servers or you can use [Apify Proxy](https://www.apify.com/docs/proxy).

#### Compute Unit Consumption

The actor is optimized to run blazing fast and scrape as many items as possible. Therefore, it forefronts all the detailed requests. If the actor doesn't block very often it'll scrape 100 listings in less than a minute with ~0.01-0.03 compute units.

#### Google News Scraper Input example

```json
{
  "proxy":{
    "useApifyProxy":true
  },
  "decodeArticleUrls": true,
  "startUrls":[
    "https://news.google.com/topics/CAAqIggKIhxDQkFTRHdvSkwyMHZNR054ZERrd0VnSmxiaWdBUAE?hl=en-US&gl=US&ceid=US%3Aen",
    "https://news.google.com/topics/CAAqJggKIiBDQkFTRWdvSUwyMHZNRGx6TVdZU0FtVnVHZ0pWVXlnQVAB?hl=en-US&gl=US&ceid=US%3Aen",
    "https://news.google.com/search?q=banana&hl=en-US&gl=US&ceid=US%3Aen"
  ],
  "maxItems":10
}

```

### During the Run

During the run, the actor will output messages letting you know what is going on. Each message always contains a short label specifying which page from the provided list is currently specified.
When items are loaded from the page, you should see a message about this event with a loaded item count and total item count for each page.

If you provide incorrect input to the actor, it will immediately stop with a failure state and output an explanation of what is wrong.

### Google News Export

During the run, the actor stores results into a dataset. Each item is a separate item in the dataset.

You can manage the results in any language (Python, PHP, Node JS/NPM). See the FAQ or <a href="https://www.apify.com/docs/api" target="blank">our API reference</a> to learn more about getting results from this Google News actor.

### Scraped Google News Properties

The structure of each item in Google News looks like this:

#### Item Detail

```json
{
	"googleNewsUrl": "https://news.google.com/search?q=banana+when%3A1h&ceid=US%3Aen",
	"articleUrl": "https://news.google.com/read/CBMimgFBVV95cUxNaEFOTF85MVlBdUVzbERRVm50R0JrRXN0XzVRVENsUGxfR0F0YjB2RW9oQjhoaWpwVzVPY2RiUVNJclN0SHctSE1hN2N6a05iVUdfcUdJVUIzM19pMl9aSFdSYWFOblVXbl9MLU80UVhwQ1NaNjBQakNRRkowdEgwWkpBNnduQi1HSXU4NVBZb0hSTkJmTkVtLXR30gGfAUFVX3lxTFByY3JGdmo1OTZMRTVucFB6Zm5ZX193b04ycWl5MVkwaE1kZEdGZXc5RjhHT1lqMHBkWkFIaHJCUlAxdXJkeVFWcElwdjB6VzlOZjNiM0ZYVHVseDg4VHJlZVViUmZhR1JwYTh3dkhxaEdyRU9ZRlF3STIzSUdhM0FpSTE4TllQbHRoY09reHZZZThWZElYdF9odlB6a2FESQ?hl=en-US&gl=US&ceid=US%3Aen",
	"title": "Voucher gets students a free meal at Banana Tree",
	"publishedAt": "2025-07-25T10:12:44Z",
	"imageUrl": "https://news.google.com/api/attachments/CC8iI0NnNWxaamd4TkZsRmJsbFFlWE40VFJEZ0F4aUFCU2dLTWdB=-w200-h112-p-df-rw",
	"source": "MyLondon",
	"sourceIconUrl": "https://encrypted-tbn1.gstatic.com/faviconV2?url=https://www.mylondon.news&client=NEWS_360&size=96&type=FAVICON&fallback_opts=TYPE,SIZE,URL",
	"author": "By Neil Shaw",
	"decodedArticleUrl": "https://www.mylondon.news/whats-on/food-drink-news/banana-tree-students-free-tendendo-32133755"
}
```

### Contact

Please visit us through [epctex.com](https://epctex.com) to see all the products that are available for you. If you are looking for any custom integration or so, please reach out to us through the chat box in [epctex.com](https://epctex.com). In need of support? <business@epctex.com> is at your service.

# Actor input Schema

## `startUrls` (type: `array`):

URLs to start with. It should be search, topic, category, or list URL

## `query` (type: `array`):

The keywords that you can search on Google News

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

This value determines language and region for the news. This setting only applies to Search queries, not the start URLs.

## `date` (type: `string`):

Date of the news. This setting only applies to Search queries, not the start URLs.

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

Maximum number of items that you want as output. Default is all

## `maxNewsPerEachItem` (type: `integer`):

Maximum number of news per each items that you want as output. Default is all

## `decodeArticleUrls` (type: `boolean`):

When enabled, the actor will resolve and decode Google News article links, adding the final, real article URL to a separate field in the output.

## `extendOutputFunction` (type: `string`):

Function that takes a JQuery handle ($) as argument and returns data that will be merged with the default output

## `customMapFunction` (type: `string`):

Function that takes each of the objects as argument and returns data that will be mapped by the function itself.

## `proxy` (type: `object`):

Select proxies to be used by your crawler.

## Actor input object example

```json
{
  "startUrls": [
    "https://news.google.com/topics/CAAqIggKIhxDQkFTRHdvSkwyMHZNR054ZERrd0VnSmxiaWdBUAE?hl=en-US&gl=US&ceid=US%3Aen",
    "https://news.google.com/topics/CAAqJggKIiBDQkFTRWdvSUwyMHZNRGx6TVdZU0FtVnVHZ0pWVXlnQVAB?hl=en-US&gl=US&ceid=US%3Aen",
    "https://news.google.com/search?q=banana&hl=en-US&gl=US&ceid=US%3Aen"
  ],
  "query": [
    "art"
  ],
  "language": "US:en",
  "date": "",
  "maxItems": 20,
  "maxNewsPerEachItem": 20,
  "decodeArticleUrls": false,
  "extendOutputFunction": "($) => { return {} }",
  "customMapFunction": "(object) => { return {...object} }",
  "proxy": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "startUrls": [
        "https://news.google.com/topics/CAAqIggKIhxDQkFTRHdvSkwyMHZNR054ZERrd0VnSmxiaWdBUAE?hl=en-US&gl=US&ceid=US%3Aen",
        "https://news.google.com/topics/CAAqJggKIiBDQkFTRWdvSUwyMHZNRGx6TVdZU0FtVnVHZ0pWVXlnQVAB?hl=en-US&gl=US&ceid=US%3Aen",
        "https://news.google.com/search?q=banana&hl=en-US&gl=US&ceid=US%3Aen"
    ],
    "query": [
        "art"
    ],
    "maxItems": 20,
    "maxNewsPerEachItem": 20,
    "extendOutputFunction": ($) => { return {} },
    "customMapFunction": (object) => { return {...object} },
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("epctex/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 = {
    "startUrls": [
        "https://news.google.com/topics/CAAqIggKIhxDQkFTRHdvSkwyMHZNR054ZERrd0VnSmxiaWdBUAE?hl=en-US&gl=US&ceid=US%3Aen",
        "https://news.google.com/topics/CAAqJggKIiBDQkFTRWdvSUwyMHZNRGx6TVdZU0FtVnVHZ0pWVXlnQVAB?hl=en-US&gl=US&ceid=US%3Aen",
        "https://news.google.com/search?q=banana&hl=en-US&gl=US&ceid=US%3Aen",
    ],
    "query": ["art"],
    "maxItems": 20,
    "maxNewsPerEachItem": 20,
    "extendOutputFunction": "($) => { return {} }",
    "customMapFunction": "(object) => { return {...object} }",
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("epctex/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 '{
  "startUrls": [
    "https://news.google.com/topics/CAAqIggKIhxDQkFTRHdvSkwyMHZNR054ZERrd0VnSmxiaWdBUAE?hl=en-US&gl=US&ceid=US%3Aen",
    "https://news.google.com/topics/CAAqJggKIiBDQkFTRWdvSUwyMHZNRGx6TVdZU0FtVnVHZ0pWVXlnQVAB?hl=en-US&gl=US&ceid=US%3Aen",
    "https://news.google.com/search?q=banana&hl=en-US&gl=US&ceid=US%3Aen"
  ],
  "query": [
    "art"
  ],
  "maxItems": 20,
  "maxNewsPerEachItem": 20,
  "extendOutputFunction": "($) => { return {} }",
  "customMapFunction": "(object) => { return {...object} }",
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call epctex/google-news-scraper --silent --output-dataset

```

## MCP server setup

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