# Google News API & Scraper - Headlines by Keyword & Country (`rocketyard/google-news-scraper`) Actor

Google News API: returns the headlines of any Google News search or topic (headline, publisher, publisher domain and more) over REST. Search by keyword with Google operators or pick topics, and set the country, language and time range. JSON, CSV or Excel. $1.00 per 1,000 articles, no subscription.

- **URL**: https://apify.com/rocketyard/google-news-scraper.md
- **Developed by:** [Rocketyard](https://apify.com/rocketyard) (community)
- **Categories:** News, AI, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.65 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 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 API & Scraper - Headlines by Keyword & Country

**Google News API & Scraper** is a REST API on the Apify platform: one request returns the headlines of any Google News search, topic or top stories feed, in any country and language Google News covers, as JSON, CSV or Excel. You can also run it from a form in the Apify Console, without code.

### What does Google News API & Scraper do?

Google News API & Scraper returns the headlines of any Google News search or topic: one clean record per article, with typed values (numbers, booleans, ISO dates) ready for spreadsheets, databases and AI pipelines.

- Search Google News by keyword with its own operators (exact phrases, site:, -word, when:), or read topics and top stories
- Any country and language Google News has an edition for, and every record says which edition it came from
- Clean headlines without the publisher suffix, the publisher's name, website and domain, ISO publish times, feed position and the related coverage Google groups with a story
- One article found by two searches is stored and charged once, by its Google News ID
- The time range filter runs before billing: older articles are never charged
- An error item with a clear code for every feed that yields nothing, never charged
- Plain HTTP on the public RSS feeds, no browser, no login. Pay only per result: no monthly rental, no minimums

### Use cases

- **Monitor news about your company, brand or competitors every hour or every day**
- **Track a topic across publishers for media monitoring and PR reports**
- **Feed fresh headlines with publishers and publish times into an LLM, a RAG pipeline or an AI agent**
- **Build headline datasets by country and language for research**

### Why this Google News article scraper?

- Cheaper than typical alternatives ($1.00 vs $2.50 per 1,000 results)

### How it compares

| Google News article scraper | Users (last 30 days) | Successful runs (last 30 days) | Price per 1,000 results |
| --- | --- | --- | --- |
| Google News Scraper (Pay Per Event) | 562 | 99.5% | $4.00 |
| Google News Scraper | 366 | 100.0% | $2.00 |
| Google News Scraper | 206 | 99.5% | $2.30 |
| **This Actor** | new | every release is tested on live pages first | **$1.00** |

Apify Store data from 2026-11-11, free-plan prices. Prices and stats change; check each listing before you compare.

### Google News API

Every Apify Actor is also a REST endpoint, so Google News API & Scraper works as a Google News API, a Google News RSS API or a news API, without a server of your own. One `POST` starts a run, waits for it and returns the results:

```text
POST https://api.apify.com/v2/acts/rocketyard~google-news-scraper/run-sync-get-dataset-items
```

Send your [Apify API token](https://console.apify.com/settings/integrations) in the `Authorization` header and the [input](#input-example) as the JSON body. Add `?format=csv` or `?format=xlsx` to get CSV or Excel instead of JSON. The request waits up to 300 seconds; for a longer run, start it with `POST /v2/acts/rocketyard~google-news-scraper/runs` and read the dataset when it finishes.

### How it works

Google News publishes every search, every topic section and the top stories of each edition as a public RSS feed, the format feed readers use. The Actor builds the feed URL for each search and topic you give it, with the country, language and time range you pick, reads it over plain HTTP, one request per second, with no browser, login or cookies, and turns each item into a typed record: the headline without the publisher suffix Google adds, the publisher's name, website and domain, the publish time in ISO 8601, the item's Google News link and ID, its position in the feed and, in topic and top stories feeds, the other outlets Google groups with the story. It reads nothing but the feeds: the article link is Google News' own, and the Actor does not call Google's internal endpoints to decode it, so records carry no publisher article URL. Articles outside your time range are not charged, and an article found by two feeds is stored and charged once.

### How to use it

1. Click **Try for free**.
2. Add what you are looking for to **Search queries**, pick **Topics**, or paste Google News URLs.
3. Set **Country**, **Language** and **Time range** if you need another edition or only recent news.
4. Click **Start**, then download results as JSON, CSV, Excel or via the API.

### Input

| Field | JSON key | What it does |
|---|---|---|
| Search queries | `queries` | What to search for, as you would type it into Google News. Its operators work: "exact phrase" in quotes, site:reuters.com for one publisher, -word to leave a word out, OR between alternatives. |
| Topics | `topics` | Google News sections to read, or the edition's top stories. Leave empty to read searches only. |
| Google News URLs | `startUrls` | RSS feeds or pages copied from news.google.com: a search (news.google.com/search?q=...), a topic (news.google.com/topics/...) or the home page. Each is read as its RSS feed, in its own country and language. |
| Country | `country` | Two-letter country of the Google News edition, such as US, GB, DE, IN or BR. |
| Language | `language` | Language of the edition, such as en, de, fr, hi or pt-419. For a country and language pair Google News has no edition for, it serves its nearest one, and each record's country and language say which. |
| Time range | `timeRange` | Only articles published in this period. Searches send it to Google as when:, and every feed is also filtered by publish time. Older articles are not charged. |
| Max articles per search or topic | `maxArticlesPerQuery` | Stop each feed after this many stored articles. Empty means all it lists: up to about 100 for a search, fewer for a topic. |
| Max articles | `maxItems` | Stop after this many stored articles, across all searches, topics and URLs. |
| Proxy configuration | `proxyConfiguration` | Optional proxy. Leave empty to use the IP address of the Apify server running the Actor. |

### Input example

```json
{
  "queries": [
    "artificial intelligence",
    "electric vehicles site:reuters.com"
  ],
  "topics": [
    "TECHNOLOGY"
  ],
  "country": "US",
  "language": "en",
  "timeRange": "7d",
  "maxItems": 300
}
```

### Output example

A real record from the latest test run (news.google.com) on 2026-11-11. Fields the page didn't publish are left out here; the Actor returns them as `null`.

```json
{
  "url": "https://news.google.com/rss/headlines/section/topic/BUSINESS?hl=en-GB&gl=GB&ceid=GB:en",
  "type": "NewsArticle",
  "title": "Nvidia hires leading US law firm to investigate Jensen Huang’s relationship",
  "sourceName": "The Guardian",
  "sourceUrl": "https://www.theguardian.com",
  "sourceDomain": "theguardian.com",
  "publishedAt": "2026-11-11T11:52:00.000Z",
  "googleNewsUrl": "https://news.google.com/rss/articles/CBMiwgFBVV95cUxPVE0zY21CWUpFX2xVMEZJRll3dzgxc19BYXFXLWxxWnk1eF9uSmtEZU5KVDVqZ29KOEVxdUJpdWlJU3IzQzNfUDVubHV3bzA2WFJwRC02eTdHcWZSb2FJX19JY2hsdHlzdHhlMmZMd2JGN080UnJ0R2lERXdocVowRkd5UlAzODVvclJ3eGVRbW5lZWVuaVpKT2tlNkFCWjdZbHVOVGd3a2E5VlhtNjJUbDRURDlVT0thaGtNWXYt…",
  "guid": "CBMiwgFBVV95cUxPVE0zY21CWUpFX2xVMEZJRll3dzgxc19BYXFXLWxxWnk1eF9uSmtEZU5KVDVqZ29KOEVxdUJpdWlJU3IzQzNfUDVubHV3bzA2WFJwRC02eTdHcWZSb2FJX19JY2hsdHlzdHhlMmZMd2JGN080UnJ0R2lERXdocVowRkd5UlAzODVvclJ3eGVRbW5lZWVuaVpKT2tlNkFCWjdZbHVOVGd3a2E5VlhtNjJUbDRURDlVT0thaGtNWXYtMGtLdw",
  "relatedArticles": [
    {
      "title": "This Trader Raised Alarm About Nvidia’s China Entanglements Months Ago",
      "sourceName": "The New York Times",
      "googleNewsUrl": "https://news.google.com/rss/articles/CBMiiwFBVV95cUxOX2FTU2VwZWc4azh1MzNySzJzQ29qWXV4akVDNUF3Y0g3NjR4VDRvdUtZRkNDd2tuTnpvS3hUc0VFR185YU9WNjhpa25zcWtYSkJWbnhMOE1fWFpXd0UtMloxZmtmMzBMZFJjWWhwbXU4Q2NrRkVsTExvdTRVTmFmTTB6Z0QyYXdnZmx3?oc=5"
    },
    {
      "title": "Alice Huang’s tangled web of connections",
      "sourceName": "Financial Times",
      "googleNewsUrl": "https://news.google.com/rss/articles/CBMihAFBVV95cUxPVk43WnVwbC1WMi04SVJVWGlDSE5wblZ4ZkhrQl9OWjQxS0FUUmJuVTVRaU9QdkNTenFWSlk1blU5c2FjVTBqQkNsZUZ3bWFtUnF3d0hfUkU3OUJ4Q3RGUW1LZ0VGRzByekw0OTJfblNHRmlhZmNYbXZXdG5pbnlyOTZocXM?oc=5"
    },
    {
      "title": "Trump says FBI investigating Nvidia boss's affair with alleged Chinese spy",
      "sourceName": "BBC",
      "googleNewsUrl": "https://news.google.com/rss/articles/CBMiXkFVX3lxTFA4NURrdXNUTnFfYmp3REZhcGdPeTNfYlNXOHlfaHZ3LS1DU1o1by0wT1MyeHdFQnZrRXFMSndOeXVVRGNPd0JCemZMSlBwOGpxV0s2Mmc2Z0pzTHlReGc?oc=5"
    },
    {
      "title": "Nvidia shares rebound 4% as Huang faces scrutiny ahead of earnings",
      "sourceName": "CNBC",
      "googleNewsUrl": "https://news.google.com/rss/articles/CBMigAFBVV95cUxNalRRWWRUS0VHb2Q4Y0dhNFdWY1BzTWlqWG8yOXBwZVJtRlFOck5iZlMzcmJlTHZnRkNaZ0hNUXBrTkptb0xqU3RBSUo5V09ERzlxb095YmRmRHNZaFVYVVhUY0ZxN1E4Q0twdFhLTzA0N0lDTnpXUGl3Szc2eHVUcw?oc=5"
    }
  ],
  "topic": "BUSINESS",
  "country": "GB",
  "language": "en",
  "position": 1,
  "scrapedAt": "2026-11-11T13:01:57.000Z"
}
```

#### Output fields

| Field | Description |
|---|---|
| `url` | The Google News RSS feed the article was read from (error items for a feed carry the same `url`) |
| `type` | Always `NewsArticle` |
| `title` | Headline, without the " - Publisher" suffix Google adds |
| `sourceName` | Publisher, as Google News names it |
| `sourceUrl` | Publisher's website (its home page), from the feed. Not the article's own URL |
| `sourceDomain` | Domain of the publisher's website, without www. |
| `publishedAt` | Publish time in ISO 8601 (UTC), from the feed |
| `googleNewsUrl` | Google News' link to the article (news.google.com/rss/articles/...). A browser that opens it is sent on to the article; the Actor does not decode it |
| `guid` | Google News' ID of the article: the same article has the same `guid` in every feed and run |
| `relatedArticles` | Other outlets' coverage of the same story, as Google groups it: `title`, `sourceName` and `googleNewsUrl` each. Top stories and topic feeds only; `null` for search results |
| `query` | The search that found the article; `null` in topic feeds |
| `topic` | The topic that listed the article (`TOP_STORIES` for top stories, a topic ID for a pasted topic URL); `null` in searches |
| `country` | Country of the Google News edition the feed came from (US, GB, DE...) |
| `language` | Language of that edition (en, de, pt-419...) |
| `position` | Rank in the feed, from 1: Google's own order |
| `scrapedAt` | ISO timestamp of the extraction |

### Error items

When an input produces no data, the dataset gets one **error item** for it, so nothing is skipped silently. Error items are **free**: only result records are charged.

```json
{
  "url": "https://news.google.com/rss/search?q=xqzvbnmlkjhgfdsa&hl=en-US&gl=US&ceid=US:en",
  "input": "https://news.google.com/rss/search?q=xqzvbnmlkjhgfdsa&hl=en-US&gl=US&ceid=US:en",
  "error": {
    "type": "https://rocketyard.dev/errors#empty",
    "title": "Nothing published",
    "detail": "Google News has no articles for \"xqzvbnmlkjhgfdsa\" right now (edition US:en).",
    "instance": "https://news.google.com/rss/search?q=xqzvbnmlkjhgfdsa&hl=en-US&gl=US&ceid=US:en",
    "code": "EMPTY"
  }
}
```

The `error` object follows [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) (Problem Details). Its `type` links to the [explanation of the code](https://rocketyard.dev/errors), and `status` is the site's HTTP status when there was one. Filter on `error.code` to separate failures from data; it has its own column in CSV and Excel exports.

| Code | Meaning | Retry? |
|---|---|---|
| [`PRIVATE_ADDRESS`](https://rocketyard.dev/errors#private-address) | The URL, or a redirect from it, points to a private or local network address. Only public websites are fetched. | no |
| [`NOT_FOUND`](https://rocketyard.dev/errors#not-found) | The page or source does not exist (HTTP 404 or 410). | no |
| [`BLOCKED`](https://rocketyard.dev/errors#blocked) | The site refused access (HTTP 401, 403 or 429) or answered with a bot-check or consent page instead of the content. | sometimes |
| [`HTTP_ERROR`](https://rocketyard.dev/errors#http-error) | The site answered with another HTTP error: a server error (5xx) that persisted after retries, or an unexpected 4xx status. | sometimes |
| [`TIMEOUT`](https://rocketyard.dev/errors#timeout) | The site did not answer in time, even after retries. | yes |
| [`NETWORK_ERROR`](https://rocketyard.dev/errors#network-error) | The connection failed (DNS, TLS or a reset connection), even after retries. | yes |
| [`WRONG_CONTENT_TYPE`](https://rocketyard.dev/errors#wrong-content-type) | The URL returned something the Actor doesn't read, such as a PDF or image instead of an HTML page, or a web page where an API response was expected. | no |
| [`TOO_LARGE`](https://rocketyard.dev/errors#too-large) | The response exceeded the size limit (10 MiB for web pages, 48 MiB for API responses). | no |
| [`PARSE_ERROR`](https://rocketyard.dev/errors#parse-error) | The response could not be read (malformed HTML or JSON). | sometimes |
| [`EMPTY`](https://rocketyard.dev/errors#empty) | The source has nothing to return right now: a list with no open items, a store or collection with no products, a search with no results, or a web page whose HTML has no readable text (often a page built only by JavaScript in the browser). | no |
| [`NO_MATCHES`](https://rocketyard.dev/errors#no-matches) | The source has items, but none of them matched your filters. | no |

### Limits

- `googleNewsUrl` is Google News' link to the article (news.google.com/rss/articles/...). A browser that opens it is sent on to the article, but the Actor does not decode it, so records have no publisher article URL. `sourceUrl` is the publisher's home page.
- A search feed lists about 100 articles at most (102 in our test on 2026-11-11), and topic feeds fewer (66 for Technology, 38 top stories). For more, split a search by time range, publisher (`site:`) or wording.
- The feeds carry no article text, images or authors: the item's description holds only its headline and, for grouped stories, the related coverage returned in `relatedArticles`.
- Google News has editions for some country and language pairs only. For any other pair Google serves its nearest edition (KZ with ru gets Russia's, DE with en gets the US one), and `country` and `language` say which edition each record came from.
- Google may answer an IP address with a CAPTCHA or a consent page, or refuse it with HTTP 401, 403 or 429. The Actor then stores one free `BLOCKED` error item and stops the run, keeping what it stored so far. It never tries to get past a block. Run it again later.

### Pricing

Pay per result: **$1.00 per 1,000 articles**, plus a tiny per-run start fee. Articles outside your time range, articles already stored from another feed of the run, and feeds that yield nothing are not charged. There is no monthly rental, and you can cap spend per run with **Max results** or **Maximum cost per run**.

### Integrations and API

Run it from the [Apify API](https://docs.apify.com/api/v2), the JavaScript/Python clients, Make, Zapier, n8n, LangChain or any MCP-compatible AI agent, and send results to Google Sheets, webhooks, S3 and more. Schedule it to track changes over time.

### FAQ

**Which news does it cover?** What Google News lists for a logged-out visitor: any search, the topic sections (World, Nation, Business, Technology, Entertainment, Sports, Science, Health) and the top stories, in any country and language Google News has an edition for. Feeds and pages copied from news.google.com work too: search, topic and home page URLs.

**Does it return the publisher's article URL?** No. `googleNewsUrl` is the link Google News puts in its feed; opening it in a browser takes you to the article. Getting the publisher's URL would mean calling Google's internal endpoints for every article, which this Actor does not do. `sourceName`, `sourceUrl` and `sourceDomain` name the publisher.

**Can I use search operators?** Yes. A query goes to Google News as you write it: an "exact phrase" in quotes, `site:reuters.com` for one publisher, `-word` to leave a word out, `OR` between alternatives, and `when:1h`, `when:1d` or `when:7d` for recent news. **Time range** adds `when:` for you.

**How do I get news from another country or in another language?** Set **Country** and **Language**, for example GB and en, DE and de, IN and hi, or BR and pt-419. Each record's `country` and `language` say which Google News edition it came from.

**Is this the official Google News API?** No. Google offers no public Google News API. This is an independent Actor that reads Google News' public RSS feeds and is not affiliated with Google. It needs no API key.

**How do I monitor news every hour or every day?** Schedule the Actor on Apify with **Time range** set to the past hour or the past 24 hours. An article keeps its `guid` across runs, so you can skip the ones you already have.

**How much does it cost?** You pay per result: $1.00 per 1,000 articles, plus a start fee of $0.00005 per run, with no subscription. Cap any run with **Maximum cost per run**.

**How do I call it from the API?** One request starts a run and returns its results, using your [Apify API token](https://console.apify.com/settings/integrations):

```bash
curl -X POST "https://api.apify.com/v2/acts/rocketyard~google-news-scraper/run-sync-get-dataset-items" -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" -d '{"queries":["artificial intelligence","electric vehicles site:reuters.com"],"topics":["TECHNOLOGY"],"country":"US","language":"en","timeRange":"7d","maxItems":300}'
```

**How do I use it with AI agents?** Connect Apify's MCP server at `https://mcp.apify.com?tools=rocketyard/google-news-scraper`, and the agent can call this Actor as a tool.

**Is it legal to scrape Google News data?** The Actor reads Google News' public RSS feeds, which anyone can open without logging in, and uses no account cookies. It does not check robots.txt, and Google's robots.txt disallows the /rss path the feeds are served from. Each feed's copyright notice says it is made available for personal, non-commercial use in a feed reader. The Actor never solves CAPTCHAs or passes consent pages and bot checks, and headlines belong to their publishers. You are responsible for how you use the data under Google's terms, the publishers' rights and the law (for example copyright).

**What happens when an input fails?** A feed that yields nothing gets one [error item](#error-items) with a code and the reason, and is not charged, and the other feeds still run. A block is different: when Google answers with a CAPTCHA or a consent page, or refuses the request, the Actor stores one free `BLOCKED` item and stops the whole run, keeping the articles already stored.

**I need a field that is not supported.** Open an issue on the Actor's Issues tab. Requests are reviewed regularly and drive new features.

### You might also like

- [Article Scraper - Extract Article Data from Any Site](https://apify.com/rocketyard/article-schema-scraper): article data from any website with schema.org markup
- [Ashby Job Board API - All Open Roles](https://apify.com/rocketyard/ashby-jobs-scraper): every open job from Ashby job boards
- [Greenhouse Job Board API - All Open Roles](https://apify.com/rocketyard/greenhouse-jobs-scraper): every open job from Greenhouse job boards
- [Job Listings API - Any Careers Site to JSON](https://apify.com/rocketyard/jobposting-schema-scraper): job posting data from any website with schema.org markup
- [Lever Jobs API & Scraper](https://apify.com/rocketyard/lever-jobs-scraper): every open job from Lever job boards

### Made by Rocketyard

[Rocketyard](https://rocketyard.dev) builds pay-per-result scrapers for public web data, and every release is tested on live pages before it ships. Guides for this Actor: [overview](https://rocketyard.dev/google-news-scraper), [REST API](https://rocketyard.dev/google-news-scraper#api), [MCP for AI agents](https://rocketyard.dev/google-news-scraper#mcp) and [n8n, Make and Zapier](https://rocketyard.dev/google-news-scraper#automation).

# Actor input Schema

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

What to search for, as you would type it into Google News. Its operators work: "exact phrase" in quotes, site:reuters.com for one publisher, -word to leave a word out, OR between alternatives.

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

Google News sections to read, or the edition's top stories. Leave empty to read searches only.

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

RSS feeds or pages copied from news.google.com: a search (news.google.com/search?q=...), a topic (news.google.com/topics/...) or the home page. Each is read as its RSS feed, in its own country and language.

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

Two-letter country of the Google News edition, such as US, GB, DE, IN or BR.

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

Language of the edition, such as en, de, fr, hi or pt-419. For a country and language pair Google News has no edition for, it serves its nearest one, and each record's country and language say which.

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

Only articles published in this period. Searches send it to Google as when:, and every feed is also filtered by publish time. Older articles are not charged.

## `maxArticlesPerQuery` (type: `integer`):

Stop each feed after this many stored articles. Empty means all it lists: up to about 100 for a search, fewer for a topic.

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

Stop after this many stored articles, across all searches, topics and URLs.

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

Optional proxy. Leave empty to use the IP address of the Apify server running the Actor.

## Actor input object example

```json
{
  "queries": [
    "artificial intelligence"
  ],
  "country": "US",
  "language": "en",
  "timeRange": "any",
  "maxItems": 100
}
```

# Actor output Schema

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

One record per Google News article, plus a free error item for each input that yielded no data, as JSON, CSV or Excel.

## `runSummary` (type: `string`):

Feeds read, articles read, stored and left out as duplicates, requests sent, error items, why the run stopped and how long it took.

# 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"
    ],
    "maxItems": 100
};

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

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

```

## MCP server setup

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