# Google Search Scraper: $1.50/1k SERP pages (`santamaria-automations/google-search-scraper`) Actor

Scrape Google search at $1.50 per 1,000 SERP pages, 40% cheaper than the leading Apify alternative. Returns organic results, paid ads, People Also Ask with pre-rendered answers, related queries, featured snippet, AI Overview body + sources. Built in Go.

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

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

Scrape Google search pages at **$1.50 per 1,000 SERPs**, about 40% cheaper than the leading Apify alternative. Each run gives you one record per SERP page with organic results, paid ads, People Also Ask (including pre-rendered answers with source attribution), related queries, featured snippet, the full AI Overview body plus its source citations, and pagination metadata. Built in Go, HTTP only, no JavaScript rendering, no proxy setup required.

### What you get per SERP page

- **Organic results**: title, URL, displayed URL, description, source name, position, the keywords Google bolded inside the snippet, sub-page site links, plus context fields like `commentsAmount` (Reddit), `views` (YouTube), `lastUpdated`, and `date`.
- **Paid results and shopping ads**: text ads land in `paidResults[]` with title, destination URL (not the Google tracking redirect), displayed URL, description, and ad position. Shopping carousel cards land in `paidProducts[]` with title, URL, merchant, price, and image URL.
- **People Also Ask**: every PAA question. When Google pre-renders the first answer (most "best X", "how to", "what is" queries), that item also gets the full answer text, source title, source URL, and publish date.
- **Related queries**: deduplicated "Related searches" suggestions from the bottom of the SERP.
- **Featured snippet**: the highlighted answer box at the top of the SERP, when present.
- **AI Overview**: the full synthesized AI answer text (intro paragraphs plus the detailed bullet list), and the citation cards Google credits, each with title, URL, and excerpt.
- **Pagination signals**: `resultsTotal` (the "About X results" number) and `hasNextPage`.
- **Raw HTML on demand**: set `saveHtmlToKeyValueStore: true` to get a public URL to the saved page in the Key-Value Store.

### Why use this actor

- **Pay per page, no monthly subscription.** $0.001 actor-start and $0.0015 per SERP page returned. Free Apify accounts get $5 credit, enough for about 3,300 SERPs.
- **Full AI Overview extraction.** Both the synthesized AI body text (intro plus bullet detail) and the citation cards Google credits, each with title, URL, and excerpt.
- **PAA with attribution.** When Google pre-renders the first People Also Ask answer (most "best X" / "how to" queries), you get the answer text, source title, source URL, and publish date.
- **Paid ads add-on.** Optional `extractAds` toggle adds session-rotated retries to maximise ad discovery on commerce queries.
- **No proxy or browser setup.** Apify's `GOOGLE_SERP` proxy is wired in under the hood. You only choose the country and language.
- **Built for AI agents (MCP) and Apify workflows.** Native integration with Apify schedulers, webhooks, datasets, and the Model Context Protocol.

### What you can do with Google SERP data

- **SEO rank tracking**: monitor your domain's position for thousands of keywords daily.
- **AEO / GEO research**: see what Google's AI Overview tells users about your topic, and which sources it cites.
- **Lead generation**: pull URLs of every site that ranks for your target ICP keywords, then enrich.
- **Competitive monitoring**: track which competitors appear in your category's SERPs.
- **Content gap analysis**: read every PAA question and answer Google shows for your topic.
- **AI agent grounding**: feed structured SERP data to LLM agents via MCP or OpenAI tool use, so they can answer "what does the internet say about X" with citations.

### Use with AI agents (MCP)

This actor works as a Model Context Protocol tool out of the box. Connect any MCP-compatible client (Claude Desktop, Claude.ai, Cursor, VS Code, custom agents).

**Apify MCP server URL:**

````

https://mcp.apify.com?tools=santamaria-automations/google-search-scraper

````

**Example prompt once connected:**

> Use `google-search-scraper` to find the top 20 organic Google results for `"best vector database"` in the US and return the URLs, titles, and descriptions.

### Input

You only need a list of search queries. Everything else has sensible defaults.

