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

Scrape Google search results with customizable parameters including language, region, and SafeSearch settings. Results include URL, title, and description for each search result.

- **URL**: https://apify.com/mina_safwat/google-search-scraper.md
- **Developed by:** [Mina](https://apify.com/mina_safwat) (community)
- **Categories:** Developer tools, Automation, SEO tools
- **Features:** Limited permissions
- **Stats:** 84 total users, 0 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: 3.00 out of 5 stars

## Pricing

from $3.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/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 Search Scraper

An [Apify](https://apify.com) actor for scraping Google search results with customizable parameters. The actor extracts URLs, titles, and descriptions from Google search results pages.

### Features

- Scrape Google search results based on your search terms
- Customize the number of results to retrieve
- Set language and region preferences
- Enable or disable Google's SafeSearch
- Filter out duplicate URLs
- Uses Apify's Google SERP proxy, so no CAPTCHAs or blocked pages to deal with
- Resolves Google's `/goto` redirect links to the real destination URL
- **Real-time processing**: Results are pushed to the dataset as they are found, without waiting for all results to be collected

### Input Parameters

The actor accepts the following input parameters:

| Parameter | Type | Description |
|-----------|------|-------------|
| `searchTerm` | String | **Required**. The search query to look for on Google. |
| `numResults` | Integer | Number of search results to retrieve. Default is 10. |
| `lang` | String | Language code for the search results (e.g., 'en', 'es', 'fr'). Default is 'en'. |
| `safe` | String | SafeSearch setting: 'active' or 'off'. Default is 'active'. |
| `region` | String | Region code for the search results (e.g., 'us', 'uk', 'de'). |
| `start` | Integer | Starting index for the search results. Default is 0. |
| `unique` | Boolean | Whether to filter out duplicate URLs. Default is true. |

### Output

The actor stores its results in the default dataset, with each item having the following structure:

```json
{
  "url": "https://example.com",
  "title": "Example Title of the Search Result",
  "description": "A snippet or description of the search result as shown by Google..."
}
```

### Usage Examples

#### Basic Example

```json
{
  "searchTerm": "apify web scraping"
}
```

#### Advanced Example

```json
{
  "searchTerm": "machine learning tutorials",
  "numResults": 50,
  "lang": "en",
  "safe": "active",
  "region": "us",
  "start": 0,
  "unique": true
}
```

### Proxy Usage

The actor fetches every results page through Apify's [Google SERP proxy](https://docs.apify.com/proxy/google-serp-proxy). If that proxy is unavailable on your account, the run fails immediately instead of returning blocked pages.

### Limitations

- Google may detect and block automated scraping attempts. The actor implements measures to minimize this risk, but successful operation cannot be guaranteed in all cases.
- The structure of Google's search results page may change over time, which could affect the actor's ability to extract data correctly.
- Google returns at most about 10 organic results per page, so a request for 100 results usually yields 80-95 after duplicates are removed.
- If Google returns no results, no row is added to the dataset; the search term and the reason are listed in the `FAILED_INPUTS` record of the run's key-value store instead. If Google does not return the page at all, the run fails and writes the same record.

### SEO Keywords

google search scraper, scrape google search results, google serp api, google serp scraper, google organic results scraper, keyword rank tracking, seo rank checker, google search results api, bulk serp scraping, scrape google without an api key, google search data export, search engine results extraction

# Actor input Schema

## `searchTerm` (type: `string`):

The search query you want to search for on Google.

## `numResults` (type: `integer`):

The number of search results to retrieve. Default is 10.

## `lang` (type: `string`):

The language code for the search results. Default is 'en' for English.

## `safe` (type: `string`):

Enable or disable Google's SafeSearch feature.

## `region` (type: `string`):

The region code for the search results (e.g., 'us' for United States).

## `start` (type: `integer`):

The starting index for the search results. Default is 0.

## `unique` (type: `boolean`):

Whether to filter out duplicate URLs from the search results. Default is true.

## Actor input object example

```json
{
  "searchTerm": "apify scraping",
  "numResults": 10,
  "lang": "en",
  "safe": "active",
  "start": 0,
  "unique": true
}
```

# Actor output Schema

## `search-results` (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 = {
    "searchTerm": "apify scraping",
    "lang": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("mina_safwat/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 = {
    "searchTerm": "apify scraping",
    "lang": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("mina_safwat/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 '{
  "searchTerm": "apify scraping",
  "lang": "en"
}' |
apify call mina_safwat/google-search-scraper --silent --output-dataset

```

## MCP server setup

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