# Google Search Results Scraper (`kawsar/google-search-results-scraper`) Actor

Google Search Results Scraper that extracts titles, URLs, snippets, and positions for any keyword, so you can automate SEO research, rank tracking, and competitive analysis without manual searching.

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

## Pricing

from $2.00 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Google Search Results Scraper

![Google Search Results Scraper](https://i.imgur.com/oP0U8mK.png)

Scrape Google search results for any keyword and get back structured data: title, URL, snippet, display URL, position, and total result count per result. Give it a list of keywords and it runs each one through Google Search.

Works for SEO research, rank tracking, competitor analysis, content research, and building datasets. Run one keyword or a hundred at once.

### What it does

- Runs each keyword through Google and returns the organic results
- Captures position, title, URL, display URL, and snippet for each result
- Optionally includes paid ad results alongside organic ones
- Records Google's estimated total result count per keyword
- If one keyword errors out, the run continues with the rest

### Input

| Field | Type | Description | Default |
|---|---|---|---|
| `keywords` | List of strings | Search keywords to run | — |
| `maxResultsPerKeyword` | Integer | Max results per keyword | 10 |
| `includeAds` | Boolean | Include paid ad results | false |
| `maxItems` | Integer | Total result cap across all keywords | 100 |
| `requestTimeoutSecs` | Integer | Per-request timeout in seconds | 30 |

#### Example input

Plain keyword search:

```json
{
    "keywords": ["apify", "web scraping tools", "python automation"],
    "maxResultsPerKeyword": 10,
    "includeAds": false,
    "maxItems": 100,
    "requestTimeoutSecs": 30
}
````

With Google Search operators:

```json
{
    "keywords": [
        "site:github.com apify scraper",
        "\"web scraping\" python -selenium",
        "intitle:\"data extraction\" filetype:pdf",
        "related:apify.com",
        "inurl:scraper python after:2023-01-01",
        "\"best scraping tools\" OR \"top web scrapers\" 2024",
        "(playwright OR puppeteer) site:medium.com"
    ],
    "maxResultsPerKeyword": 10,
    "maxItems": 200
}
```

SEO research with operators:

```json
{
    "keywords": [
        "site:competitor.com",
        "intitle:\"buy shoes online\" -amazon -ebay",
        "allintitle:python web scraping tutorial",
        "\"price list\" filetype:pdf shoes",
        "shoes after:2024-01-01 before:2024-12-31"
    ],
    "maxResultsPerKeyword": 20,
    "maxItems": 500
}
```

### Output

Each result is a flat record. Example:

```json
{
    "keyword": "apify",
    "position": 1,
    "resultTitle": "Apify: Full-stack web scraping and data extraction platform",
    "url": "https://apify.com/",
    "displayUrl": "https://apify.com",
    "snippet": "Cloud platform for web scraping, browser automation, AI agents, and data for AI. Use 25000+ ready-made tools, code templates, and proxies.",
    "resultType": "organic",
    "totalResults": "About 645,000 results",
    "searchUrl": "https://www.google.com/search?q=apify&hl=en&gl=US&num=100",
    "scrapedAt": "2026-04-19T10:30:00.000000+00:00",
    "errorMessage": null
}
```

#### Output fields

| Field | Description |
|---|---|
| `keyword` | The keyword that produced this result |
| `position` | Rank position (1 = top result) |
| `resultTitle` | Page title from the search result |
| `url` | Destination URL |
| `displayUrl` | Shortened URL shown in the result listing |
| `snippet` | Description text from the result card |
| `resultType` | `organic` or `ad` |
| `totalResults` | Google's estimated total result count |
| `searchUrl` | Full Google search URL used |
| `scrapedAt` | ISO 8601 timestamp |
| `errorMessage` | Null on success; generic message on failure |

### Google Search operators

Every keyword you pass goes directly into a Google Search query, so all standard Google Search operators work out of the box. Mix them freely with regular keywords.

#### Reliable operators

| Operator | What it does | Example |
|---|---|---|
| `" "` | Match an exact word or phrase | `"steve jobs"` |
| `OR` | Results related to X or Y | `jobs OR gates` |
| `\|` | Same as OR | `jobs \| gates` |
| `AND` | Results related to X and Y | `jobs AND gates` |
| `-` | Exclude a word or phrase | `jobs -apple` |
| `*` | Wildcard matching any word | `steve * apple` |
| `( )` | Group multiple terms | `(ipad OR iphone) apple` |
| `define:` | Definition of a word | `define:entrepreneur` |
| `cache:` | Most recent cached version of a page | `cache:apple.com` |
| `filetype:` | Search for specific file types | `apple filetype:pdf` |
| `ext:` | Same as filetype | `apple ext:pdf` |
| `site:` | Results from a specific website | `site:apple.com` |
| `related:` | Sites related to a domain | `related:apple.com` |
| `intitle:` | Pages with a word in the title | `intitle:apple` |
| `allintitle:` | Pages with multiple words in the title | `allintitle:apple iphone` |
| `inurl:` | Pages with a word in the URL | `inurl:apple` |
| `allinurl:` | Pages with multiple words in the URL | `allinurl:apple iphone` |
| `intext:` | Pages containing a word in body text | `intext:apple iphone` |
| `allintext:` | Pages containing multiple words in body text | `allintext:apple iphone` |
| `weather:` | Weather for a location | `weather:san francisco` |
| `stocks:` | Stock information for a ticker | `stocks:aapl` |
| `map:` | Force map results | `map:silicon valley` |
| `movie:` | Information about a movie | `movie:steve jobs` |
| `in` | Unit conversion | `$329 in GBP` |
| `source:` | Results from a specific source in Google News | `apple source:the_verge` |
| `before:` | Results published before a date | `apple before:2007-06-29` |
| `after:` | Results published after a date | `apple after:2007-06-29` |

#### Unreliable operators

These operators are documented by Google but may not work consistently:

| Operator | What it does | Example |
|---|---|---|
| `#..#` | Search within a number range | `iphone case $50..$60` |
| `inanchor:` | Pages with specific anchor text in backlinks | `inanchor:apple` |
| `allinanchor:` | Pages with multiple anchor text words | `allinanchor:apple iphone` |
| `AROUND(X)` | Two terms within X words of each other | `apple AROUND(4) iphone` |
| `loc:` | Results from a geographic area | `loc:"san francisco" apple` |
| `location:` | News from a location (Google News) | `location:"san francisco" apple` |
| `daterange:` | Results within a Julian date range | `daterange:11278-13278` |

> Operators can be combined freely. For example: `site:github.com "web scraper" python after:2023-01-01` runs as a single keyword and returns matching results.

### What people use it for

SEO teams use it to monitor where pages rank for target keywords. Content researchers use it to see what topics and domains dominate a search. Developers use it to build labeled datasets for training and evaluation. It also works for competitive analysis: run your competitor's brand name and see what shows up.

The `includeAds` option is useful if you are doing paid search research and want to see which advertisers are bidding on a keyword.

### Notes

- Results are from the Google US English index (`hl=en&gl=US`)
- Google sometimes returns fewer results than the max you request, especially for niche keywords
- When a keyword fails, the actor saves a row with `errorMessage` set and continues to the next keyword
- `maxItems` is a total cap across all keywords combined, not per keyword

### Legal

Intended for research, analytics, and educational use. Make sure your use case follows Google's Terms of Service and the laws in your jurisdiction.

***

[![Try Google Search Results Scraper](https://i.imgur.com/tOH2s9h.png)](https://apify.com/kawsarlog/google-search-results-scraper-20260419)

# Actor input Schema

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

List of search keywords to scrape. Each keyword runs a separate Google search.

## `maxResultsPerKeyword` (type: `integer`):

Maximum number of organic search results to extract per keyword.

## `includeAds` (type: `boolean`):

When enabled, paid ad results are included alongside organic results.

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

Maximum total number of results to save across all keywords.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

## Actor input object example

```json
{
  "keywords": [
    "apify",
    "web scraping tools",
    "python automation"
  ],
  "maxResultsPerKeyword": 10,
  "includeAds": false,
  "maxItems": 100,
  "requestTimeoutSecs": 30
}
```

# 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": [
        "apify"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kawsar/google-search-results-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": ["apify"] }

# Run the Actor and wait for it to finish
run = client.actor("kawsar/google-search-results-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "apify"
  ]
}' |
apify call kawsar/google-search-results-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=kawsar/google-search-results-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Search Results Scraper",
        "description": "Google Search Results Scraper that extracts titles, URLs, snippets, and positions for any keyword, so you can automate SEO research, rank tracking, and competitive analysis without manual searching.",
        "version": "0.0",
        "x-build-id": "kiAZavaAIF6qvapTQ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/kawsar~google-search-results-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-kawsar-google-search-results-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/kawsar~google-search-results-scraper/runs": {
            "post": {
                "operationId": "runs-sync-kawsar-google-search-results-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/kawsar~google-search-results-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-kawsar-google-search-results-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "keywords": {
                        "title": "Keywords",
                        "type": "array",
                        "description": "List of search keywords to scrape. Each keyword runs a separate Google search.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResultsPerKeyword": {
                        "title": "Max results per keyword",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum number of organic search results to extract per keyword.",
                        "default": 10
                    },
                    "includeAds": {
                        "title": "Include ads",
                        "type": "boolean",
                        "description": "When enabled, paid ad results are included alongside organic results.",
                        "default": false
                    },
                    "maxItems": {
                        "title": "Max items total",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum total number of results to save across all keywords.",
                        "default": 100
                    },
                    "requestTimeoutSecs": {
                        "title": "Request timeout (seconds)",
                        "minimum": 5,
                        "maximum": 120,
                        "type": "integer",
                        "description": "Per-request timeout in seconds.",
                        "default": 30
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