```json
{
  "queries": ["best CRM software", "python web scraping tutorial"],
  "countryCode": "us",
  "languageCode": "en",
  "resultsPerPage": 10,
  "maxPagesPerQuery": 1,
  "includePeopleAlsoAsk": true,
  "includeRelatedSearches": true
}
````

#### Input parameters

| Parameter | Type | Default | What it does |
|---|---|---|---|
| `queries` | string\[] | (none) | Keywords to search. Each runs as a separate Google query. |
| `searchUrls` | string\[] | (none) | Optional: paste Google search URLs directly. All URL filters are preserved. |
| `countryCode` | string | `us` | ISO 3166-1 alpha-2 country code (`us`, `gb`, `de`, `au`, ...). Sets Google's `gl` parameter when non-default. |
| `languageCode` | string | `en` | Language code (`en`, `de`, `fr`, `es`, ...). Sets Google's `hl` parameter when non-default. |
| `resultsPerPage` | int | `10` | Results to request per page (10 to 100). Default 10 gives the richest output (Google pre-renders PAA answers, AI Overview body text, and source descriptions on smaller-num SERPs). Raise to 100 if you want more results per request and don't mind a slimmer feature set. |
| `maxPagesPerQuery` | int | `1` | Pages to fetch per query (1 to 10). Each page is one billable event. |
| `mobileResults` | bool | `false` | Use Google's mobile interface. Mobile SERPs sometimes show a different result mix and ad placements. |
| `forceExactMatch` | bool | `false` | Wraps each query in quotes (`"..."`), Google's verbatim mode. |
| `includePeopleAlsoAsk` | bool | `true` | Extract the PAA section from page 1. |
| `includeRelatedSearches` | bool | `true` | Extract related-search suggestions from the bottom of page 1. |
| `saveHtmlToKeyValueStore` | bool | `false` | Save the raw SERP HTML to the Key-Value Store. Useful for debugging or custom extraction. |
| `extractAds` | bool | `false` | Add-on: enable comprehensive paid-results extraction. Retries each query with rotated proxy sessions up to two more times and merges any new ads found. Adds one billable `ads-extraction-attempt` event per SERP page ($1.50 per 1,000). Recommended for commerce / comparison / lead-gen queries. |

Proxy configuration is handled internally. The actor always routes through Apify's `GOOGLE_SERP` proxy group, which is the recommended way to reliably scrape Google at scale.

### Output

One record per SERP page. To get one row per organic result, append `&view=organicResults` to the dataset URL or pick the view in the Apify UI.

```json
{
  "searchQuery": {
    "term": "best CRM software",
    "url": "http://www.google.com/search?q=best+CRM+software",
    "device": "DESKTOP",
    "page": 1,
    "domain": "google.com",
    "countryCode": "us",
    "languageCode": "en"
  },
  "resultsTotal": 122,
  "hasNextPage": true,
  "organicResults": [
    {
      "title": "What's the best CRM you're using right now and why?",
      "url": "https://www.reddit.com/r/CRM/comments/1o0r9ot/whats_the_best_crm_youre_using_right_now_and_why/",
      "displayedUrl": "Reddit · r/CRM",
      "description": "Hey everyone, I'm looking for honest recommendations on CRM platforms...",
      "websiteTitle": "Reddit · r/CRM",
      "emphasizedKeywords": [],
      "siteLinks": [],
      "commentsAmount": "200+ comments",
      "views": null,
      "lastUpdated": "7 months ago",
      "date": null,
      "position": 1,
      "type": "organic"
    }
  ],
  "paidResults": [
    {
      "title": "Boost Growth with ServiceNow® - CRM Tools That Maximize ROI",
      "url": "https://www.servicenow.com/solutions/crm/crm-system.html",
      "displayedUrl": "ServiceNow",
      "description": null,
      "adPosition": 1,
      "type": "paid"
    }
  ],
  "paidProducts": [],
  "featuredSnippet": null,
  "peopleAlsoAsk": [
    {
      "question": "Which is the best CRM software?",
      "answer": "Top 10 Best CRM Software In India\nSalesforce CRM. ...\nHubSpot CRM. ...\nFreshsales by Freshworks. ...\nMicrosoft Dynamics 365 CRM. ...\nPipedrive. ...",
      "title": "Top 10 CRM Software in India, Bigsun",
      "url": "https://bigsunworld.com/blog/top-10-crm-software-in-india.html",
      "date": "16 Sept 2025"
    },
    { "question": "What is no 1 CRM?", "answer": null, "title": null, "url": null, "date": null }
  ],
  "relatedQueries": [
    { "title": "Top 10 CRM software", "url": "http://www.google.com/search?q=Top+10+CRM+software" }
  ],
  "suggestedResults": [],
  "aiOverview": {
    "type": "static",
    "content": "The \"best\" CRM software depends on your business size, budget, and primary goals. Top overall options include HubSpot for marketing automation, Pipedrive for sales-driven teams, Zoho CRM for high customization on a budget, and Salesforce for large, scaling enterprises\n\nThe leading CRM platforms stand out in different areas:\n\nHubSpot CRM: Best overall for marketing and beginners. It features a robust, forever-free tier and offers seamless integration of sales, marketing, and customer service hubs. Paid starter plans begin around $15/user/month.\n\nPipedrive: Best for sales teams and pipeline management. It features a clean, visual, and intuitive interface designed explicitly to close deals fast. Starts around $14/user/month (billed annually). U.S. Chamber of Commerce +2\n\nZoho CRM: Best value and deeply customizable. It offers extensive workflow automation and AI tools, making it highly scalable for growing businesses. Starts around $14/user/month.\n\nSalesforce: Best for large businesses and enterprises. It is the world's number one CRM, offering unmatched customization and AI capabilities, though it requires a steeper learning curve",
    "sources": [
      {
        "url": "https://www.reddit.com/r/CRM/comments/1o0r9ot/whats_the_best_crm_youre_using_right_now_and_why/",
        "title": "What's the best CRM you're using right now and why?",
        "description": "Very easy and automated sales CRM for B2B. * TilapiaTango. • 8mo ago. Salesforce. For decades and it's worked well..."
      },
      {
        "url": "https://www.forbes.com/advisor/business/software/best-crm-software/",
        "title": "10 Best CRM Software Of 2026 – Forbes Advisor",
        "description": "Innovation. * View All Innovation. * Cloud 100. * Enterprise Commerce. * Enterprise Security and Protection..."
      },
      {
        "url": "https://www.uschamber.com/co/start/strategy/low-cost-crm-tools",
        "title": "10 Free or Low-Cost CRM Tools for Small Businesses",
        "description": "Explore top vendors with free or low-cost CRM options * HubSpot offers a free CRM packed with features..."
      }
    ]
  },
  "kvsHtmlUrl": "https://api.apify.com/v2/key-value-stores/STORE_ID/records/best_CRM_software_page1",
  "url": "http://www.google.com/search?q=best+CRM+software",
  "scrapedAt": "2026-06-03T12:00:00Z"
}
```

#### Output field reference

- `searchQuery`: metadata about which query, page, device, country, and language produced this record.
- `resultsTotal`: the "About X,XXX,XXX results" number Google shows above the SERP. Null when Google does not show the counter for that query.
- `hasNextPage`: true if Google offers a Next page link. Re-run with a higher `maxPagesPerQuery` to fetch more.
- `organicResults[]`: every organic web result on the page (see field table below).
- `paidResults[]`: text ads above or below organic results, with title, destination URL, displayed URL, description, and ad position.
- `paidProducts[]`: shopping ads (product cards with title, URL, merchant, price, image).
- `featuredSnippet`: the highlighted answer box at the top of the SERP, or null when absent.
- `peopleAlsoAsk[]`: PAA questions. The first item gets `answer`, `title`, `url`, and `date` populated from the source citation card when Google pre-renders the answer. Subsequent items return question only.
- `relatedQueries[]`: deduplicated related-search suggestions from the bottom of the SERP.
- `suggestedResults[]`: reserved for future enrichment, currently always returned as an empty array.
- `aiOverview`: Google AI Overview block. `content` carries the full synthesized AI answer (intro paragraphs plus the bullet detail list). `sources` lists the citation cards with `url`, `title`, and `description` (the excerpt Google credits). Null when the SERP has no AI Overview.
- `kvsHtmlUrl`: public link to the raw HTML in the Apify Key-Value Store. Present only when `saveHtmlToKeyValueStore` is true.
- `url`: convenience copy of `searchQuery.url`.
- `scrapedAt`: ISO 8601 UTC timestamp the page was fetched.

#### Per-organic-result fields

- `title`, `url`, `description`: the basics.
- `displayedUrl`: the breadcrumb-style URL Google shows under the title.
- `websiteTitle`: the short source name (e.g. `Salesforce`, `Reddit · r/CRM`, `Expedia`).
- `emphasizedKeywords`: words Google bolded inside the description (it bolds query matches).
- `siteLinks`: sub-page links Google groups beneath the main result, for big sites. Empty array when none.
- `commentsAmount`: comment count Google shows for Reddit / forum results (e.g. `"200+ comments"`). Null when absent.
- `views`: view count for YouTube results (e.g. `"44.7K+ views"`). Null when absent.
- `lastUpdated`: relative time stamp Google shows next to the result (e.g. `"7 months ago"`). Null when absent.
- `date`: publish date Google shows for article results (e.g. `"Feb 5, 2026"`). Null when absent.
- `position`: 1-based rank on the SERP. With pagination, page 2 starts at position 11, page 3 at 21, and so on.
- `type`: always `organic` for this array. Featured snippets and AI Overview sources live in their own top-level fields.

### Pricing

Pay-per-event, no monthly fee, no commitment. Apify's free plan gives you **$5 of credit**, which covers about 3,300 SERP pages with this actor.

| Event | Price | When charged |
|---|---|---|
| Actor start | $0.001 | Once per run, when the container starts. |
| Scraped search result page | $0.0015 ($1.50 per 1,000) | Per SERP page successfully fetched and parsed. |
| Paid results extraction (add-on) | $0.0015 ($1.50 per 1,000) | Per SERP page when `extractAds: true`. Triggers up to two extra fetches with rotated proxy sessions to maximise ad discovery. |

Example total cost:

- 1 query, 1 page (default 10 results): $0.001 + $0.0015 = **$0.0025**
- 10 queries, 1 page each: $0.001 + $0.015 = **$0.016**
- 1,000 queries, 1 page each: $0.001 + $1.50 = **$1.50**
- 100 queries, 1 page each, with `extractAds`: $0.001 + $0.15 + $0.15 = **$0.30**

> Apify's `GOOGLE_SERP` proxy is required and is charged separately against your Apify proxy quota. The Free plan includes about 1,000 SERP requests per month; Creator and higher plans include 10,000+ per month.

### How to scrape Google by keyword

Provide one or more search terms. Each runs as a separate Google query, and the results land in a single dataset:

```json
{ "queries": ["hotels in Seattle", "best CRM software"] }
```

### How to scrape Google by URL

Paste full Google search URLs to preserve every filter (country, language, time range, file type, and so on):

```json
{
  "searchUrls": [
    "https://www.google.com/search?q=hotels+in+Seattle&gl=us&tbs=qdr:w"
  ]
}
```

### Limitations you should know about

This actor is HTTP-only and routes through Apify's `GOOGLE_SERP` proxy. A few fields depend on what Google chooses to include in the SERP for a given query:

- **`peopleAlsoAsk[0].answer`** is populated whenever Google pre-renders the first PAA answer (which happens on most "best X", "how to" and "what is" queries). For the other PAA questions, `answer` stays `null` because Google loads those via JavaScript only when the user clicks the expander. When Google pre-renders the first answer, you also get `title`, `url`, and `date` of the source article.
- **`aiOverview.content` is populated when Google pre-renders the AI body** (most "best X" / "how to" / "what is" queries). The content includes intro paragraphs plus the bullet detail list and the inline source citations Google embeds in the text. For queries where Google shows the AI Overview UI but does not pre-render the body, you still get the source cards with their descriptions.
- **`aiOverview` appears only when Google shows it for that query.** AI Overview triggers on roughly half the queries we tested (more often on "how to" and "best X" queries, less on travel or product queries). When the SERP has no AI Overview at all, this field is `null`.
- **`resultsTotal` is `null` for some queries** because Google does not always show the "About X results" counter.
- **`paidResults` and `paidProducts` depend on the fetch.** Google rotates ads aggressively, so the same query can return ads on one fetch and no ads on the next. Enable `extractAds: true` to retry with rotated proxy sessions and merge any new ads found.

### Tips and FAQs

**How many results per page can I get?**
Up to 100 with `resultsPerPage: 100`. Google's modern SERPs interleave AI overviews and knowledge panels, so the actual `organicResults` count is often 8 to 12 even with `num=100`. That is Google's behaviour, not a parser limitation. Smaller `num` values (default 10) give the richest output because Google pre-renders PAA answers and AI Overview body text on smaller-num SERPs.

**How do I get more results, paginate or change `resultsPerPage`?**
Set `maxPagesPerQuery: 10` to fetch up to 10 pages (roughly 80 to 100 unique organic results at `resultsPerPage: 10`, or up to 1,000 at `resultsPerPage: 100`). Each page is one billable event.

**Why is `resultsTotal` sometimes `null`?**
Google does not always show the "About X results" counter, particularly for localised travel queries, AI-overview-heavy SERPs, and mobile layouts.

**How do I export to CSV or Excel?**
Use Apify's Export → CSV / XLSX. To get one row per organic result, append `&view=organicResults` to the dataset URL or pick the view in the UI.

**Can I scrape Google in any country?**
Yes. Set `countryCode` to any ISO 3166-1 alpha-2 code. Combine with `languageCode` for the closest match to a real user in that country.

**Does this work for AI Overview content?**
Yes. The actor extracts both the full AI Overview body text (intro plus the bullet detail list) and the citation cards Google credits. There are still rare cases where Google shows the AI Overview UI but does not pre-render the body server-side; in those cases you still get the sources.

**How does this compare to ScrapingBee, SerpAPI, or Bright Data?**
All three are great but subscription-based with monthly minimums. This actor is pay-per-event, costs nothing when idle, and integrates natively into Apify workflows (webhooks, schedulers, dataset transformations, MCP). For very high-volume daily SERP scraping a dedicated subscription may still be cheaper at scale; for everything else, pay-per-event wins.

**Is scraping Google Search legal?**
Public Google Search results are publicly accessible. Most jurisdictions allow scraping public data for legitimate purposes (research, SEO, market intelligence). Respect Google's Terms of Use and consult a lawyer for your specific use case.

### Coming soon

- Google AI Mode add-on (separate conversational AI search endpoint).
- Custom data function, so you can run your own JS extractor against the saved HTML.
- Cross-platform comparison add-ons: Perplexity, ChatGPT, Copilot, and Gemini.

### Feedback

Found a bug or want a feature? Open an issue on the [Apify Issues tab](https://apify.com/santamaria-automations/google-search-scraper/issues). We ship fixes fast.

# Actor input Schema

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

Keywords or phrases to search on Google (one per line). Each runs as a separate search. Results across queries are returned in a single dataset.

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

Optional: paste Google search URLs directly (e.g. https://www.google.com/search?q=python+tutorial\&gl=us). All filters in the URL are preserved.

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

ISO 3166-1 alpha-2 country code to localise the search (e.g. 'us', 'gb', 'de', 'au'). Determines which regional results Google returns.

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

Language code for the SERP UI and results (e.g. 'en', 'de', 'fr', 'es'). Defaults to English.

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

Number of results to request per page (10 to 100). Default 10 gives the richest output (Google includes pre-rendered PAA answers, AI Overview source descriptions, and more on the smaller-num SERPs). Set to 100 if you want more results per request and don't mind a slimmer feature set.

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

How many SERP pages to fetch per query. Increase to get more results (10 pages × 100 results = ~1,000 results per query).

## `mobileResults` (type: `boolean`):

Use Google's mobile interface instead of desktop. Mobile SERPs sometimes show different result sets and ad placements.

## `forceExactMatch` (type: `boolean`):

Wrap each query in quotes ("...") so Google only returns results containing the exact phrase. Equivalent to Google's verbatim mode.

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

Extract the 'People Also Ask' questions shown on the first SERP page. Returned in the peopleAlsoAsk array of each page record.

## `includeRelatedSearches` (type: `boolean`):

Extract related search suggestions from the bottom of the first SERP page. Returned in the relatedQueries array of each page record.

## `saveHtmlToKeyValueStore` (type: `boolean`):

Save the raw HTML of each SERP page to the default Key-Value Store. The output record will include a kvsHtmlUrl pointing at the saved file. Useful for debugging or extracting custom fields not parsed by the actor.

## `extractAds` (type: `boolean`):

Enable comprehensive paid-results extraction. Google rotates ads aggressively, so the actor retries each query with rotated proxy sessions up to two more times and merges any new ads found. Adds one billable ads-extraction-attempt event per SERP page ($1.50 per 1,000 pages). Recommended only on queries where ads matter (commerce, comparison, lead-gen).

## Actor input object example

```json
{
  "queries": [
    "best CRM software",
    "python web scraping"
  ],
  "countryCode": "us",
  "languageCode": "en",
  "resultsPerPage": 10,
  "maxPagesPerQuery": 1,
  "mobileResults": false,
  "forceExactMatch": false,
  "includePeopleAlsoAsk": true,
  "includeRelatedSearches": true,
  "saveHtmlToKeyValueStore": false,
  "extractAds": false
}
```

# Actor output Schema

## `defaultDataset` (type: `string`):

One record per Google SERP page. Each record contains organic results, paid ads, People Also Ask (with pre-rendered first answer + attribution), related queries, featured snippet, AI Overview body text and source citations, results total, and pagination metadata.

# 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": [
        "best CRM software",
        "python web scraping"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("santamaria-automations/google-search-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "queries": [
        "best CRM software",
        "python web scraping",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("santamaria-automations/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 '{
  "queries": [
    "best CRM software",
    "python web scraping"
  ]
}' |
apify call santamaria-automations/google-search-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Search Scraper: $1.50/1k SERP pages",
        "description": "Scrape Google search at $1.50 per 1,000 SERP pages, 40% cheaper than the leading Apify alternative. Returns organic results, paid ads, People Also Ask with pre-rendered answers, related queries, featured snippet, AI Overview body + sources. Built in Go.",
        "version": "1.0",
        "x-build-id": "0lpE11Y1dNyfIuEJn"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/santamaria-automations~google-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-santamaria-automations-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/santamaria-automations~google-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-santamaria-automations-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/santamaria-automations~google-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-santamaria-automations-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",
                "properties": {
                    "queries": {
                        "title": "Search Queries",
                        "type": "array",
                        "description": "Keywords or phrases to search on Google (one per line). Each runs as a separate search. Results across queries are returned in a single dataset.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "searchUrls": {
                        "title": "Google Search URLs",
                        "type": "array",
                        "description": "Optional: paste Google search URLs directly (e.g. https://www.google.com/search?q=python+tutorial&gl=us). All filters in the URL are preserved.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "countryCode": {
                        "title": "Country Code",
                        "type": "string",
                        "description": "ISO 3166-1 alpha-2 country code to localise the search (e.g. 'us', 'gb', 'de', 'au'). Determines which regional results Google returns.",
                        "default": "us"
                    },
                    "languageCode": {
                        "title": "Language Code",
                        "type": "string",
                        "description": "Language code for the SERP UI and results (e.g. 'en', 'de', 'fr', 'es'). Defaults to English.",
                        "default": "en"
                    },
                    "resultsPerPage": {
                        "title": "Results Per Page",
                        "minimum": 10,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Number of results to request per page (10 to 100). Default 10 gives the richest output (Google includes pre-rendered PAA answers, AI Overview source descriptions, and more on the smaller-num SERPs). Set to 100 if you want more results per request and don't mind a slimmer feature set.",
                        "default": 10
                    },
                    "maxPagesPerQuery": {
                        "title": "Max Pages Per Query",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "How many SERP pages to fetch per query. Increase to get more results (10 pages × 100 results = ~1,000 results per query).",
                        "default": 1
                    },
                    "mobileResults": {
                        "title": "Mobile Results",
                        "type": "boolean",
                        "description": "Use Google's mobile interface instead of desktop. Mobile SERPs sometimes show different result sets and ad placements.",
                        "default": false
                    },
                    "forceExactMatch": {
                        "title": "Force Exact Match",
                        "type": "boolean",
                        "description": "Wrap each query in quotes (\"...\") so Google only returns results containing the exact phrase. Equivalent to Google's verbatim mode.",
                        "default": false
                    },
                    "includePeopleAlsoAsk": {
                        "title": "Include People Also Ask",
                        "type": "boolean",
                        "description": "Extract the 'People Also Ask' questions shown on the first SERP page. Returned in the peopleAlsoAsk array of each page record.",
                        "default": true
                    },
                    "includeRelatedSearches": {
                        "title": "Include Related Searches",
                        "type": "boolean",
                        "description": "Extract related search suggestions from the bottom of the first SERP page. Returned in the relatedQueries array of each page record.",
                        "default": true
                    },
                    "saveHtmlToKeyValueStore": {
                        "title": "Save Raw HTML",
                        "type": "boolean",
                        "description": "Save the raw HTML of each SERP page to the default Key-Value Store. The output record will include a kvsHtmlUrl pointing at the saved file. Useful for debugging or extracting custom fields not parsed by the actor.",
                        "default": false
                    },
                    "extractAds": {
                        "title": "Extract Paid Results (Ads) Add-on",
                        "type": "boolean",
                        "description": "Enable comprehensive paid-results extraction. Google rotates ads aggressively, so the actor retries each query with rotated proxy sessions up to two more times and merges any new ads found. Adds one billable ads-extraction-attempt event per SERP page ($1.50 per 1,000 pages). Recommended only on queries where ads matter (commerce, comparison, lead-gen).",
                        "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
