# Google Search Results (`pontio/google-search-results`) Actor

Google organic results (title, link, snippet) per query and page, shaped like Custom Search JSON API items. Batch queries, country, language, site filter. Charged per page with results; empty pages and errors are free.

- **URL**: https://apify.com/pontio/google-search-results.md
- **Developed by:** [Gabor Molnar](https://apify.com/pontio) (community)
- **Categories:** Developer tools, SEO tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 results pages

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 Search Results

Ranked Google organic results (title, link, snippet) for a batch of queries, in rows shaped like the Custom Search JSON API's `items`.

Google closed the Custom Search JSON API to new customers and shuts it down on 1 January 2027. This Actor covers the common case: send queries, get back the organic results per page in `items` with the fields you already read (`title`, `link`, `displayLink`, `snippet`), one row per page instead of one API response. It is not Google's API. It reads google.com's public results page through Apify's Google SERP proxy, so the ranking is what a logged-out visitor sees on google.com. That is not guaranteed to match what your Custom Search engine returned, which could be tuned, restricted to your sites or ranked differently.

### What you get

One row per query and page:

```json
{
  "query": "rdap protocol",
  "page": 1,
  "start": 1,
  "searchUrl": "https://www.google.com/search?q=rdap+protocol",
  "items": [
    {
      "position": 1,
      "title": "Registration Data Access Protocol (RDAP)",
      "link": "https://www.icann.org/rdap",
      "displayLink": "www.icann.org",
      "snippet": "The Registration Data Access Protocol (RDAP) enables users to access current registration data..."
    }
  ],
  "hasNextPage": true,
  "reasonCode": "results"
}
```

Rows also carry `countryCode`, `languageCode`, `siteSearch`, `safeSearch`, `httpStatus`, `checkedAt` and `elapsedMs`. `position` counts across pages (11–20 on page 2). `snippet` can be empty when Google shows none. Only organic results are returned: no ads, maps, "People also ask", images or news boxes. A page usually holds 8–10 of them, because Google gives some slots to those boxes.

### Use it when

- You call Custom Search JSON API today and need the same `items` before it shuts down.
- You check where your pages rank for a list of keywords, per country.
- You collect candidate URLs for a lead list or a research crawl.
- You look for mentions on one site with `siteSearch`.

### Input

```json
{
  "queries": ["web scraping api", "\"exact phrase\" -excluded"],
  "pagesPerQuery": 1,
  "countryCode": "us",
  "languageCode": "en",
  "siteSearch": "example.com",
  "safeSearch": false
}
```

| Field | Custom Search equivalent | Notes |
| --- | --- | --- |
| `queries` | `q` | 1–1000 queries. Google operators work. A repeated query (the same text once outer spaces are trimmed and inner runs of spaces collapsed) is searched and charged once. Case is kept, because `OR` in capitals is an operator. |
| `pagesPerQuery` | `start` | 1–10 pages of 10 results. Page 2 is `start=11`. |
| `countryCode` | `gl` | Two letters, e.g. `us`, `de`. |
| `languageCode` | `hl` | e.g. `en`, `pt-BR`. |
| `siteSearch` | `siteSearch` | One domain; added to every query as `site:`. A value that is not a domain fails the run before anything is searched. |
| `safeSearch` | `safe=active` | Filters explicit results. |

Google ignores `num` above 10, so there is no page-size option.

### Pricing

**$0.005 per page of results** ($5 per 1,000 pages, what Custom Search JSON API charged per 1,000 queries). Paid Apify plans pay less: $0.0045 on Bronze, $0.004 from Silver up. Everything else is free.

| reasonCode | Meaning | Charged? |
| --- | --- | --- |
| `results` | Google returned organic results and every link was read. | yes |
| `no_results` | Google found nothing for the query, or the query has fewer pages than you asked for. | no |
| `unresolved_links` | Google returned results but some of their URLs could not be read; those `link`s are `null`. | no |
| `upstream_error` | Google or the proxy failed or refused the request, after one retry on a 5xx or a network error. | no |
| `invalid_response` | Google answered with a page that is not a results page (a CAPTCHA, a consent page, or a layout this Actor cannot read). | no |

No start fee. At your run's charge limit the Actor stops: pages already in progress may still arrive, uncharged, and pages it never started get no row.

### Limits

- Results come from a public web page, not an API. When Google changes that page, rows come back `invalid_response` (free) until the Actor is updated.
- Eight pages run at a time. A page can take a minute or more: Google often makes a result link wait before it reveals the URL, and this Actor sits out up to two such waits of up to 90 seconds each per link before giving up (that page is then a free `unresolved_links` row).
- Location comes from the proxy and `countryCode`, not from a city or coordinates.

# Changelog

This Actor's version history is a separate document: https://apify.com/pontio/google-search-results/changelog.md

# Actor input Schema

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

Up to 1000 search queries, exactly as you would type them into Google; operators such as "exact phrase", -exclude and OR work. A repeated query is searched and charged once.

## `pagesPerQuery` (type: `integer`):

Result pages per query, 10 results each (page 2 is Custom Search's start=11). Each page with results is one row and one charge; a page past the last one Google has is a free row.

## `countryCode` (type: `string`):

Two-letter country the results are localized for, sent to Google as gl (Custom Search's gl). Empty: Google's default.

## `languageCode` (type: `string`):

Interface language, sent to Google as hl (Custom Search's hl), e.g. en, de, pt-BR.

## `siteSearch` (type: `string`):

Only return results from this domain, e.g. example.com (Custom Search's siteSearch). Added to each query as site:.

## `safeSearch` (type: `boolean`):

Filter explicit results (Custom Search's safe=active).

## Actor input object example

```json
{
  "queries": [
    "web scraping api"
  ],
  "pagesPerQuery": 1,
  "safeSearch": false
}
```

# Actor output Schema

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

Results produced by this run, in its 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 = {
    "queries": [
        "web scraping api"
    ],
    "pagesPerQuery": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("pontio/google-search-results").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": ["web scraping api"],
    "pagesPerQuery": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("pontio/google-search-results").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": [
    "web scraping api"
  ],
  "pagesPerQuery": 1
}' |
apify call pontio/google-search-results --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,pontio/google-search-results"
        }
    }
}
```

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/LXhsWjsGFsJHhYiZd/builds/HpPWXOeJe53QWOpnj/openapi.json
