# Google Search Result Intelligence (`qaseemiqbal/google-search-result-intelligence`) Actor

Collect Google Search results for keywords and turn them into clean datasets with rankings, titles, URLs, domains, ads, People Also Ask, related searches, AI Overview data, and optional domain-level leads.

- **URL**: https://apify.com/qaseemiqbal/google-search-result-intelligence.md
- **Developed by:** [Muhammad Qaseem Iqbal](https://apify.com/qaseemiqbal) (community)
- **Categories:** SEO tools, AI, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 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/platform/actors/running/actors-in-store#pay-per-usage

## 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 Result Intelligence

Google Search Result Intelligence helps you collect Google Search results for one or many keywords and turn them into a clean dataset you can download, analyze, or send to other tools.

Use it to see who ranks on Google, what titles and descriptions appear, which domains show up most often, whether ads or shopping results are present, and how your brand or competitors appear in search results over time.

In plain terms: enter search queries, choose the country, language, and device, start the Actor, and get structured Google Search data back.

### What can Google Search Result Intelligence do?

This Actor collects information from Google search results pages, often called SERPs. A SERP is simply the page Google shows after someone searches for something.

You can use it to collect:

| Data type | What you get |
| --- | --- |
| Organic results | Ranking position, title, URL, domain, displayed URL, and description |
| Paid results | Sponsored text ads when they are present and enabled |
| Product ads | Shopping or product-style results when they are present and enabled |
| People Also Ask | Questions and visible answers from Google's question boxes |
| Related searches | Related search queries shown by Google |
| Google AI Overview | AI Overview text and sources when Google shows it on the results page |
| Domain records | Optional domain-level lead records from discovered result websites |
| Custom fields | Optional custom data extracted with your own JavaScript function |
| Evidence files | Optional saved HTML or screenshots for checking and debugging results |

The exact output depends on what Google shows for your query, country, language, location, and device. Some searches have ads, AI Overviews, or People Also Ask results, while others do not.

### Popular use cases

- Track where your website ranks for important keywords
- Monitor competitors in organic and paid search results
- Collect URLs for content research or market research
- Check how search results differ by country, language, or device
- Find domains that repeatedly appear for a topic
- Watch whether your brand, product, or competitors appear in Google AI Overview
- Research ad copy, landing pages, and shopping results
- Build simple lead lists from domains found in search results
- Export search data to Google Sheets, Excel, BI tools, databases, or internal workflows

### How to use this Actor

1. Open Google Search Result Intelligence on Apify.
2. Enter one or more search queries, one query per line.
3. Choose your country, language, Google domain, and device.
4. Select the result types you want, such as organic results, ads, product ads, People Also Ask, related searches, or AI Overview.
5. Click Start and wait for the run to finish.
6. Download the results as JSON, CSV, Excel, XML, or HTML from the Apify dataset.

You can also run the Actor with the Apify API, schedule it, connect it to webhooks, or send results to integrations such as Google Sheets, Make, Zapier, Slack, Airbyte, and more.

### Quick start input

For a low-cost first run, start with one or two keywords and one page of results:

```json
{
  "queries": "best crm software\nproject management tools",
  "countryCode": "us",
  "languageCode": "en",
  "device": "desktop",
  "resultsPerPage": 10,
  "maxPagesPerQuery": 1
}
````

The Actor is set to economy mode by default, so this kind of run is designed to stay small and inexpensive.

### Input options

You can provide searches in three ways:

| Input | Use it when |
| --- | --- |
| `queries` | You want to enter keywords directly, one per line |
| `searchUrls` | You already have Google Search URLs and want exact URL-level control |
| `inputFile` | You want to upload a TXT, CSV, or JSON file with many searches |

Useful settings include:

| Setting | What it controls |
| --- | --- |
| `countryCode` | Country used for localized results, such as `us`, `gb`, or `ca` |
| `googleDomain` | Google domain, such as `google.com` or another local Google domain |
| `languageCode` | Language of the search interface and results |
| `locationName` or `locationUule` | Optional more precise location targeting |
| `device` | Desktop or mobile search results |
| `resultsPerPage` | How many results to request per page |
| `maxPagesPerQuery` | How many Google results pages to collect per query |
| `includeOrganicResults` | Standard organic results |
| `includePaidResults` | Sponsored text ads |
| `includeProductAds` | Shopping or product ad results |
| `includePeopleAlsoAsk` | People Also Ask questions |
| `includeRelatedQueries` | Related searches |
| `includeAiOverview` | Google AI Overview when available |
| `trackedEntities` | Brand, product, person, or competitor names to detect in results |
| `leadEnrichment.enabled` | Creates domain-level lead records from discovered websites |
| `saveHtml` | Saves raw HTML for checking results |
| `saveScreenshots` | Saves screenshots, which requires browser mode |

### Output

Results are saved to an Apify dataset. Each item has a `recordType` so you can filter the data easily.

| Record type | Meaning |
| --- | --- |
| `serp_result` | One search result row, such as an organic result, ad, product ad, related query, or People Also Ask item |
| `serp_page` | A page-level summary of one Google results page |
| `ai_answer` | Google AI Overview or AI provider answer record |
| `ai_comparison` | Comparison data for AI answer sources, domains, or tracked entities |
| `lead` | Domain-level lead record |
| `error` | A validation, blocking, empty page, parser, or provider error |
| `run_summary` | Run-level summary when enabled |

A typical organic result looks like this:

```json
{
  "recordType": "serp_result",
  "type": "organic",
  "position": 1,
  "absolutePosition": 1,
  "title": "Best CRM Software: Everything To Consider",
  "url": "https://www.example.com/best-crm-software",
  "domain": "example.com",
  "rootDomain": "example.com",
  "description": "Compare popular CRM tools and features...",
  "searchQuery": {
    "term": "best crm software",
    "countryCode": "US",
    "languageCode": "en",
    "device": "DESKTOP",
    "page": 1
  }
}
```

The run also stores a summary in the default key-value store under `OUTPUT`, including how many pages succeeded, how many failed, and how many results were collected.

### Keeping costs low

This Actor is optimized to run cheaply by default. Economy mode uses lightweight HTTP crawling, compact output, low concurrency, no retries by default, and no screenshots or raw HTML unless you enable them.

To keep runs as inexpensive as possible:

- Start with `maxPagesPerQuery` set to `1`
- Keep `resultsPerPage` at `10` unless you need more
- Use the default `crawlerType` of `http`
- Turn on only the result types you need
- Keep `saveHtml` and `saveScreenshots` off unless you are checking results
- Use `maxRequestsPerRun` as a safety limit for large keyword lists
- Run a small test before launching a large batch

Costs increase when you collect more pages, enable browser mode, save screenshots, retry failed requests, or turn on extra result types. Your final cost also depends on your Apify plan, proxy setup, and the Actor pricing shown in the Apify Store.

### Getting more results

Google usually shows around 10 organic results per page. To collect more results for each query, increase `maxPagesPerQuery`.

For example:

- `maxPagesPerQuery: 1` collects roughly the first 10 results
- `maxPagesPerQuery: 5` collects roughly the first 50 results
- `maxPagesPerQuery: 10` collects roughly the first 100 results

The final number can be lower because Google may show ads, special blocks, duplicate links, local results, or fewer standard organic results for some searches.

### AI Overview and AI provider notes

This Actor can extract Google AI Overview content when it appears directly on the Google results page and when `includeAiOverview` is enabled.

The project also includes a ready structure for comparing answers from AI search providers such as Google AI Mode, Perplexity, ChatGPT, Copilot, and Gemini. In the current build, those non-Google provider connectors are adapter-ready placeholders. They do not invent answers. To collect real answers from those providers, connect official provider APIs or user-authorized browser adapters first.

### Lead enrichment notes

Lead enrichment is optional. In the current build, it creates domain-level records from websites found in the search results. For example, if a result comes from `example.com`, the Actor can create a lead-style record for that domain.

The Actor does not create fake personal contact details. Names, work emails, phone numbers, LinkedIn profiles, and email verification require a compliant enrichment provider to be connected.

If you collect or process personal data, make sure you have a lawful reason to do so and that your use complies with applicable laws, platform terms, and target-site terms.

### Tips for better results

- Search results can differ by country, language, device, location, time, and Google layout.
- Use raw Google Search URLs if you need exact control over the search URL.
- Enable `saveHtml` when you want to check exactly what Google returned.
- Enable screenshots only when visual proof is important, because screenshots cost more.
- If a query returns fewer rows than expected, try another country, device, or keyword format.
- For repeated monitoring, schedule the Actor and compare datasets over time.

### Integrations and API

You can use the results in several ways:

- Download the dataset from Apify in JSON, CSV, Excel, XML, or HTML
- Send results to Google Sheets, Google Drive, Make, Zapier, Slack, Airbyte, and other integrations
- Use webhooks to trigger another workflow when a run finishes
- Run the Actor from your own app using the Apify API
- Schedule recurring runs for rank tracking or competitor monitoring

### Frequently asked questions

#### Do I need to know how to code?

No. You can run the Actor from the Apify Console by filling in the input form and clicking Start.

#### Can I search many keywords at once?

Yes. Add one query per line, upload a file, or provide a list of Google Search URLs. For large runs, use `maxRequestsPerRun` as a cost safety limit.

#### Can I choose a country or language?

Yes. Use `countryCode`, `googleDomain`, `languageCode`, and optional location settings to control how Google results are requested.

#### Can I collect ads and shopping results?

Yes, when Google shows them. Enable `includePaidResults` for sponsored text ads and `includeProductAds` for product or shopping-style results.

#### Can I collect People Also Ask and related searches?

Yes. Enable `includePeopleAlsoAsk` and `includeRelatedQueries`.

#### Is scraping Google Search legal?

Scraping publicly available web data can be legal, but rules vary by country and use case. You should respect applicable laws, personal data rules, intellectual property rights, Google's terms, and any other relevant platform terms. If you are unsure, ask a qualified legal professional.

#### What should I do if results look incomplete?

Run a small test with `saveHtml` enabled and compare the saved HTML with the dataset output. Search pages change often, so saved HTML is useful for checking what Google actually returned.

### Feedback and support

If you find a bug, have a feature request, or see results that look wrong, open an issue from the Actor's Issues tab in Apify Console and include a small example input. For result-quality questions, saved HTML from a small test run is especially helpful.

# Actor input Schema

## `queries` (type: `string`):

One search query per line. Use this for keyword-based SERP collection.

## `searchUrls` (type: `array`):

Optional raw Google search URLs. Use this when you need exact URL-level control.

## `inputFile` (type: `string`):

Optional TXT, CSV, or JSON file uploaded to the default key-value store. Lines or first CSV column can contain queries or Google URLs.

## `costMode` (type: `string`):

Economy is the cheapest mode: HTTP-first crawling, no retries by default, compact output, no screenshots/HTML evidence, capped request count, and no unavailable AI placeholder rows. Use balanced or performance when completeness matters more than cost.

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

Two-letter country code used for localized search.

## `googleDomain` (type: `string`):

Google domain to use. If omitted, the Actor derives it from countryCode.

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

Language code for the search interface and results.

## `locationName` (type: `string`):

Optional precise location, such as Seattle, Washington, United States. Used as a local search hint when no UULE is supplied.

## `locationUule` (type: `string`):

Optional raw UULE parameter. Takes precedence over locationName.

## `device` (type: `string`):

Choose desktop or mobile SERP rendering.

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

Number of search results requested per Google results page.

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

How many SERP pages to collect per query.

## `includeOrganicResults` (type: `boolean`):

Extract standard organic search results.

## `includeSitelinks` (type: `boolean`):

Extract and output sitelinks. Disabled by default because it increases parser work and dataset rows.

## `includePaidResults` (type: `boolean`):

Extract paid text ads when present.

## `includeProductAds` (type: `boolean`):

Extract shopping/product ad units when present.

## `includePeopleAlsoAsk` (type: `boolean`):

Extract People Also Ask questions and answers where available.

## `expandPeopleAlsoAsk` (type: `boolean`):

Click or expand PAA items in browser mode. Increases runtime and cost.

## `includeRelatedQueries` (type: `boolean`):

Extract related search queries.

## `includeAiOverview` (type: `boolean`):

Attempt to extract AI Overview content when available. AI Mode/provider adapters return honest unavailable records unless provider credentials are added in code.

## `aiProviders` (type: `array`):

Optional AI-answer providers for cross-platform comparison. Non-Google providers are emitted as adapter-ready unavailable records until real provider connectors are configured.

## `emitUnavailableAiRecords` (type: `boolean`):

Write provider records even when an AI provider adapter is unavailable or an AI block is missing. Keep disabled for the cheapest, smallest datasets.

## `copilotMode` (type: `string`):

Response style for a future Copilot adapter.

## `trackedEntities` (type: `array`):

Brand, product, competitor, or person names to detect in SERPs and AI answers.

## `domainFilters` (type: `object`):

Optional domain filtering rules.

## `leadEnrichment` (type: `object`):

Optional business lead workflow. This implementation emits domain-only lead records unless a real enrichment adapter is connected.

## `customDataFunction` (type: `string`):

Optional JavaScript function executed on each SERP page. Must return a JSON-serializable object.

## `outputMode` (type: `string`):

Choose whether to push page-level records, row-level records, or both.

## `compactOutput` (type: `boolean`):

Remove nulls, empty arrays, and empty objects before writing dataset items. This reduces storage, export size, and downstream API payloads.

## `pushSummaryToDataset` (type: `boolean`):

Also write the run summary as a dataset item. Disabled by default because OUTPUT in the key-value store is enough for most automations.

## `saveHtml` (type: `boolean`):

Save raw SERP HTML for debugging and auditability.

## `saveScreenshots` (type: `boolean`):

Save screenshots for visual QA. Requires browser mode.

## `crawlerType` (type: `string`):

Use HTTP parsing first for speed, browser mode for dynamic features, or auto fallback.

## `maxConcurrency` (type: `integer`):

Maximum number of SERP pages processed in parallel.

## `maxRequestsPerRun` (type: `integer`):

Cost guardrail that caps planned SERP page requests. Economy mode caps this to 100 even if a higher value is supplied.

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

Maximum time per request in seconds.

## `maxRequestRetries` (type: `integer`):

How many times to retry failed SERP requests.

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

Proxy settings. Google SERP or residential proxies are recommended for reliable localized search.

## `debugLog` (type: `boolean`):

Enable verbose logs for parser/debugging.

## Actor input object example

```json
{
  "queries": "hotels in Seattle\nbest project management software\nsite:example.com pricing",
  "searchUrls": [
    {
      "url": "https://www.google.com/search?q=hotels+in+Seattle&num=10"
    }
  ],
  "costMode": "economy",
  "countryCode": "us",
  "googleDomain": "google.com",
  "languageCode": "en",
  "device": "desktop",
  "resultsPerPage": 10,
  "maxPagesPerQuery": 1,
  "includeOrganicResults": true,
  "includeSitelinks": false,
  "includePaidResults": false,
  "includeProductAds": false,
  "includePeopleAlsoAsk": false,
  "expandPeopleAlsoAsk": false,
  "includeRelatedQueries": false,
  "includeAiOverview": false,
  "aiProviders": [
    "google_ai_mode",
    "perplexity",
    "chatgpt",
    "copilot",
    "gemini"
  ],
  "emitUnavailableAiRecords": false,
  "copilotMode": "smart",
  "trackedEntities": [],
  "customDataFunction": "async ({ input, $, request, response, html }) => {\n  return { pageTitle: $('title').text() };\n};",
  "outputMode": "rows",
  "compactOutput": true,
  "pushSummaryToDataset": false,
  "saveHtml": false,
  "saveScreenshots": false,
  "crawlerType": "http",
  "maxConcurrency": 1,
  "maxRequestsPerRun": 100,
  "requestTimeoutSecs": 20,
  "maxRequestRetries": 0,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "GOOGLE_SERP"
    ]
  },
  "debugLog": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

