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

🔥 ~$0.05/1K results 🔥 Search Google and get structured results including web pages, images, and Knowledge Graph entities. Returns titles, URLs, snippets, and full metadata. Supports geo-targeting, language, date filtering, sorting, and auto-pagination up to 100 results.

- **URL**: https://apify.com/kaix/google-search-scraper.md
- **Developed by:** [Kai](https://apify.com/kaix) (community)
- **Categories:** SEO tools, E-commerce, Lead generation
- **Stats:** 61 total users, 20 monthly users, 95.1% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.04 / 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 Scraper

Get Google search results as structured JSON. Web results, image results, and Knowledge Graph entities with auto-pagination up to 100 results.

Unlike SERP scrapers that load Google in a browser and parse HTML, this queries Google's API directly. No browser, no CAPTCHAs, no breakage when Google redesigns their page. The trade-off: you get organic results, images, and Knowledge Graph only — no ads, People Also Ask, or AI overviews.

### Quick start

```json
{
  "query": "web scraping best practices"
}
````

Default: 10 results. Set `maxResults` up to 100:

```json
{
  "query": "web scraping best practices",
  "maxResults": 50
}
```

Image search:

```json
{
  "query": "Tokyo Tower",
  "searchType": "image",
  "maxResults": 30
}
```

Geo-targeted (search as if from Japan, in Japanese):

```json
{
  "query": "best restaurants",
  "gl": "jp",
  "hl": "ja"
}
```

Sort by date or restrict to a date range:

```json
{
  "query": "climate change policy",
  "sort": "date:r:20250101:20250601"
}
```

### Input

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| **query** | string | required | Google search query. Supports operators: `"exact phrase"`, `-exclude`, `site:example.com`, `filetype:pdf` |
| maxResults | integer | 10 | Max results (1–100) |
| gl | string | — | Country code for geo-targeting (`us`, `vn`, `jp`) |
| hl | string | — | Interface language (`en`, `vi`, `ja`) |
| sort | string | — | Sort expression (see below) |
| searchType | string | `web` | `web` or `image` |
| knowledgeGraphLimit | integer | 5 | Max Knowledge Graph entities. 0 to disable |
| proxyConfiguration | object | Apify proxy | Proxy settings |

#### Sort options

The `sort` parameter accepts expressions that control result ordering.

**Sort by date:**

| Value | Description |
|-------|-------------|
| `date` | Newest first |
| `date:a` | Oldest first |

**Bias by date** (promotes recent/old results without excluding undated pages):

| Value | Description |
|-------|-------------|
| `date:d:s` | Strong bias toward recent |
| `date:d:w` | Weak bias toward recent |
| `date:a:s` | Strong bias toward older |

**Restrict to date range** (format `YYYYMMDD`):

| Value | Description |
|-------|-------------|
| `date:r:20250101:20250601` | Jan–Jun 2025 only |
| `date:r:20250101:` | From Jan 2025 onward |
| `date:r::20250101` | Before Jan 2025 |

**Sort by structured data** (when pages have [PageMaps](https://developers.google.com/custom-search/docs/structured_search)):

| Value | Description |
|-------|-------------|
| `review-rating:d` | By rating, descending |
| `review-rating:d:s` | Bias toward high ratings |
| `review-rating:d:s,review-date:d:w` | High rating + recent |
| `review-rating,review-rating:r:3.0:` | By rating, minimum 3.0 |

### Output

Each search result is one row in the dataset.

**Web search:**

```json
{
  "title": "My ultimate guide to web scraping : r/datascience - Reddit",
  "link": "https://www.reddit.com/r/datascience/comments/a116l5/my_ultimate_guide_to_web_scraping/",
  "displayLink": "www.reddit.com",
  "snippet": "Nov 28, 2018 ... Excellent tutorial. I particularly like saving the html files in case something goes wrong with the scraping. This is also a good idea ...",
  "pagemap": {
    "metatags": [
      {
        "og:image": "https://share.redd.it/preview/post/a116l5",
        "og:type": "website",
        "og:site_name": "Reddit",
        "og:title": "r/datascience on Reddit: My ultimate guide to web scraping",
        "og:description": "Posted by u/brendanmartin - 197 votes and 26 comments"
      }
    ]
  },
  "html": {
    "title": "My ultimate guide to <b>web scraping</b> : r/datascience - Reddit",
    "snippet": "Nov 28, 2018 <b>...</b> Excellent tutorial. I particularly like saving the html files in case something goes wrong with the <b>scraping</b>. This is also a <b>good</b> idea&nbsp;..."
  }
}
```

**Image search** adds `image`, `mime`, and `fileFormat`:

```json
{
  "title": "Tokyo Tower - Wikipedia",
  "link": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Tokyo_Tower_2023.jpg/960px-Tokyo_Tower_2023.jpg",
  "displayLink": "en.wikipedia.org",
  "snippet": "Tokyo Tower - Wikipedia",
  "mime": "image/jpeg",
  "fileFormat": "image/jpeg",
  "image": {
    "contextLink": "https://en.wikipedia.org/wiki/Tokyo_Tower",
    "height": 1280,
    "width": 960,
    "byteSize": 381361,
    "thumbnailLink": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTmKU8xLi6M5YTijS2AVf-81zQJrZZXE4sK7MxOXBnwzgXoPUn5cbZ22no&s",
    "thumbnailHeight": 150,
    "thumbnailWidth": 113
  },
  "html": {
    "title": "<b>Tokyo Tower</b> - Wikipedia",
    "snippet": "<b>Tokyo Tower</b> - Wikipedia"
  }
}
```

The `html` fields contain the same title/snippet with bold tags around matching keywords.

#### Key-value store

**`SEARCH_INFO`** stores search metadata on the first page:

```json
{
  "searchInformation": {
    "searchTime": 0.680919,
    "formattedSearchTime": "0.68",
    "totalResults": "17800000",
    "formattedTotalResults": "17,800,000"
  },
  "spelling": null,
  "promotions": null,
  "context": { "title": "..." },
  "queries": {
    "request": [
      {
        "title": "Google Custom Search - web scraping best practices",
        "totalResults": "17800000",
        "searchTerms": "web scraping best practices",
        "count": 10,
        "startIndex": 1
      }
    ],
    "nextPage": [
      {
        "totalResults": "17800000",
        "searchTerms": "web scraping best practices",
        "count": 10,
        "startIndex": 11
      }
    ]
  },
  "searchParameters": {
    "query": "web scraping best practices",
    "gl": null,
    "hl": null,
    "sort": null,
    "searchType": "web"
  }
}
```

**`KNOWLEDGE_GRAPH`** stores entities matching your query:

```json
{
  "@type": "ItemList",
  "itemListElement": [
    {
      "resultScore": 6953.152832,
      "@type": "EntitySearchResult",
      "result": {
        "url": "http://www.tokyotower.co.jp/english/",
        "name": "Tokyo Tower",
        "description": "Tower in Minato, Japan",
        "@type": ["Place", "Thing", "CivicStructure", "TouristAttraction", "Organization"],
        "@id": "kg:/m/0132_x",
        "detailedDescription": {
          "url": "https://en.wikipedia.org/wiki/Tokyo_Tower",
          "articleBody": "Tokyo Tower, a.k.a. Japan Radio Tower is a communications and observation tower in the district of Shiba-koen in Minato, Tokyo, Japan, completed in 1958. At 332.9 metres, it was the tallest tower in Japan until the construction of Tokyo Skytree in 2012."
        }
      }
    }
  ]
}
```

### Limitations

- 100 results max per query, 10 per page
- Results may vary by proxy region even with `gl` set
- Not all queries return Knowledge Graph entities
- `sort` uses Google's date format (`YYYYMMDD`), not ISO dates
- No ads, People Also Ask, or AI overviews (use a SERP scraper for those)

# Actor input Schema

## `query` (type: `string`):

Google search query. Supports operators: "exact phrase", -exclude, site:example.com, filetype:pdf, etc.

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

Maximum number of search results to return. The API supports up to 100 results (10 pages of 10).

## `gl` (type: `string`):

Country code for geo-targeting results (e.g. "us", "vn", "jp"). Uses Google's country codes.

## `hl` (type: `string`):

Interface language code (e.g. "en", "vi", "ja"). Affects result language bias.

## `sort` (type: `string`):

Sort expression. Examples: "date" (newest first), "date:a" (oldest first), "date:d:s" (strong bias toward recent). Date range: "date:r:20250101:20250601" (Jan-Jun 2025, format YYYYMMDD).

## `searchType` (type: `string`):

Type of search results. "web" returns web pages, "image" returns images with URLs, dimensions, and thumbnails.

## `knowledgeGraphLimit` (type: `integer`):

Maximum number of Knowledge Graph entities to return. Set to 0 to disable.

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

Select proxies to be used.

## Actor input object example

```json
{
  "query": "web scraping best practices",
  "maxResults": 10,
  "searchType": "web",
  "knowledgeGraphLimit": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "query": "web scraping best practices",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kaix/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 = {
    "query": "web scraping best practices",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("kaix/google-search-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 '{
  "query": "web scraping best practices",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call kaix/google-search-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Fast Search Scraper",
        "description": "🔥 ~$0.05/1K results 🔥 Search Google and get structured results including web pages, images, and Knowledge Graph entities. Returns titles, URLs, snippets, and full metadata. Supports geo-targeting, language, date filtering, sorting, and auto-pagination up to 100 results.",
        "version": "0.0",
        "x-build-id": "bC1VshsozQaS7f2Hx"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/kaix~google-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-kaix-google-search-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/kaix~google-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-kaix-google-search-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/kaix~google-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-kaix-google-search-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",
                "required": [
                    "query"
                ],
                "properties": {
                    "query": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Google search query. Supports operators: \"exact phrase\", -exclude, site:example.com, filetype:pdf, etc."
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum number of search results to return. The API supports up to 100 results (10 pages of 10).",
                        "default": 10
                    },
                    "gl": {
                        "title": "Country (gl)",
                        "type": "string",
                        "description": "Country code for geo-targeting results (e.g. \"us\", \"vn\", \"jp\"). Uses Google's country codes."
                    },
                    "hl": {
                        "title": "Language (hl)",
                        "type": "string",
                        "description": "Interface language code (e.g. \"en\", \"vi\", \"ja\"). Affects result language bias."
                    },
                    "sort": {
                        "title": "Sort",
                        "type": "string",
                        "description": "Sort expression. Examples: \"date\" (newest first), \"date:a\" (oldest first), \"date:d:s\" (strong bias toward recent). Date range: \"date:r:20250101:20250601\" (Jan-Jun 2025, format YYYYMMDD)."
                    },
                    "searchType": {
                        "title": "Search Type",
                        "enum": [
                            "web",
                            "image"
                        ],
                        "type": "string",
                        "description": "Type of search results. \"web\" returns web pages, \"image\" returns images with URLs, dimensions, and thumbnails.",
                        "default": "web"
                    },
                    "knowledgeGraphLimit": {
                        "title": "Knowledge Graph Limit",
                        "minimum": 0,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of Knowledge Graph entities to return. Set to 0 to disable.",
                        "default": 5
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Select proxies to be used.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
