# Google Related Searches Scraper (`scrapeai/google-related-searches-actor`) Actor

Extracts related search terms from the bottom of Google SERP pages

- **URL**: https://apify.com/scrapeai/google-related-searches-actor.md
- **Developed by:** [ScrapeAI](https://apify.com/scrapeai) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Related Searches Scraper

Collects live query links from Google's native related-search modules. HTTP extraction runs first; an optional browser fallback reads the same public result page. Queries are processed with concurrency two and output has one global limit.

### Input

Supply `queries` (an array) or `query`, `language` (default en), `country` (default us) and `maxResults` (default 100, maximum 10000). The sample requests ten terms across javascript tutorial, python tutorial and typescript tutorial. A single Google module often contains fewer than ten terms. Results are never padded.

Use `proxyConfiguration` for HTTP requests. The sample uses GOOGLE_SERP. `browserFallback` defaults true; its optional `browserProxyConfiguration` defaults to residential. Custom proxies are supported. Search availability and proxy use can incur platform charges.

### Output and provenance

Each row contains `id` (derived seed plus term), `seedQuery`, `relatedSearch`, source `rank`, actual search `url`, visible `linkText`, `sourceModule` and optional `heading`. Metadata records the requested source URL, provider, extraction method and retrieval time. Unknown fields are omitted. Rank is within the observed module, not an organic ranking.

Only the native #bres container or a module with an exact Related searches / People also search for heading is accepted. Heading fallback currently recognizes English. Autocomplete, People also ask and AI Overview notices are excluded. The actual HTML is retained in run key-value storage for source review. No CAPTCHA solving or authenticated-session reuse is performed.

### Limits and verification

The ten-record local sample used English US tutorial queries and real #bres links. Other languages and query combinations depend on Google's layout and availability. Duplicate terms within a seed are removed; the same term under a different seed retains separate provenance. A blocked or unavailable query is reported in RUN_SUMMARY. A run with no genuine terms fails explicitly; partial results remain partial.

### Run

Use `apify run --input-file input.json` locally. Export the default Dataset after a successful run; inspect RUN_SUMMARY for query errors and requested versus actual counts.

# Changelog

This Actor's version history is a separate document: https://apify.com/scrapeai/google-related-searches-actor/changelog.md

# Actor input Schema

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

Search queries. Supply multiple queries when one native module contains fewer terms than maxResults.

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

Language code for search results (e.g. en, de, fr)

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

Country code for Google search (e.g. us, uk, de)

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

HTTP search proxy. GOOGLE_SERP is supported. The optional browser fallback uses a separate residential configuration.

## `maxResults` (type: `integer`):

Global maximum across all queries; source availability can yield fewer terms.

## `browserFallback` (type: `boolean`):

Try a public browser search when HTTP results have no native related-search module.

## `browserProxyConfiguration` (type: `object`):

Optional browser-compatible proxy. Defaults to residential when browser fallback is enabled.

## Actor input object example

```json
{
  "queries": [
    "SEO tips"
  ],
  "language": "en",
  "country": "us",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "GOOGLE_SERP"
    ]
  },
  "maxResults": 100,
  "browserFallback": true
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing live actor results.

# 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": [
        "SEO tips"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "GOOGLE_SERP"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapeai/google-related-searches-actor").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": ["SEO tips"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["GOOGLE_SERP"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapeai/google-related-searches-actor").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": [
    "SEO tips"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "GOOGLE_SERP"
    ]
  }
}' |
apify call scrapeai/google-related-searches-actor --silent --output-dataset

```

## MCP server setup

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

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/nnVkpRewfe0UNIoVQ/builds/RbAmE2aELahIa53IC/openapi.json
