# Google Search Results Scraper: SERP API, Exact Site Filter (`h1018y/anvil-google-search-api`) Actor

Scrapes Google Search results pages. Give it search queries (and optional site, country, language, date or file-type filters); get one row per results page with the organic results (title, real link, snippet, date), related searches and an off-site count.

- **URL**: https://apify.com/h1018y/anvil-google-search-api.md
- **Developed by:** [ANVIL Tools](https://apify.com/h1018y) (community)
- **Categories:** SEO tools, Marketing, Lead generation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.62 / 1,000 results

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

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

## What's an Apify Actor?

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

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

## How to integrate an Actor?

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

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

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

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

# README

## Google Search Results Scraper: SERP API, Exact Site Filter

**google search results scraper** - Google results for any query with a site filter that really keeps to your site, the real result links and an only-new mode.

### What does google search results scraper do?

Ask for one site and you get only that site - every page row says how many off-site results were left out - with the real link of each result, the same input and result names as the most used Google Search Scraper, and onlyNew for rank tracking.

- Site filter that keeps only the asked site(s), with offSiteDropped on every page row
- Real result links (Google's coded links are resolved)
- Same input and result field names as the most used Google Search Scraper - switch without code changes
- onlyNew: on a schedule, only results not seen before (rank tracking, new mentions)
- Country, language, date range, file type, exact match and words-in-title options

### Who uses google search results scraper, and for what

- SEO teams - track where a site ranks for its keywords every day with onlyNew
- Brand monitoring - new pages about a name on chosen sites
- Researchers - collect result lists for many queries with country and date filters
- Developers - call it from code with the same fields as the most used tool

### What this google search results scraper does that users of the usual tools ask for

- **Only the asked site comes back, and every page says how many off-site results were left out** - in the `offSiteDropped` field
- **Valid results not dropped under a domain filter** - in the `organicResults` field
- **A run that finishes with rows, never 37 minutes for nothing** - in the `searchQuery` field

#### Switching takes one minute

The input and result field names are the ones the most used google search results scraper has, so the input JSON your code already sends works unchanged and your pipeline reads the same fields - plus the new ones above.

### Why this google search results scraper?

Tools that mix in other sites or stall on big batches make users re-check every row. This google search results scraper checks every run and tells you plainly when a page could not be read, instead of returning empty or wrong rows.

### Data you get from google search results scraper

Every result is one flat row with these fields (values from a real run):

| Field | Example |
|---|---|
| `searchQuery` | {"term": "python tutorial", "page": 1, "type": "SEARCH", "do... |
| `url` | https://www.google.com/search?q=python+tutorial+%28site%3Are... |
| `hasNextPage` | true |
| `resultsTotal` | null |
| `organicResults` | \[{"title": "The Python Tutorial — Python 3.15.2 documentatio... |
| `paidResults` | \[] |
| `peopleAlsoAsk` | \[] |
| `relatedQueries` | \[] |
| `changeType` | new |
| `resultsTotalCount` | null |
| `offSiteDropped` | 4 |
| `aiOverview` | null |

### How to use google search results scraper

1. Press **Start** - the form already holds an example that works.
2. Put in your own input (see the fields on the Input tab).
3. Run it once, or put it on an **Apify Schedule** (with **only new** on, where the form has it) to get just what is new every day; add a **webhookUrl** to get each run's rows sent to your own system, Zapier, Make or Slack.
4. Download the results as JSON, CSV or Excel, or send them to Google Sheets, Zapier, Make, the Apify API or an AI agent (Apify MCP server).

#### Input example

```json
{
  "queries": "web scraping tools",
  "maxPagesPerQuery": 1,
  "aiOverview": {},
  "aiModeSearch": {},
  "geminiSearch": {},
  "perplexitySearch": {},
  "chatGptSearch": {},
  "copilotSearch": {},
  "maximumLeadsEnrichmentRecords": 0,
  "leadsEnrichmentDepartments": [],
  "verifyLeadsEnrichmentEmails": false,
  "linkProspecting": {},
  "websiteContentScraper": {},
  "focusOnPaidAds": false,
  "countryCode": "",
  "searchLanguage": "",
  "languageCode": "en",
  "forceExactMatch": false,
  "site": "",
  "relatedToSite": "",
  "wordsInTitle": [],
  "wordsInText": [],
  "wordsInUrl": [],
  "quickDateRange": "",
  "beforeDate": "",
  "afterDate": "",
  "fileTypes": [],
  "mobileResults": false,
  "includeUnfilteredResults": false,
  "saveHtml": false,
  "saveHtmlToKeyValueStore": false,
  "includeIcons": false,
  "useApifyProxy": true,
  "proxyGroups": [
    "GOOGLE_SERP"
  ],
  "onlyNew": false,
  "maxRunMinutes": 20
}
```

#### Output example (a real run)

```json
[
  {
    "searchQuery": {
      "term": "python tutorial",
      "page": 1,
      "type": "SEARCH",
      "domain": "google.com",
      "countryCode": "",
      "languageCode": "en",
      "locationUule": null,
      "resultsPerPage": 10,
      "mobile": false
    },
    "url": "https://www.google.com/search?q=python+tutorial+%28site%3Arealpython.com+OR+site%3Adocs.python.org%29&hl=en&num=10&gl=us",
    "hasNextPage": true,
    "resultsTotal": null,
    "organicResults": [
      {
        "title": "The Python Tutorial — Python 3.15.2 documentation",
        "url": "https://docs.python.org/3/tutorial/index.html",
        "displayedUrl": "https://docs.python.org › tutorial",
        "description": "This tutorial is designed for programmers that are new to the Python language , not beginners who are new to programming.",
        "emphasizedKeywords": [
          "programmers that are new to the Python language"
        ],
        "siteLinks": [],
        "type": "organic",
        "position": 1,
        "date": null
      },
      {
        "title": "3. An Informal Introduction to Python",
        "url": "https://docs.python.org/3/tutorial/introduction.html",
        "displayedUrl": "https://docs.python.org › tutorial › introduction",
        "description": "An Informal Introduction to Python ¶ Python supports other types of numbers, such as Decimal and Fraction . This example introduces several new features. In ...",
        "emphasizedKeywords": [
          "Python"
        ],
        "siteLinks": [],
        "type": "organic",
        "position": 2,
        "date": null
      },
      {
        "title": "Real Python: Build Real-World Python Skills",
        "url": "https://realpython.com/",
        "displayedUrl": "https://realpython.com",
        "description": "Build real-world Python skills by doing: expert-written tutorials with interactive quizzes and coding exercises, video courses, and an AI mentor",
        "emphasizedKeywords": [
          "expert-written tutorials"
        ],
        "siteLinks": [],
        "type": "organic",
        "position": 3,
        "date": null
      },
      {
        "title": "5. Data Structures — Python 3.15.2 documentation",
        "url": "https://docs.python.org/3/tutorial/datastructures.html",
        "displayedUrl": "https://docs.python.org › tutorial › datastructures",
        "description": "Python also includes a data type for sets. A set is an unordered collection with no duplicate elements. Basic uses inclu
```

One flat row per result.

### Built for pipelines

- **Field names never change** - fixes and new features only ever add fields, so your code keeps working.
- **Every row has the same shape** - a missing value is `null`, never a dropped field.
- **A plain status line** on every run - how many results, and on a problem what to change in the input - for your logs and for AI agents.
- **Runs on its own** - put it on an Apify Schedule and add a `webhookUrl`: each run's rows go straight to your system, Zapier, Make or Slack.

### How much does google search results scraper cost?

You pay only per result (pay per event) - no monthly fee, no minimum, and the price per result is lower on Apify's Bronze, Silver and Gold plans. The exact price is on the **Pricing** tab. Apify's free plan credit is enough to try it on real input.

| You want | What you pay for |
|---|---|
| A quick test with the example | a few results |
| A daily scheduled run | only the rows that run returns |
| A big one-off export | the results delivered - set a maximum in the input |

### Also searched as

- google search scraper
- google serp api
- serp scraper
- google rank tracker
- site search scraper

### FAQ

**Does google search results scraper need a login, cookies or an API key?** No. It reads public pages only.

**Can I run google search results scraper on a schedule?** Yes - with Apify Schedules; each run returns fresh rows.

**Can I call it from Python, JavaScript or an AI agent?** Yes - through the Apify API, the Apify client libraries or the Apify MCP server.

**Is it legal?** It collects only data anyone can see without logging in. You are responsible for using it within the source site's terms and data protection law (GDPR, CCPA).

**What if the site blocks a request?** The run retries from a fresh connection and, if it still cannot read the page, stops with a clear message - never with made-up rows.

**Do I need proxies?** No setup needed - google search results scraper uses Apify Proxy by default where the site needs it.

### Troubleshooting

- **No results:** check the input (a public URL or a search term that returns results in a normal browser), then try the example input once.
- **Fewer results than expected:** raise the maximum in the input; some sites show only a part of their data without logging in, and google search results scraper never logs in.
- **The run stopped with a message:** the message says what the site answered; run it again later or with fewer items.

### Your feedback

Missing a field, found a bug, or need another site? Open an issue on the **Issues** tab - issues are answered and fixed. If google search results scraper saved you time, a short review on this page helps others find it.

Data source: [www.google.com](https://www.google.com)

### More tools from this developer

- [Tweet Scraper for Twitter & X Posts: By URL, No Login](https://apify.com/h1018y/anvil-tweet-scraper)
- [YouTube Thumbnail Downloader: Bulk, Every Size & Titles](https://apify.com/h1018y/anvil-youtube-thumbnail-downloader)
- [ML Conference Finder: NeurIPS, ICLR & ICML Alternatives](https://apify.com/h1018y/anvil-ml-conference-finder)
- [YouTube Transcript & Captions Scraper: Find Any Word Said](https://apify.com/h1018y/anvil-youtube-transcript-scraper)
- [Facebook Ads Library Scraper & Meta Ad Spy: Only New Ads](https://apify.com/h1018y/anvil-facebook-ads-library-scraper)
- [Reddit Scraper: Keyword Alerts for New Posts & Comments](https://apify.com/h1018y/anvil-reddit-scraper)
- [Twitter Scraper: New Tweets From Any X Account, No Login](https://apify.com/h1018y/anvil-twitter-scraper)
- [Facebook Page & Posts Scraper: New Posts & Engagement Growth](https://apify.com/h1018y/anvil-facebook-posts-scraper)

# Actor input Schema

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

Google searches, one per line, for example: web scraping tools. Every line is searched on its own.

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

How many result pages to read for each query; every page holds about 10 results, for example 2.

## `aiOverview` (type: `object`):

Kept for compatibility: AI answers are not returned.

## `aiModeSearch` (type: `object`):

Kept for compatibility: AI answers are not returned.

## `geminiSearch` (type: `object`):

Kept for compatibility: not supported, leave empty.

## `perplexitySearch` (type: `object`):

Kept for compatibility: not supported, leave empty.

## `chatGptSearch` (type: `object`):

Kept for compatibility: not supported, leave empty.

## `copilotSearch` (type: `object`):

Kept for compatibility: not supported, leave empty.

## `maximumLeadsEnrichmentRecords` (type: `integer`):

Kept for compatibility: people and e-mail lookups are not offered.

## `leadsEnrichmentDepartments` (type: `array`):

Kept for compatibility: people and e-mail lookups are not offered.

## `verifyLeadsEnrichmentEmails` (type: `boolean`):

Kept for compatibility: people and e-mail lookups are not offered.

## `linkProspecting` (type: `object`):

Kept for compatibility: not supported, leave empty.

## `websiteContentScraper` (type: `object`):

Kept for compatibility: result pages are not opened, only the search page is read.

## `focusOnPaidAds` (type: `boolean`):

Kept for compatibility: paid results are always returned when Google shows them.

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

Two-letter country the search is made from, for example us or de. Empty means the proxy country.

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

Restrict results to a language by its two-letter code, for example en or de. Empty means any.

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

Two-letter language of the Google page, for example en. This is the default.

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

Optional Google UULE location code that makes results local to a place. Leave empty for none.

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

Turn on to search the whole query as one exact phrase in quotes.

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

Only return results from these websites, written like apify.com or several separated by commas: github.com, gitlab.com. Results from other domains are dropped.

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

Return sites similar to this one, for example apify.com.

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

Words that must appear in the page title, one per line, for example pricing.

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

Words that must appear in the page text, one per line, for example scraper.

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

Words that must appear in the page address, one per line, for example blog.

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

Only results from the last hour (h), day (d), week (w), month (m) or year (y), written like d1 or w1. Empty means any time.

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

Only results before this date, written as YYYY-MM-DD, for example 2025-06-30.

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

Only results after this date, written as YYYY-MM-DD, for example 2025-01-01.

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

Only results with these file types, one per line, for example pdf.

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

Turn on to read the phone version of the Google result page.

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

Turn on to also see results Google normally hides as near duplicates.

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

Kept for compatibility: the page HTML is not saved.

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

Kept for compatibility: the page HTML is not saved.

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

Kept for compatibility: result icons are not returned.

## `useApifyProxy` (type: `boolean`):

Send requests through the Apify proxy; the site usually refuses plain data center traffic.

## `proxyGroups` (type: `array`):

Apify proxy groups for the Google requests. Keep GOOGLE_SERP (Apify's Google search proxy); other groups get a CAPTCHA.

## `onlyNew` (type: `boolean`):

Turn on to return only results not seen in the previous run with the same input; good for a schedule.

## `maxRunMinutes` (type: `number`):

Stops the run after this many minutes and keeps the rows already found, for example 10. Default 20.

## `webhookUrl` (type: `string`):

Optional. An https address - your own system, Zapier, Make or a Slack incoming webhook - that gets each run's results as JSON (with 'only new' on: just the new ones). Example: https://hooks.slack.com/services/T000/B000/XXXX

## Actor input object example

```json
{
  "queries": "web scraping tools",
  "maxPagesPerQuery": 1,
  "aiOverview": {},
  "aiModeSearch": {},
  "geminiSearch": {},
  "perplexitySearch": {},
  "chatGptSearch": {},
  "copilotSearch": {},
  "maximumLeadsEnrichmentRecords": 0,
  "leadsEnrichmentDepartments": [],
  "verifyLeadsEnrichmentEmails": false,
  "linkProspecting": {},
  "websiteContentScraper": {},
  "focusOnPaidAds": false,
  "countryCode": "",
  "searchLanguage": "",
  "languageCode": "en",
  "forceExactMatch": false,
  "site": "",
  "relatedToSite": "",
  "wordsInTitle": [],
  "wordsInText": [],
  "wordsInUrl": [],
  "quickDateRange": "",
  "beforeDate": "",
  "afterDate": "",
  "fileTypes": [],
  "mobileResults": false,
  "includeUnfilteredResults": false,
  "saveHtml": false,
  "saveHtmlToKeyValueStore": false,
  "includeIcons": false,
  "useApifyProxy": true,
  "proxyGroups": [
    "GOOGLE_SERP"
  ],
  "onlyNew": false,
  "maxRunMinutes": 20
}
```

# Actor output Schema

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

All result rows (open as table, JSON, CSV or Excel).

# 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": "web scraping tools",
    "maxPagesPerQuery": 1,
    "useApifyProxy": true,
    "proxyGroups": [
        "GOOGLE_SERP"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("h1018y/anvil-google-search-api").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": "web scraping tools",
    "maxPagesPerQuery": 1,
    "useApifyProxy": True,
    "proxyGroups": ["GOOGLE_SERP"],
}

# Run the Actor and wait for it to finish
run = client.actor("h1018y/anvil-google-search-api").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": "web scraping tools",
  "maxPagesPerQuery": 1,
  "useApifyProxy": true,
  "proxyGroups": [
    "GOOGLE_SERP"
  ]
}' |
apify call h1018y/anvil-google-search-api --silent --output-dataset

```

## MCP server setup

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

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/IfdO2sz17HDP0CF85/builds/pq2NbnHtJZTJqWgX2/openapi.json
