# Google Search Scraper (`anyxsolutions/google-search-scraper`) Actor

Scrapes Google search results by query, returning title, URL, snippet, position, and domain.

- **URL**: https://apify.com/anyxsolutions/google-search-scraper.md
- **Developed by:** [Anyx Solutions](https://apify.com/anyxsolutions) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.19 / 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

![banner](https://anyx-apify.fra1.cdn.digitaloceanspaces.com/banners/google-search-scraper.png)

## Google Search Scraper

**Turn Google searches into clean, structured JSON results.**

Give this scraper a list of search queries and it returns Google's organic results as structured data: title, URL, snippet, position, and domain. It follows pagination to collect as many results as you ask for, resolves Google's redirect links to the real destination, and can also capture the "People also ask" questions and "Related searches" shown alongside each query. It suits SERP tracking, market and competitor research, source discovery, and feeding search results into AI and data pipelines.

### ⚡ Quick start

```json
{
  "queries": ["openai funding round", "apple acquisition"],
  "maxItems": 10
}
```

### 🧩 Input

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `queries` | array | no\* | — | Search terms to look up. One entry per query. |
| `startUrls` | array | no | — | Google search URLs to scrape directly, e.g. `https://www.google.com/search?q=example`. Use instead of `queries` for full control of search parameters. |
| `maxItems` | integer | no | `10` | Maximum results per query. Additional pages are collected by pagination. |
| `maxPagesPerQuery` | integer | no | `5` | How many result pages to walk per query before stopping, even if `maxItems` is not reached. |
| `countryCode` | string | no | `us` | Two-letter country code localising results, e.g. `us`, `gb`. |
| `languageCode` | string | no | `en` | Two-letter interface language code, e.g. `en`. |
| `includeExpansions` | boolean | no | `true` | Also collect "People also ask" and "Related searches", saved to the key-value store under `SEARCH_EXPANSIONS`. |
| `proxyConfiguration` | object | no | `{"useApifyProxy":true,"apifyProxyGroups":["GOOGLE_SERP"]}` | Proxy settings. Google blocks ordinary traffic, so Apify's Google SERP proxy group is the default. |

\* Provide either `queries` or `startUrls`.

### 📤 Output

Each organic result becomes one dataset item, in Google's own ranking order recorded in `position`. Redirect links are resolved so `url` is always the real destination. Google's own links (Maps, Images, other searches) and duplicate sitelinks are filtered out. Fields a result does not provide are returned as `null` rather than omitted.

#### Fields

| Field | Type | Description |
|---|---|---|
| `query` | string | The search query that produced this result. |
| `url` | string | Destination URL, with any Google redirect resolved. |
| `title` | string | Result title. |
| `snippet` | string | Result description shown by Google. |
| `position` | number | Rank across all pages for this query, starting at 1. |
| `page` | number | Results page this result came from. |
| `displayedUrl` | string | Breadcrumb-style URL Google displays. `null` on rich results, where Google prints a byline instead. |
| `domain` | string | Domain of the destination URL, without `www.`. |
| `publishedAt` | string | Publication date as `YYYY-MM-DD`, read from the date Google prefixes the snippet with. `null` when Google shows none. |
| `searchEngine` | string | Always `google`. Lets results share a shape with other search scrapers. |
| `fetchedAt` | string | When the search was run, ISO 8601. |

<details><summary>Example output</summary>

```json
{
  "query": "openai funding round",
  "url": "https://openai.com/blog/funding",
  "title": "OpenAI raises new round",
  "snippet": "OpenAI has closed a large funding round to accelerate research toward AGI.",
  "position": 1,
  "page": 1,
  "displayedUrl": "https://openai.com › blog",
  "domain": "openai.com",
  "publishedAt": "2026-02-19",
  "searchEngine": "google",
  "fetchedAt": "2026-07-24T19:10:22.113Z"
}
```

</details>

#### Related searches and questions

When `includeExpansions` is on, each query's "People also ask" and "Related searches" are written to the run's key-value store under `SEARCH_EXPANSIONS`, keyed by query:

```json
{
  "openai funding round": {
    "peopleAlsoAsk": ["How much did OpenAI raise?", "Who invested in OpenAI?"],
    "relatedQueries": ["openai valuation", "openai investors list"]
  }
}
```

### 💡 Use cases

- Track how a brand, product, or competitor ranks on Google over time.
- Discover the sources and coverage for a company or topic, then fetch the pages behind them.
- Expand a research topic using the real "People also ask" and "Related searches" Google surfaces.
- Feed fresh, cited search results into AI and LLM pipelines.
- Compare Google rankings across countries and languages.

### ❓ FAQ

- **Do I need a proxy?** Yes. Google blocks ordinary datacenter and residential traffic, so this scraper runs through Apify's Google SERP proxy group by default. Turning the proxy off will block every request.
- **How many results can I get?** As many as you set in `maxItems`; the scraper paginates until it reaches that number, exhausts Google's results, or hits `maxPagesPerQuery`. A Google page holds around 8–10 organic results — rich blocks crowd out the rest — so more than that costs another page. Deep result pages are lower quality, as on Google itself.
- **Can I target a country or language?** Yes. Set `countryCode` and `languageCode` — they are passed to Google as `gl` and `hl`.
- **What happens if Google blocks a request or shows a captcha?** The scraper retires that session and retries on a fresh one. If every attempt is blocked it fails with a clear error rather than reporting zero results, so a block is never mistaken for "nothing found".
- **Why is `publishedAt` often null?** Google only shows a date for some results, mainly news and articles. For a reliable date, fetch the page itself.

### 🔗 More scrapers by Anyx

- [Bing Search Scraper](https://apify.com/anyxsolutions/bing-search-scraper)
- [Google AI Scraper](https://apify.com/anyxsolutions/google-ai-scraper)
- [Web Content Scraper](https://apify.com/anyxsolutions/web-content-scraper)
- [Similarweb Top Websites Scraper](https://apify.com/anyxsolutions/similarweb-top-websites-scraper)

### 🤝 Anyx Solutions

We build custom scrapers and data-extraction pipelines.

- Email: tantosthor@gmail.com

# Actor input Schema

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

Search terms to look up on Google, one entry per query, for example "openai funding round".

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

Optional Google search URLs to scrape directly, for example https://www.google.com/search?q=example. Use instead of Queries for full control of search parameters.

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

Maximum number of results to return per query. Results beyond the first page are collected by pagination.

## `maxPagesPerQuery` (type: `integer`):

How many result pages to walk per query before stopping, even if Maximum items has not been reached. Each page costs one Google SERP proxy request.

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

Two-letter country code that localises results, for example us or gb. Results also follow the location of your proxy.

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

Two-letter interface language code, for example en.

## `includeExpansions` (type: `boolean`):

Collect "People also ask" questions and "Related searches" for each query. These are saved to the key-value store under SEARCH\_EXPANSIONS.

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

Apify proxy settings. Google blocks datacenter and flagged residential IPs, so the Google SERP proxy group is used by default and is what makes this Actor work.

## Actor input object example

```json
{
  "queries": [
    "openai funding round",
    "apple acquisition"
  ],
  "maxItems": 10,
  "maxPagesPerQuery": 5,
  "countryCode": "us",
  "languageCode": "en",
  "includeExpansions": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "GOOGLE_SERP"
    ]
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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": [
        "openai funding round",
        "apple acquisition"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("anyxsolutions/google-search-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": [
        "openai funding round",
        "apple acquisition",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("anyxsolutions/google-search-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": [
    "openai funding round",
    "apple acquisition"
  ]
}' |
apify call anyxsolutions/google-search-scraper --silent --output-dataset

```

## MCP server setup

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