# Fast Google News Scraper (`aymorato/fast-google-news-scraper`) Actor

Extract details from Google News articles, such as images, titles, links, and other relevant information.

- **URL**: https://apify.com/aymorato/fast-google-news-scraper.md
- **Developed by:** [Alwin Morato](https://apify.com/aymorato) (community)
- **Categories:** Automation, Lead generation, News
- **Features:** Full permissions
- **Stats:** 206 total users, 1 monthly users, 100.0% runs succeeded, 7 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

## Fast Google News Scraper

The Google News Scraper is a script designed to scrape Google News for each provided keyword and extract valuable data from the articles. This data includes:

- **Image**: Image of the article - This is a visual representation of the news article.
- **Keyword**: The specific keyword used to search for news articles.
- **Title**: The headline or title of the news article.
- **Author**: The author of the article. If the author is not available, it will default to null.
- **Source**: The news organization or source where the article was published.
- **Published**: The date and time when the article was published.
- **Link**: The direct URL link to the news article.

### Features

The Google News Scraper offers the following features:

- **Keyword Customization**: Customize your news searches by using specific keywords. This helps you find articles that match your interests.
- **Filter Dates**: Easily Stay updated on Google News by choosing specific timeframes, ranging from hours to years. If "1h" or "1d" is selected, the extraction is based on the actual article's published date, not the Google News published date.
- **No Usage Restrictions**: Enjoy unlimited access to Google News data. There are no limits or usage.
- **Language & Region**: You can adjust the language settings to match your preferences and target regions within Google News.

##### Updates:

- Build 0.0.23:
  - Optimized code and removed unused dependencies, resulting in a significantly reduced memory (RAM) footprint.
- Build 0.0.27:
  - Added Article News Domain
- Build 0.0.29:
  - This build significantly improves performance.

#### Sample Input

```json
{
    "keywords": [
        "renewable energy",
        "environment",
        "climate change"
    ],
    "maxItems": 100,
    "dateTime": "1d"
}
```

#### Sample Ouput:

```json
[{
  "keyword": "renewable energy",
  "title": "Alberta to ban some renewable energy projects, greens say move is 'uncertainty bomb'",
  "link": "https://www.reuters.com/world/americas/canadas-alberta-set-ban-renewables-projects-prime-land-report-2024-02-28/",
  "author": "David Ljunggren",
  "source": "Reuters Canada",
  "published": "2024-02-28T20:53:00Z",
  "domain": "www.reuters.com",
  "image": "https://www.reuters.com/resizer/6dRXj-n9Fl_pT5IRZeNje3er704=/1920x1005/smart/filters:quality(80)/cloudfront-us-east-2.images.arcpublishing.com/reuters/6PASNAKCHBM6NCD4OQU7JWHIKE.jpg"
},
{
  "keyword": "environment",
  "title": "A sad day for human rights, the environment and the competitiveness of European businesses.",
  "link": "https://www.greens-efa.eu/en/article/press/a-sad-day-for-human-rights-the-environment-and-the-competitiveness-of-european-businesses",
  "author": "Guendalina De Sario",
  "source": "Greens/EFA",
  "published": "2024-02-28T18:33:40Z",
  "domain": "www.greens-efa.eu",
  "image": "https://www.greens-efa.eu/files/assets/imgs/list/untitled_design__2_.png"
},
{
  "keyword": "climate change",
  "title": "The False Promise of Carbon Capture as a Climate Solution",
  "link": "https://www.scientificamerican.com/article/the-false-promise-of-carbon-capture-as-a-climate-solution/",
  "author": "Naomi Oreskes",
  "source": "Scientific American",
  "published": "2024-02-29T04:33:01Z",
  "domain": "www.scientificamerican.com",
  "image": "https://static.scientificamerican.com/sciam/cache/file/D29CEBBD-06F4-4E7A-BBDC282C186937E1_source.jpg?w=1200"
}]
```

# Actor input Schema

## `directLink` (type: `boolean`):

Check this option if you want to extract actual article links from the article's page metadata. If you don't need actual article links and images, you can leave this option unchecked and your run will be significantly faster and cheaper.

## `keywords` (type: `array`):

The keyword used to search for news articles.

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

Select your language and region pair.

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

Select the timeframe for the news articles.

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

Set the maximum number of items you want to scrape for each keyword. If you leave this field unset, the actor will extract all available news.

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

Select proxies to be used.

## Actor input object example

```json
{
  "keywords": [
    "climate change",
    "environment"
  ],
  "language": "US:en",
  "timeRange": "1d",
  "proxy": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "keywords": [
        "climate change",
        "environment"
    ],
    "proxy": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("aymorato/fast-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 = {
    "keywords": [
        "climate change",
        "environment",
    ],
    "proxy": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("aymorato/fast-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 '{
  "keywords": [
    "climate change",
    "environment"
  ],
  "proxy": {
    "useApifyProxy": false
  }
}' |
apify call aymorato/fast-google-news-scraper --silent --output-dataset

```

## MCP server setup

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