# Google Search Results Scraper (`fastdataapi/google-search-results-scraper`) Actor

Google Search Results Scraper scrapes Google results pages: organic results with real URLs and snippets, People Also Ask, related searches, paid results and an optional AI Overview, any country and language.

- **URL**: https://apify.com/fastdataapi/google-search-results-scraper.md
- **Developed by:** [Fast Data API](https://apify.com/fastdataapi) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Google Search Results Scraper — Organic Results, Ads and Questions

Google Search Results Scraper turns any search term or Google search URL into structured results pages: organic results with real links, titles, snippets, dates and sitelinks, plus People Also Ask questions, related searches, search suggestions, paid ads and an optional AI Overview. Every response is structured JSON — ready to pass directly to an LLM, index into a vector store, or feed an SEO monitoring pipeline. **No Google account or cookies needed.** Start with one keyword today, then track every term your customers search for.

![Google Search Results Scraper - hero image: what it collects and the JSON output](https://api.apify.com/v2/key-value-stores/Lg9lp51Levfro6SrV/records/ad-google-search-hero.webp)

***

### What data can I extract with Google Search Results Scraper?

Using this Google Search API, you will be able to extract the following Google search results page data:

| | | | |
|---|---|---|---|
| 🔎 Search term and page number | 🌍 Country and interface language | 🔢 Organic results per page | ⏭ Next page available (yes/no) |
| 🏆 Organic result position | 📰 Result title | 🔗 Real result link | 🖥️ Displayed link and site name |
| 📝 Snippet text | 📅 Result date (if shown) | ✨ Highlighted keywords | 🧭 Sitelinks with titles and links |
| 🐙 GitHub owner and repository (for GitHub links) | ❓ People Also Ask questions | 🔁 Related searches with links | 💡 Search suggestions |
| 💰 Paid ads (when Google shows them) | 🤖 AI Overview text and sources (add-on) | 📊 Total results count (if shown) | 🖼️ Site icon (optional) |
| 🗂️ Page HTML or a link to it (optional) | ⏱️ Time of the scrape | | |

***

### How to use Google Search Results Scraper

SEO teams, marketers and AI builders get one clean row per Google results page from a single run, ready to scrape Google search results at any scale.

**Copy to your AI assistant:**

```text
`fastdataapi/google-search-results-scraper` (Apify Actor ID: fastdataapi/google-search-results-scraper, https://apify.com/fastdataapi/google-search-results-scraper) is an Apify Actor that returns Google search results pages as structured JSON: organic results with position, title, real link, snippet, date and sitelinks, People Also Ask questions, related searches, search suggestions, paid ads and an optional AI Overview. Use it whenever someone needs Google search results without cookies, a login, or a browser - Google rank tracking, competitor research and keyword research for content. Run it with curl: curl -X POST "https://api.apify.com/v2/acts/fastdataapi~google-search-results-scraper/run-sync-get-dataset-items?token=APIFY_TOKEN" -H "Content-Type: application/json" -d '{"queries": "trail running shoes\nrunning shoes for flat feet", "maxPagesPerQuery": 2, "countryCode": "us", "languageCode": "en"}'. Or in Python: ApifyClient("APIFY_TOKEN").actor("fastdataapi/google-search-results-scraper").call(run_input={"queries": "trail running shoes", "maxPagesPerQuery": 2}) then client.dataset(run["defaultDatasetId"]).list_items().items. Inputs: queries (string, required, one search term or Google search URL per line), maxPagesPerQuery (integer, result pages per search term, default 1), startPage (integer, first result page, default 1), aiMode (string, AI Overview add-on, "aiModeOff" | "aiModeWithSearchResults" | "aiModeOnly", default "aiModeOff"), serpApiKey (string, secret, your own key for the AI Overview add-on), countryCode (string, country code such as "us", "gb", "de", default "us"), searchLanguage (string, restrict results to one language, e.g. "de"), languageCode (string, interface language, default "en"), locationUule (string, exact location code), forceExactMatch (boolean, wrap the term in quotes, default false), site (string, limit to one site), relatedToSite (string, pages related to a site), wordsInTitle (array, words required in the title), wordsInText (array, words required in the text), wordsInUrl (array, words required in the URL), quickDateRange (string, e.g. "d7", "w2", "m6", "y1"), beforeDate (string, "YYYY-MM-DD" or e.g. "8 days"), afterDate (string, same format), fileTypes (array, e.g. "pdf" | "docx" | "xlsx"), includeUnfilteredResults (boolean, include results Google normally filters out, default false), saveHtml (boolean, add page HTML to each row, default false), saveHtmlToKeyValueStore (boolean, save page HTML to the key-value store and link it, default false), includeIcons (boolean, add site icons to organic results, default false), proxyConfiguration (object, proxy settings; leave the default). One dataset row is one results page with about 10 organic results and is billed as one row_result event. Positions continue across the pages of one search term and a link is listed once per search term; if a page cannot be loaded after retries, that search term stops and the others continue. Full input schema, every enum and default, and the complete output field list: GET https://api.apify.com/v2/acts/fastdataapi~google-search-results-scraper/builds/default
```

#### Google Search Results Scraper MCP Server: use these Actors from ChatGPT, Claude or Cursor

Point your AI assistant at this Actor and it can read Google on its own: organic results, People Also Ask questions, related searches, suggestions and paid ads for any keyword. No glue code, no scraping logic in your prompts.

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=fastdataapi/google-search-results-scraper"
```

#### Step by step

1. [Create a free Apify account](https://console.apify.com/sign-up).
2. Open [Google Search Results Scraper](https://apify.com/fastdataapi/google-search-results-scraper) in the Apify Store.
3. Type your keywords or paste Google search URLs, one per line. Google operators work as you type them (for example `AI site:twitter.com` or `javascript OR python`), and a Google search URL keeps its own settings (for example `tbm=nws` for News).
4. Click **Start** (or send your API request).
5. Download or stream your results in JSON, CSV or Excel.

#### How to get your SerpApi API key

You need this key only for the optional AI Overview add-on; search results work without it.

1. Sign up or log in at serpapi.com.
2. Open your Dashboard.
3. Copy the value shown under "Your Private API Key".
4. Paste it into **API key for the AI Overview add-on** and set **Add-on: Google AI Overview** to one of the "AI Mode" options.

The key is stored as a secret input and is never written to the log.

#### How to scale Google Search Results Scraper to bulk

For SERP data extraction at volume, put every search term on its own line in one run: the Actor works through 5 search terms at a time and saves each results page the moment it is ready. Raise **Max pages per search** to go deeper (10 pages is about 100 organic results per term) and use **Start page** to continue where a previous run stopped. For daily Google rank tracking, save the input as a task and schedule it, or call the API from your own scheduler.

***

### ✨ Features

Google Search Results Scraper fetches clean, structured results pages from Google Search. It's ideal for Google rank tracking, competitor monitoring, keyword research and feeding search context to AI agents. As a Google SERP scraper it also works as a People Also Ask scraper and, with the add-on, a Google AI Overview scraper: one row per page, the same schema every time.

It extracts, per organic result:

- **Position** – ranking order, continuing across pages of the same search term
- **Title** – the result's headline
- **Link** – the real destination link, not a Google redirect
- **Snippet** – the description text Google shows, with its highlighted keywords
- **Date** – the date Google prints in front of the snippet, when there is one
- **Sitelinks** – the extra links under a result, each with title and link
- **GitHub owner and repository** – filled automatically for GitHub repository links

⚡ Failed pages are retried automatically from new IP addresses, and a page that still fails stops only its own search term, never the run.

***

### Use cases 💡

- **SEO specialist** — track Google organic results and positions for a keyword list every day.
- **Content marketer** — mine People Also Ask questions and related searches for article ideas.
- **PPC manager** — see which competitors run paid ads on your money keywords.
- **Market researcher** — compare results by country and language for a launch.
- **AI engineer** — feed live results and snippets into a RAG pipeline as fresh context.

Building an AI agent? [Connect Google Search Results Scraper over MCP](#mcp-integration-for-ai-agents) and let it call the actor on its own.

***

### Why choose this actor?

- **Every results page in one row.** Each row holds up to eight kinds of data for one Google page: organic results, paid ads, People Also Ask questions, related searches, suggestions, the total results count, the next-page flag and the optional AI Overview.
- **Real links, not redirect stubs.** A recorded page for "python" came back with 6 organic results, each with its real link, displayed link, site name, snippet and highlighted keywords, plus sitelinks under the top result.
- **14 filters, 239 countries.** Exact match, site, related site, words in title, text or URL, file types, quick date range, before and after dates, unfiltered results, search language, interface language (83) and exact location, all applied to every search term.

***

### ⬇️ Input

![Google Search Results Scraper input form with example values](https://api.apify.com/v2/key-value-stores/Lg9lp51Levfro6SrV/records/ad-google-search-input.webp)

The Actor accepts one search term or Google search URL per line in **Search term(s)**; that field is required, everything else is optional.

| Parameter | Required | Type | Description | Example value |
|---|---|---|---|---|
| `queries` | Yes | string | Search terms or Google search URLs, one per line; Google operators allowed. | `trail running shoes` |
| `maxPagesPerQuery` | No | integer | Result pages to save per search term (one row each, about 10 organic results). Default 1, minimum 1. | `3` |
| `startPage` | No | integer | Result page to start from. Default 1. | `1` |
| `aiMode` | No | string | AI Overview add-on: `aiModeOff`, `aiModeWithSearchResults` (adds it to the page 1 row) or `aiModeOnly` (one row per term with just the AI Overview). Default `aiModeOff`. Needs `serpApiKey`. | `aiModeWithSearchResults` |
| `serpApiKey` | No | string (secret) | Your own SerpApi key for the AI Overview add-on. | `your-serpapi-key` |
| `countryCode` | No | string | Country the search is made from (239 options). Default `us`. | `gb` |
| `searchLanguage` | No | string | Only return pages in this language (36 options). Empty by default. | `de` |
| `languageCode` | No | string | Google interface language (83 options). Default `en`. | `en` |
| `locationUule` | No | string | Exact location code for local results. | `w+CAIQICINVW5pdGVkIFN0YXRlcw` |
| `forceExactMatch` | No | boolean | Wrap each term in quotes. Default `false`. | `false` |
| `site` | No | string | Limit results to one site (wins over `relatedToSite`). | `nike.com` |
| `relatedToSite` | No | string | Pages related to a site. | `adidas.com` |
| `wordsInTitle` | No | array | Words that must be in the title (max 32). Default empty. | `["review"]` |
| `wordsInText` | No | array | Words that must be in the page text (max 32). Default empty. | `["cushioning"]` |
| `wordsInUrl` | No | array | Words that must be in the URL (max 32). Default empty. | `["running"]` |
| `quickDateRange` | No | string | Recent results only: `h`, `d`, `w`, `m`, `y` plus a number, e.g. `d7`, `m6`. | `m6` |
| `beforeDate` | No | string | Results before a date (`YYYY-MM-DD`) or a relative date (`8 days`, `3 months`). | `2026-10-31` |
| `afterDate` | No | string | Results after a date, same format. | `2026-01-01` |
| `fileTypes` | No | array | File types joined with OR (40 options, max 10), e.g. `pdf`, `docx`, `xlsx`. Default empty. | `["pdf"]` |
| `includeUnfilteredResults` | No | boolean | Include results Google normally filters out. Default `false`. | `false` |
| `saveHtml` | No | boolean | Add the page HTML to each row. Default `false`. | `false` |
| `saveHtmlToKeyValueStore` | No | boolean | Save the page HTML to the key-value store and link it in each row. Default `false`. | `false` |
| `includeIcons` | No | boolean | Add the site icon to each organic result. Default `false`. | `false` |
| `proxyConfiguration` | No | object | Proxy settings; leave the default for reliable results. | `{"useApifyProxy": true}` |

#### Free plan limits

Users on the Apify free plan can fetch up to 20 result pages per run (all search terms together) and 200 result pages per month. When the limit is reached, the run finishes successfully with a status message explaining the limit. Upgrade to any paid Apify plan to remove these limits.

#### Example input

```json
{
  "queries": "trail running shoes\nrunning shoes for flat feet",
  "maxPagesPerQuery": 3,
  "startPage": 1,
  "aiMode": "aiModeWithSearchResults",
  "serpApiKey": "your-serpapi-key",
  "countryCode": "gb",
  "searchLanguage": "en",
  "languageCode": "en",
  "locationUule": "w+CAIQICIOVW5pdGVkIEtpbmdkb20",
  "forceExactMatch": false,
  "site": null,
  "relatedToSite": null,
  "wordsInTitle": ["review"],
  "wordsInText": [],
  "wordsInUrl": [],
  "quickDateRange": "m6",
  "beforeDate": null,
  "afterDate": null,
  "fileTypes": [],
  "includeUnfilteredResults": false,
  "saveHtml": false,
  "saveHtmlToKeyValueStore": false,
  "includeIcons": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

***

### ⬆️ Output

![Google Search Results Scraper output fields with example values](https://api.apify.com/v2/key-value-stores/Lg9lp51Levfro6SrV/records/ad-google-search-output.webp)

Every Google results page is one typed, normalized JSON item with the same schema on every run; export it as JSON (default), CSV or Excel. People Also Ask answers load only on click, so their answer, link, title and date stay empty, and the paid products list is always empty (Google shopping ads are not collected).

#### Example output

A real row from a test run, shortened to 2 organic results:

```json
{
  "searchQuery": {
    "term": "python",
    "url": "https://www.google.com/search?q=python&hl=en&gl=us",
    "device": "DESKTOP",
    "page": 1,
    "type": "SEARCH",
    "domain": "google.com",
    "countryCode": "US",
    "languageCode": "en",
    "locationUule": null,
    "resultsPerPage": 6
  },
  "searchQueryTerm": "python",
  "url": "https://www.google.com/search?q=python&hl=en&gl=us",
  "hasNextPage": true,
  "resultsTotal": null,
  "relatedQueries": [
    {"title": "Python download", "url": "https://www.google.com/search?q=Python+download&hl=en&gl=us"},
    {"title": "Python online", "url": "https://www.google.com/search?q=Python+online&hl=en&gl=us"}
  ],
  "paidResults": [],
  "paidProducts": [],
  "aiOverview": null,
  "organicResults": [
    {
      "position": 1,
      "title": "Welcome to Python.org",
      "url": "https://www.python.org/",
      "displayedUrl": "https://www.python.org",
      "siteName": "Python.org",
      "description": "Get Started. Whether you're new to programming or an experienced developer, it's easy to learn and use Python. Start with our Beginner's Guide. Download. Python ...",
      "date": null,
      "emphasizedKeywords": ["Python"],
      "siteLinks": [
        {"title": "Downloads", "url": "https://www.python.org/downloads/", "description": "The official home of the Python Programming Language."},
        {"title": "Python Releases for Windows", "url": "https://www.python.org/downloads/windows/", "description": "The official home of the Python Programming Language."}
      ],
      "type": "organic",
      "urlSource": "resolved",
      "isGithubRepo": false,
      "githubOwner": null,
      "githubRepo": null
    },
    {
      "position": 2,
      "title": "Python (programming language)",
      "url": "https://en.wikipedia.org/wiki/Python_(programming_language)",
      "displayedUrl": "https://en.wikipedia.org › wiki › Python_(programming...",
      "siteName": "Wikipedia",
      "description": "Python is a high-level, general-purpose programming language that emphasizes code readability, simplicity, and ease-of-writing with the use of significant ...",
      "date": null,
      "emphasizedKeywords": ["Python"],
      "siteLinks": [],
      "type": "organic",
      "urlSource": "resolved",
      "isGithubRepo": false,
      "githubOwner": null,
      "githubRepo": null
    }
  ],
  "suggestedResults": [
    {"title": "python download", "url": "https://www.google.com/search?q=python+download", "type": "suggestion", "position": 1},
    {"title": "python snake", "url": "https://www.google.com/search?q=python+snake", "type": "suggestion", "position": 2}
  ],
  "peopleAlsoAsk": [
    {"question": "What exactly is Python used for?", "answer": null, "url": null, "title": null, "date": null},
    {"question": "Is Python difficult to learn?", "answer": null, "url": null, "title": null, "date": null}
  ],
  "scrapedAt": "2026-11-17T10:54:00.083858+00:00",
  "htmlSnapshotUrl": null
}
```

***

### How does it work?

The Actor sends each search to Google through rotating proxies built for search pages, using plain HTTP requests, no browser. When Google answers with a check page or an error, the page is retried automatically, with up to four tries per page, each from a new IP address. Result links that Google hides behind a redirect are followed to their real destination, so every organic result carries the page it points to. Search suggestions come from Google's public suggestion list for the same term. It returns only publicly visible data — what any visitor sees without logging in — and the output schema stays the same even when Google changes its page layout. The optional AI Overview comes from your own key with the add-on service and is added to the first page of each search term.

***

### How do you integrate Google Search Results Scraper into your stack?

It works with what you already use: the REST API from any language, MCP for AI agents, and no-code tools such as n8n and Make.

#### Using Google Search Results Scraper with the Apify API

```python
import requests

items = requests.post(
    "https://api.apify.com/v2/acts/fastdataapi~google-search-results-scraper/run-sync-get-dataset-items",
    params={"token": "APIFY_TOKEN"},
    json={"queries": "trail running shoes\nrunning shoes for flat feet", "maxPagesPerQuery": 2, "countryCode": "us"},
).json()
for page in items:
    for result in page["organicResults"]:
        print(result["position"], result["url"])
```

*Works in Go, Ruby, Node.js, cURL — any language that can make an HTTP request.*

#### MCP integration for AI agents

Add the Actor to your MCP client with one command:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=fastdataapi/google-search-results-scraper"
```

This registers Google Search Results Scraper as a tool your agent can call directly. It works in Claude Code, Cursor and Windsurf, so an agent can look up live Google results, People Also Ask questions and related searches in the middle of a task.

#### No-code tools (n8n, Make, LangChain)

- **n8n** — use the Apify node with "Run an Actor" and the ID `fastdataapi/google-search-results-scraper`, or the HTTP Request node pointed at the run-sync endpoint above with your token.
- **Make** — add the Apify app's "Run an Actor" module, then "Get Dataset Items" to pass each results page to the next step.
- **LangChain** — install `langchain-apify` and use `ApifyActorsTool("fastdataapi/google-search-results-scraper")` as a tool for your agent.

***

### Is it legal to scrape Google data?

Scraping publicly available Google search results is generally legal, because the pages are shown to anyone without logging in. Google Search Results Scraper returns only publicly available data — what any user sees without logging in. Under GDPR and similar laws, collecting public data is generally permissible, but storing and using it, especially any personal data inside snippets, must comply with local data-protection law. Consult legal counsel if your use case involves bulk storage of personal data.

***

### Frequently asked questions

#### What fields does Google Search Results Scraper return?

Each row is one results page with the organic results (position, title, real link, snippet, date, sitelinks), People Also Ask questions, related searches, search suggestions and paid ads, plus an optional AI Overview. See [the data fields section](#what-data-can-i-extract-with-google-search-results-scraper) for the full list.

#### Does Google Search Results Scraper require a Google account or login?

No. Only public search results are extracted and no Google credentials are needed. The only key you may add is your own add-on key, and only if you want the AI Overview.

#### What happens if a search returns nothing or a page cannot be loaded?

A search with no results saves a row with an empty organic results list. A page that still fails after its retries stops that search term only; the other terms continue and the run still finishes successfully, with the reason in the log.

#### Can I scrape multiple Google searches at once?

Yes. Put one search term or Google search URL per line in **Search term(s)**; 5 terms run at the same time and every results page is saved as soon as it is ready.

#### Does Google Search Results Scraper work with Claude, ChatGPT, and other AI agent tools?

Yes — Google Search Results Scraper is available as an MCP tool. Register it in Claude Code, Cursor or Windsurf with:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=fastdataapi/google-search-results-scraper"
```

Any agent that can call an HTTP endpoint can use the REST API directly.

#### Does Google Search Results Scraper return data in a format LLMs can use directly?

Yes. Every row is typed, normalized JSON with consistent field names. No HTML parsing, no selectors. Pass it straight to an LLM, index it into a vector store, or feed it to an agent tool — no transformation step.

#### What happens when Google changes its layout or updates its anti-bot system?

The Actor is maintained by its team. When Google changes, the Actor is updated — your calls keep returning the same JSON schema with no changes on your end.

#### Can I use Google Search Results Scraper without managing proxies or browser infrastructure?

Yes. Proxy rotation and retries from new IP addresses run on the Actor's side. You send one request and get structured JSON back. No proxy accounts, no headless browser setup, no maintenance.

#### Which Google search fields work best for AI training data and RAG indexing?

For RAG, use the text-rich fields: the result titles, snippets, People Also Ask questions and the AI Overview text. For training data and analytics, use the position, the total results count, the next-page flag and the GitHub repository flag. Values are typed strings, integers, booleans and lists, so no normalization is needed.

#### How many results do I get per page?

About 10 organic results per page; Google decides the page size, and some first pages hold fewer because Google fills them with other boxes. A link already listed on an earlier page of the same search term is not repeated, and positions keep counting across pages.

***

### Related scrapers

| Scraper | What it extracts |
|---|---|
| [Google Search Autocomplete Scraper](https://apify.com/fastdataapi/google-search-autocomplete-scraper) | Google autocomplete suggestions for keywords |
| [Google News Scraper](https://apify.com/fastdataapi/google-news-scraper) | News articles from Google News |
| [Google Scholar Scraper](https://apify.com/fastdataapi/google-scholar-scraper) | Academic papers with citations and DOIs |
| [Google Patents Scraper](https://apify.com/fastdataapi/google-patents-scraper) | Patent records from Google Patents |
| [Baidu Search Scraper](https://apify.com/fastdataapi/baidu-search-scraper) | Search results from Baidu |

***

### Your feedback

Found a bug or missing a field? Let us know on the Issues tab of this Actor's page. The team reads every report and ships fixes, and you can export Google search results the same way after every update.

# Actor input Schema

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

Use regular search words or enter Google Search URLs. You can also apply advanced Google search techniques, such as AI site:twitter.com or javascript OR python. You can also define selected search filters as separate fields below (in the Advanced search filters section). Just ensure that your queries do not exceed 32 words to comply with Google Search limits.

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

Maximum number of result pages to save per search term (each page is one dataset row with about 10 organic results). For about 100 results set 10. Free plan: up to 20 result pages per run (all search terms together) and 200 per month; paid plans have no limit.

## `startPage` (type: `integer`):

Result page to start from (1 = first page). Useful to continue a previous run.

## `aiMode` (type: `string`):

Adds Google's AI Overview for each search term (needs your own API key below). 'With search results' adds it to the page 1 row; 'Only' saves just the AI Overview, one row per search term.

## `serpApiKey` (type: `string`):

Your own SerpApi key (serpapi.com > Dashboard > Your Private API Key). Used only when the AI Overview add-on is on; without a key the AI Overview stays empty (null) and the run returns search results only.

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

Country the search is made from. By default, the Actor searches from the United States.

## `searchLanguage` (type: `string`):

Restricts search results to pages in a specific language. For example, choosing 'German' returns only pages in German.

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

Language of the Google Search interface (menus, buttons, etc. - not the search results themselves). It may also affect the results of international queries when no search language is set.

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

The UULE code of the exact location to search from, for local results. Leave empty to search from the selected country only.

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

If checked, the scraper will search for the exact phrase in the query. This is done by wrapping the query in quotes. Note that this may return fewer results. Also note that if you're using operators such as OR or AND, the whole query will be wrapped in quotes, such as "Windows AND macOS". If you want to search for queries such as "Windows" AND "macOS", you need to specify them directly in the queries field.

## `site` (type: `string`):

Limits the search to a specific site, such as: site:example.com. Note that the site filter takes precedence over the relatedToSite filter. If both filters are set, the relatedToSite filter will be ignored and not added to the search queries.

## `relatedToSite` (type: `string`):

Filters pages related to a specific site, such as: related:example.com. Note that the site filter takes precedence over the relatedToSite filter. If both filters are set, the relatedToSite filter will be ignored and not added to the search queries.

## `wordsInTitle` (type: `array`):

Filters pages with specific words in the title. The scraper uses the intitle: operator, even for multiple words (e.g. recipe site:allrecipes.com intitle:"easy apple" intitle:pie). There's also a allintitle: operator available, but it's problematic when combined with other search filters, so the scraper avoids using it. If you need to use the allintitle: operator specifically, you can include it in your custom queries from the queries field.

## `wordsInText` (type: `array`):

Filters pages with specific words in the text. The scraper uses the intext: operator, even for multiple words (e.g. cartoon site:wikipedia.com intext:cat intext:mouse). There's also a allintext: operator available, but it's problematic when combined with other search filters, so the scraper avoids using it. If you need to use the allintext: operator specifically, you can include it in your custom queries from the queries field.

## `wordsInUrl` (type: `array`):

Filters pages with specific words in the URL. The scraper uses the inurl: operator, even for multiple words (e.g. recipe site:allrecipes.com inurl:apple inurl:pie). There's also a allinurl: operator available, but it's problematic when combined with other search filters, so the scraper avoids using it. If you need to use the allinurl: operator specifically, you can include it in your custom queries from the queries field.

## `quickDateRange` (type: `string`):

Filters results from a specific date range. d\[number] specifies the number of past days (e.g. the past 10 days can be written as d10). The same applies to hours, weeks, months, and years: h\[number], w\[number], m\[number], y\[number]. Example for the past year: 'y1' or even 'y'. You should avoid combining this filter with the beforeDate and afterDate filters to prevent conflicts.

## `beforeDate` (type: `string`):

Filters results from before the specified date. Either absolute date (e.g. 2024-05-03) or relative date from now into the past (e.g. 8 days, 3 months). Absolute time is always interpreted in the UTC timezone, not your local timezone - please convert accordingly. Supported relative date & time units: days, weeks, months, years. You should avoid combining this filter with the quickDateRange filter to prevent conflicts.

## `afterDate` (type: `string`):

Filters results from after the specified date. Either absolute date (e.g. 2024-05-03) or relative date from now into the past (e.g. 8 days, 3 months). Absolute time is always interpreted in the UTC timezone, not your local timezone - please convert accordingly. Supported relative date & time units: days, weeks, months, years. You should avoid combining this filter with the quickDateRange filter to prevent conflicts.

## `fileTypes` (type: `array`):

Filters results of specific file types using the filetype: operator, such as filetype:pdf. You can select multiple file types as well. They will be combined with the OR operator, for example: filetype:doc OR filetype:txt. If you need to use a file type that is not in the list (such as a source code file type), you can include it in your custom queries from the queries field, using the filetype: operator.

## `includeUnfilteredResults` (type: `boolean`):

If checked the lower quality results that Google normally filters out will be included.

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

If checked the HTML of the Google Search results pages will be stored to the default dataset, under the html property. This is useful if you need to process the HTML, but it makes the dataset large.

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

If checked the HTML of the Google Search results pages will be stored to the default key-value store and links to the files stored to the dataset under the htmlSnapshotUrl property. This is useful for debugging since you can easily view the pages in the browser. However, the use of this feature may slow down the Actor.

## `includeIcons` (type: `boolean`):

If checked, each organic result also gets an icon field with the site icon Google shows next to it (usually Base64-encoded image data), or null when none is found.

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

Leave the default for the best results. Pages that fail are retried automatically from new IP addresses.

## Actor input object example

```json
{
  "queries": "javascript\ntypescript\npython",
  "maxPagesPerQuery": 1,
  "startPage": 1,
  "aiMode": "aiModeOff",
  "countryCode": "us",
  "languageCode": "en",
  "forceExactMatch": false,
  "wordsInTitle": [],
  "wordsInText": [],
  "wordsInUrl": [],
  "fileTypes": [],
  "includeUnfilteredResults": false,
  "saveHtml": false,
  "saveHtmlToKeyValueStore": false,
  "includeIcons": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "GOOGLE_SERP"
    ]
  }
}
```

# Actor output Schema

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

Default view: search term, totals, related queries, AI overview, paid results/products, organic results, and People Also Ask, one row per scraped page.

## `organicResults` (type: `string`):

Search query plus the organic (non-paid) result listings for each scraped page.

## `paidResults` (type: `string`):

Search query plus any paid ad results (Google Ads) found on each scraped page.

## `aiModeResults` (type: `string`):

Search query plus the AI Overview content, when the AI Mode add-on returned one.

## `allFields` (type: `string`):

Every field on every row, including pagination info, HTML snapshot links, and raw HTML (when saveHtml 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": `javascript
typescript
python`,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "GOOGLE_SERP"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("fastdataapi/google-search-results-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": """javascript
typescript
python""",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["GOOGLE_SERP"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("fastdataapi/google-search-results-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": "javascript\\ntypescript\\npython",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "GOOGLE_SERP"
    ]
  }
}' |
apify call fastdataapi/google-search-results-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fastdataapi/google-search-results-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/3aMfoVkXOb5noNIZ5/builds/721xHaGjAadhffArZ/openapi.json
