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

Google Search SERP Scraper: Extract organic search rankings, featured snippets, People Also Ask (PAA) questions, Knowledge Graph entities, sitelinks, and related search queries across all locations and languages. Engineered for enterprise SEO monitoring, rank tracking, and competitive intelligence.

- **URL**: https://apify.com/khnaami/actor-google-search-scraper.md
- **Developed by:** [khalid naami](https://apify.com/khnaami) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Ultimate Scraper (Organic SERP, PAA, Snippets & Ranking)

Extract live Google Search engine results pages (SERP) at scale. Scrape organic listings, Featured Snippets, People Also Ask (PAA) questions, Related Searches, and rich search metadata across any country, language, or geolocation.

***

### 🌟 Key Features

- ⚡ **High Performance & Stealth**: Uses specialized request fingerprinting to bypass bot detection without needing heavy headless browsers for standard queries.
- 🌍 **Localized Search**: Specify any Country Code (`gl`) and Language (`hl`) to extract true localized SERP results.
- 🎯 **Featured Snippets**: Captures position-zero answers, lists, and summary cards.
- ❓ **People Also Ask (PAA)**: Extracts relevant user questions and expanding SERP queries for SEO ideation.
- 🔗 **Rich Organic Details**: Retrieves title, URL, display domain, snippet description, rank position, page number, and site links.
- 🔎 **Related Searches**: Extracts bottom-of-page search term clusters.
- ⏱️ **Time Filters**: Filter results by past hour (`qdr:h`), past 24 hours (`qdr:d`), past week (`qdr:w`), past month (`qdr:m`), or past year (`qdr:y`).
- 🛡️ **Apify Proxy Ready**: Native support for residential and datacenter proxies.

***

### 📥 Input Configuration

| Field | Type | Default | Description |
|---|---|---|---|
| `queries` | Array | `["Apify web scraping"]` | List of search queries or keywords to scrape. |
| `countryCode` | String | `"us"` | Two-letter country code for regional results (e.g. `us`, `gb`, `de`, `fr`, `sa`). |
| `languageCode` | String | `"en"` | Language code for search interface & results (e.g. `en`, `ar`, `es`, `fr`, `de`). |
| `maxResults` | Integer | `100` | Maximum organic search results to extract per query. |
| `resultsPerPage` | Integer | `10` | Results per page (`10` to `100`). |
| `extractPaa` | Boolean | `true` | Extract "People Also Ask" questions and snippets. |
| `extractRelated` | Boolean | `true` | Extract related searches at the bottom of the SERP. |
| `timeFilter` | String | `""` | Optional time filter (e.g., `qdr:d` for last 24h, `qdr:m` for past month). |
| `proxyConfiguration` | Object | `{ "useApifyProxy": true }` | Proxy configuration settings. |

***

### 📤 Output Data Format

Each dataset record represents an individual organic result or SERP item:

```json
{
  "searchQuery": "best hotel in paris",
  "searchUrl": "https://www.google.com/search?q=best+hotel+in+paris&gl=us&hl=en",
  "countryCode": "us",
  "languageCode": "en",
  "resultType": "organic",
  "position": 1,
  "page": 1,
  "title": "The 10 Best Hotels in Paris - Top Places to Stay",
  "url": "https://example.com/paris-hotels",
  "domain": "example.com",
  "snippet": "Discover the finest luxury hotels in Paris with stunning Eiffel Tower views...",
  "sitelinks": [
    {
      "title": "Boutique Hotels",
      "url": "https://example.com/paris-hotels/boutique"
    }
  ],
  "featuredSnippet": null,
  "scrapedAt": "2026-11-09T13:30:00.000Z"
}
```

***

### 💡 Use Cases

1. **SEO & Rank Tracking**: Monitor organic positioning of your website and competitors over time.
2. **Content Strategy & Keyword Discovery**: Leverage "People Also Ask" and "Related Searches" to discover buyer intent and trending queries.
3. **Brand Monitoring & Reputation Management**: Track brand mentions and PR announcements across different geolocations.
4. **Market Intelligence**: Uncover top-ranking domains and niche players in any sector.

***

### ⚖️ License

Apache-2.0

# Actor input Schema

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

Keywords or search phrases to query on Google (supports search operators like site:, intitle:, filetype:).

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

Two-letter country code for geo-targeted search results (e.g. 'us', 'gb', 'fr', 'de', 'ae', 'sa', 'ca', 'au').

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

Two-letter language code for search results (e.g. 'en', 'ar', 'fr', 'de', 'es').

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

Maximum number of organic search results to extract per keyword.

## `resultsPerPage` (type: `integer`):

Number of results requested per page from Google (10 recommended; Google ignores larger num values on many regions).

## `extractPaa` (type: `boolean`):

If enabled, extracts questions and answers from Google's 'People Also Ask' interactive box.

## `extractRelated` (type: `boolean`):

If enabled, extracts related search query suggestions at the bottom of the SERP.

## `timeFilter` (type: `string`):

Filter results by publication date/freshness.

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

Apify Proxy configuration. Select GOOGLE_SERP, UNBLOCKER, or RESIDENTIAL (default Datacenter IPs are commonly challenged by Google Search).

## Actor input object example

```json
{
  "queries": [
    "artificial intelligence agents",
    "best travel backpacks"
  ],
  "countryCode": "us",
  "languageCode": "en",
  "maxResults": 50,
  "resultsPerPage": 10,
  "extractPaa": true,
  "extractRelated": true,
  "timeFilter": "all",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "GOOGLE_SERP"
    ]
  }
}
```

# Actor output Schema

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

Scraped Google SERP records (Organic results, Featured snippets, PAA questions, Related searches)

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

High-level summary report and execution metrics stored in Key-Value store

# 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 agents",
        "best travel backpacks"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "GOOGLE_SERP"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("khnaami/actor-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": [
        "artificial intelligence agents",
        "best travel backpacks",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["GOOGLE_SERP"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("khnaami/actor-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": [
    "artificial intelligence agents",
    "best travel backpacks"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "GOOGLE_SERP"
    ]
  }
}' |
apify call khnaami/actor-google-search-scraper --silent --output-dataset

```

## MCP server setup

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