All records produced by the Actor. Use dataset views for page, row, AI, lead, error, and summary perspectives.

## `summary` (type: `string`):

Run-level metrics and output links.

## `htmlEvidence` (type: `string`):

Raw SERP HTML records when saveHtml is enabled.

## `screenshots` (type: `string`):

SERP screenshots when saveScreenshots is enabled.

# 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": `hotels in Seattle
best project management software
site:example.com pricing`,
    "searchUrls": [
        {
            "url": "https://www.google.com/search?q=hotels+in+Seattle&num=10"
        }
    ],
    "aiProviders": [
        "google_ai_mode",
        "perplexity",
        "chatgpt",
        "copilot",
        "gemini"
    ],
    "customDataFunction": async ({ input, $, request, response, html }) => {
      return { pageTitle: $('title').text() };
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("qaseemiqbal/google-search-result-intelligence").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": """hotels in Seattle
best project management software
site:example.com pricing""",
    "searchUrls": [{ "url": "https://www.google.com/search?q=hotels+in+Seattle&num=10" }],
    "aiProviders": [
        "google_ai_mode",
        "perplexity",
        "chatgpt",
        "copilot",
        "gemini",
    ],
    "customDataFunction": """async ({ input, $, request, response, html }) => {
  return { pageTitle: $('title').text() };
};""",
}

# Run the Actor and wait for it to finish
run = client.actor("qaseemiqbal/google-search-result-intelligence").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 '{
  "queries": "hotels in Seattle\\nbest project management software\\nsite:example.com pricing",
  "searchUrls": [
    {
      "url": "https://www.google.com/search?q=hotels+in+Seattle&num=10"
    }
  ],
  "aiProviders": [
    "google_ai_mode",
    "perplexity",
    "chatgpt",
    "copilot",
    "gemini"
  ],
  "customDataFunction": "async ({ input, $, request, response, html }) => {\\n  return { pageTitle: $('\''title'\'').text() };\\n};"
}' |
apify call qaseemiqbal/google-search-result-intelligence --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Search Result Intelligence",
        "description": "Collect Google Search results for keywords and turn them into clean datasets with rankings, titles, URLs, domains, ads, People Also Ask, related searches, AI Overview data, and optional domain-level leads.",
        "version": "1.0",
        "x-build-id": "1qFzwQ9nUSDNw4rxh"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/qaseemiqbal~google-search-result-intelligence/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-qaseemiqbal-google-search-result-intelligence",
                "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/qaseemiqbal~google-search-result-intelligence/runs": {
            "post": {
                "operationId": "runs-sync-qaseemiqbal-google-search-result-intelligence",
                "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/qaseemiqbal~google-search-result-intelligence/run-sync": {
            "post": {
                "operationId": "run-sync-qaseemiqbal-google-search-result-intelligence",
                "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": {
                    "queries": {
                        "title": "Search queries",
                        "type": "string",
                        "description": "One search query per line. Use this for keyword-based SERP collection."
                    },
                    "searchUrls": {
                        "title": "Search URLs",
                        "type": "array",
                        "description": "Optional raw Google search URLs. Use this when you need exact URL-level control.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "inputFile": {
                        "title": "Input file",
                        "type": "string",
                        "description": "Optional TXT, CSV, or JSON file uploaded to the default key-value store. Lines or first CSV column can contain queries or Google URLs."
                    },
                    "costMode": {
                        "title": "Cost mode",
                        "enum": [
                            "economy",
                            "balanced",
                            "performance"
                        ],
                        "type": "string",
                        "description": "Economy is the cheapest mode: HTTP-first crawling, no retries by default, compact output, no screenshots/HTML evidence, capped request count, and no unavailable AI placeholder rows. Use balanced or performance when completeness matters more than cost.",
                        "default": "economy"
                    },
                    "countryCode": {
                        "title": "Country code",
                        "type": "string",
                        "description": "Two-letter country code used for localized search.",
                        "default": "us"
                    },
                    "googleDomain": {
                        "title": "Google domain",
                        "type": "string",
                        "description": "Google domain to use. If omitted, the Actor derives it from countryCode.",
                        "default": "google.com"
                    },
                    "languageCode": {
                        "title": "Language code",
                        "type": "string",
                        "description": "Language code for the search interface and results.",
                        "default": "en"
                    },
                    "locationName": {
                        "title": "Exact location",
                        "type": "string",
                        "description": "Optional precise location, such as Seattle, Washington, United States. Used as a local search hint when no UULE is supplied."
                    },
                    "locationUule": {
                        "title": "UULE location parameter",
                        "type": "string",
                        "description": "Optional raw UULE parameter. Takes precedence over locationName."
                    },
                    "device": {
                        "title": "Device",
                        "enum": [
                            "desktop",
                            "mobile"
                        ],
                        "type": "string",
                        "description": "Choose desktop or mobile SERP rendering.",
                        "default": "desktop"
                    },
                    "resultsPerPage": {
                        "title": "Results per page",
                        "minimum": 10,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Number of search results requested per Google results page.",
                        "default": 10
                    },
                    "maxPagesPerQuery": {
                        "title": "Maximum pages per query",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "How many SERP pages to collect per query.",
                        "default": 1
                    },
                    "includeOrganicResults": {
                        "title": "Include organic results",
                        "type": "boolean",
                        "description": "Extract standard organic search results.",
                        "default": true
                    },
                    "includeSitelinks": {
                        "title": "Include sitelinks",
                        "type": "boolean",
                        "description": "Extract and output sitelinks. Disabled by default because it increases parser work and dataset rows.",
                        "default": false
                    },
                    "includePaidResults": {
                        "title": "Include paid results",
                        "type": "boolean",
                        "description": "Extract paid text ads when present.",
                        "default": false
                    },
                    "includeProductAds": {
                        "title": "Include product ads",
                        "type": "boolean",
                        "description": "Extract shopping/product ad units when present.",
                        "default": false
                    },
                    "includePeopleAlsoAsk": {
                        "title": "Include People Also Ask",
                        "type": "boolean",
                        "description": "Extract People Also Ask questions and answers where available.",
                        "default": false
                    },
                    "expandPeopleAlsoAsk": {
                        "title": "Expand People Also Ask",
                        "type": "boolean",
                        "description": "Click or expand PAA items in browser mode. Increases runtime and cost.",
                        "default": false
                    },
                    "includeRelatedQueries": {
                        "title": "Include related queries",
                        "type": "boolean",
                        "description": "Extract related search queries.",
                        "default": false
                    },
                    "includeAiOverview": {
                        "title": "Include Google AI Overview / AI Mode",
                        "type": "boolean",
                        "description": "Attempt to extract AI Overview content when available. AI Mode/provider adapters return honest unavailable records unless provider credentials are added in code.",
                        "default": false
                    },
                    "aiProviders": {
                        "title": "AI answer providers",
                        "type": "array",
                        "description": "Optional AI-answer providers for cross-platform comparison. Non-Google providers are emitted as adapter-ready unavailable records until real provider connectors are configured.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "emitUnavailableAiRecords": {
                        "title": "Emit unavailable AI records",
                        "type": "boolean",
                        "description": "Write provider records even when an AI provider adapter is unavailable or an AI block is missing. Keep disabled for the cheapest, smallest datasets.",
                        "default": false
                    },
                    "copilotMode": {
                        "title": "Copilot response mode",
                        "enum": [
                            "chat",
                            "reasoning",
                            "smart",
                            "study"
                        ],
                        "type": "string",
                        "description": "Response style for a future Copilot adapter.",
                        "default": "smart"
                    },
                    "trackedEntities": {
                        "title": "Tracked entities",
                        "type": "array",
                        "description": "Brand, product, competitor, or person names to detect in SERPs and AI answers.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "domainFilters": {
                        "title": "Domain filters",
                        "type": "object",
                        "description": "Optional domain filtering rules.",
                        "properties": {
                            "includeDomains": {
                                "title": "Include domains",
                                "type": "array",
                                "description": "Only keep result rows from these domains when non-empty.",
                                "editor": "stringList"
                            },
                            "excludeDomains": {
                                "title": "Exclude domains",
                                "type": "array",
                                "description": "Drop result rows from these domains.",
                                "editor": "stringList"
                            },
                            "excludeLargePlatforms": {
                                "title": "Exclude large platforms",
                                "type": "boolean",
                                "description": "Exclude common platforms, directories, social networks, and marketplaces from lead enrichment.",
                                "default": true
                            }
                        },
                        "additionalProperties": false
                    },
                    "leadEnrichment": {
                        "title": "Lead enrichment",
                        "type": "object",
                        "description": "Optional business lead workflow. This implementation emits domain-only lead records unless a real enrichment adapter is connected.",
                        "properties": {
                            "enabled": {
                                "title": "Enable lead enrichment",
                                "type": "boolean",
                                "description": "Create lead-ready company/domain records for discovered result domains.",
                                "default": false
                            },
                            "maxLeadsPerDomain": {
                                "title": "Maximum leads per domain",
                                "type": "integer",
                                "description": "Maximum enriched contacts per domain when a provider adapter is connected.",
                                "default": 1,
                                "minimum": 1,
                                "maximum": 20
                            },
                            "verifyEmails": {
                                "title": "Verify emails",
                                "type": "boolean",
                                "description": "Verify email deliverability when enrichment returns email addresses.",
                                "default": false
                            },
                            "jobTitles": {
                                "title": "Target job titles",
                                "type": "array",
                                "description": "Optional job titles to prioritize.",
                                "editor": "stringList",
                                "default": []
                            }
                        },
                        "additionalProperties": false
                    },
                    "customDataFunction": {
                        "title": "Custom data function",
                        "type": "string",
                        "description": "Optional JavaScript function executed on each SERP page. Must return a JSON-serializable object."
                    },
                    "outputMode": {
                        "title": "Output mode",
                        "enum": [
                            "page",
                            "rows",
                            "both"
                        ],
                        "type": "string",
                        "description": "Choose whether to push page-level records, row-level records, or both.",
                        "default": "rows"
                    },
                    "compactOutput": {
                        "title": "Compact output",
                        "type": "boolean",
                        "description": "Remove nulls, empty arrays, and empty objects before writing dataset items. This reduces storage, export size, and downstream API payloads.",
                        "default": true
                    },
                    "pushSummaryToDataset": {
                        "title": "Push summary to dataset",
                        "type": "boolean",
                        "description": "Also write the run summary as a dataset item. Disabled by default because OUTPUT in the key-value store is enough for most automations.",
                        "default": false
                    },
                    "saveHtml": {
                        "title": "Save HTML",
                        "type": "boolean",
                        "description": "Save raw SERP HTML for debugging and auditability.",
                        "default": false
                    },
                    "saveScreenshots": {
                        "title": "Save screenshots",
                        "type": "boolean",
                        "description": "Save screenshots for visual QA. Requires browser mode.",
                        "default": false
                    },
                    "crawlerType": {
                        "title": "Crawler type",
                        "enum": [
                            "http",
                            "browser",
                            "auto"
                        ],
                        "type": "string",
                        "description": "Use HTTP parsing first for speed, browser mode for dynamic features, or auto fallback.",
                        "default": "http"
                    },
                    "maxConcurrency": {
                        "title": "Maximum concurrency",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Maximum number of SERP pages processed in parallel.",
                        "default": 1
                    },
                    "maxRequestsPerRun": {
                        "title": "Maximum SERP requests per run",
                        "minimum": 1,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Cost guardrail that caps planned SERP page requests. Economy mode caps this to 100 even if a higher value is supplied.",
                        "default": 100
                    },
                    "requestTimeoutSecs": {
                        "title": "Request timeout",
                        "minimum": 10,
                        "maximum": 300,
                        "type": "integer",
                        "description": "Maximum time per request in seconds.",
                        "default": 20
                    },
                    "maxRequestRetries": {
                        "title": "Maximum request retries",
                        "minimum": 0,
                        "maximum": 10,
                        "type": "integer",
                        "description": "How many times to retry failed SERP requests.",
                        "default": 0
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Proxy settings. Google SERP or residential proxies are recommended for reliable localized search.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "GOOGLE_SERP"
                            ]
                        }
                    },
                    "debugLog": {
                        "title": "Debug log",
                        "type": "boolean",
                        "description": "Enable verbose logs for parser/debugging.",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
