# Google Search Results Scraper (SERP, Rank Tracking) (`locaihost/google-search`) Actor

Google's organic search results for any keyword: position, title, link, snippet, date and sitelinks for 44 countries, with rank change since your last run and an only-new mode. One free summary row per query carries People also ask, the AI Overview and related searches.

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

## Pricing

from $1.65 / 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, Rank Tracking)

Get Google's organic web results for any keyword: position, title, link, snippet, date and sitelinks, in 44 countries. Each run remembers where every link ranked, so the next run shows what moved up, what dropped and what is new. Every query's summary row also carries what Google shows around the results: People also ask, the AI Overview and related searches.

### How do I start?

Paste this into the input (JSON tab) and press Start:

```json
{
    "queries": ["best crm for small business"],
    "country": "us"
}
```

One query takes about 10 to 20 seconds and returns Google's first results page, 10 results, plus one free summary row.

### What does each row contain?

| Field | What it is |
|---|---|
| `query` | The query from your input |
| `position` | 1-based position across the pages read (page 2's first result is 11) |
| `page`, `pagePosition` | The Google results page the row came from, and the position on it |
| `title`, `url`, `displayedUrl` | The result as Google shows it |
| `domain` | The link's domain |
| `description` | The snippet |
| `date` | The date Google shows before the snippet, when it shows one, as shown |
| `dateIso` | The same date as an ISO date when it can be worked out ("2 days ago" counts back from the run) |
| `sitelinks` | Extra links Google shows under the result (title and url) |
| `previousPosition`, `positionChange` | Where the same link ranked in your previous run of this query, country and filters, and how far it moved (positive means up) |
| `isNew`, `firstSeenAt` | Whether the link had never been returned for this query and filters before this run, and when it first was |
| `country`, `language`, `searchUrl`, `scrapedAt` | Where and when it was read |

Example result row:

```json
{
    "type": "result",
    "query": "best crm for small business",
    "position": 3,
    "page": 1,
    "pagePosition": 3,
    "title": "10 Best CRMs for Small Business",
    "url": "https://www.example.com/best-crm",
    "domain": "example.com",
    "description": "Compare the top CRM tools for small teams by price, features and ease of use...",
    "date": "Aug 25, 2026",
    "dateIso": "2026-08-25",
    "sitelinks": [],
    "previousPosition": 5,
    "positionChange": 2,
    "isNew": false,
    "country": "us",
    "language": "en"
}
```

### Free rows, never charged

Every query also gets one summary row (`type: "summary"`), free: Google's "About N results" count when it shows one, how many results were found and returned, pages read, results skipped as already seen, the top domains with their counts, the run it was compared with, and a message on how the query ended. The same row carries what Google showed around the results: the People also ask questions (with the source Google names, when it names one), the AI Overview text with its cited links, and the related searches. Use the **Search summary** view to see these rows on their own. Queries Google has no results for still get their summary row, so you can see what came back empty.

### What makes it different?

- **Rank changes built in.** From the second run on, every row carries `previousPosition`, `positionChange`, `isNew` and `firstSeenAt`. Schedule it daily to track your pages or a competitor's without keeping your own history.
- **Only new results.** Turn on **Only new results** for scheduled runs and each run returns only links it has not returned before for that query, country and filters.
- **The page around the results, free.** People also ask, the AI Overview and related searches ride along in the summary row, so one run covers what a keyword's whole page looks like.
- **Deep pages.** Read up to 10 pages (100 results) per query, or paste a results link that starts deep: its page, date filter, country and language are read from the link.
- **Local results.** Each search runs through the country's own Google domain, so results match what people there see. 44 countries, 31 interface languages.
- **Filters.** Limit to one website or file type, exact phrase, exclude words, published within an hour to a year.

### What does it cost?

$PRICE per 1,000 results, with one paid event, "result", charged once per result row. Summary rows are free, and a query with no results costs nothing.

The run stops cleanly at your maximum charge and keeps everything read so far.

**Free Apify plan:** up to 100 results and up to 25 searches per run. Any paid Apify plan removes both limits.

### Which inputs can I use?

| Input | What it does |
|---|---|
| `queries` | Keywords, one per line (up to 1,000). A pasted Google results link works too: its `q`, `start`, `tbs`, `gl` and `hl` are read from the link. |
| `country` | Two-letter country code, e.g. `us`, `gb`, `de`, `in` (44 to choose from). |
| `language` | Interface language; Country default uses the country's own language. |
| `maxPagesPerQuery` | 1 to 10 pages per query, 10 results a page. Default 1. |
| `onlyNew` | Return only results not returned by an earlier run of the same query, country and filters. |
| `site` | Only results from this website, e.g. `example.com`. |
| `dateRange` | `any`, `hour`, `day`, `week`, `month` or `year`. |
| `exactMatch` | Search for the exact phrase (every query wrapped in quotes). |
| `excludeWords` | Words to leave out, space or comma separated. |
| `fileType` | One kind of document, such as `pdf`, `xls` or `ppt`. |
| `includeSerpFeatures` | Set false to keep the free summary rows bare (default true). |

Inputs pasted from other Google Actors also work under their own names: `query`, `q`, `searchTerms` and `startUrls` for queries, `maxItems` or `maxResults` as a cap on result rows, `countryCode` or `gl` for the country, `languageCode`, `hl` or `searchLanguage` for the language, and `quickDateRange` (`d7` style) for the date range. Each is used when the field it maps to is left on its default.

### How do I track rankings over time?

1. Save your input as a task with your keywords and country.
2. Add a daily schedule to the task.
3. Each run's rows show `positionChange` against the run before. The summary row's `comparedWithRunAt` says which run that was.

Changing the country or any filter starts a separate history, so a site-limited run never mixes with an open one.

### What happens when something goes wrong?

- Bad input (no queries, or a link that is not a Google search) ends the run with a message and charges nothing.
- If Google refuses some searches, the run keeps the results it read and says which queries to re-run.
- If the run's time limit is near, it stops early, saves everything and says which queries were not finished.

### Can I call it from an agent or my own code?

Yes. It works through the Apify API, the Apify MCP server and the Apify client libraries, with the same input as above. A one-query run returns in well under a minute.

### Is it legal to collect Google results?

The Actor reads public search results pages, the same ones anyone sees without signing in, and collects no personal data beyond what appears in public results. You are responsible for how you use the data and for following the laws that apply to you.

### Questions or problems?

Open an issue on the Issues tab and we will answer within a day. If the Actor helped, a rating on the Store helps other people find it.

# Changelog

This Actor's version history is a separate document: https://apify.com/locaihost/google-search/changelog.md

# Actor input Schema

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

What to search on Google, one per line. Paste up to 1,000. A pasted Google results link (google.com/search?q=...) works too: its page, date filter, country and language are read from the link.

## `country` (type: `string`):

The country searched from: results are what a visitor there sees. A pasted link with its own gl parameter overrides this for that query.

## `language` (type: `string`):

The interface language Google answers in. Country default uses the country's own language.

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

How many results pages to read per query, 10 results a page (2 pages returns up to 20 results). Stops early when Google has no more.

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

Skip results this Actor already returned for the same query, country and filters in an earlier run. Skipped results are counted in the free summary row and never charged. Good for a daily schedule.

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

Limit every query to one domain, such as example.com. Leave empty to search the whole web.

## `dateRange` (type: `string`):

Only pages Google dates within this period. A pasted link with its own tbs date filter overrides this for that query.

## `exactMatch` (type: `boolean`):

Search for the exact phrase: every query is wrapped in quotes.

## `excludeWords` (type: `string`):

Words to leave out, space or comma separated: each is added to the query as -word.

## `fileType` (type: `string`):

Only one kind of document, such as pdf, xls or ppt (added to the query as filetype:pdf).

## `includeSerpFeatures` (type: `boolean`):

Carry what Google shows around the results in the query's free summary row. Turn off to keep summaries bare.

## Actor input object example

```json
{
  "queries": [
    "best crm for small business",
    "project management software",
    "solar panel installers austin"
  ],
  "country": "us",
  "language": "",
  "maxPagesPerQuery": 1,
  "onlyNew": false,
  "dateRange": "any",
  "exactMatch": false,
  "includeSerpFeatures": true
}
```

# Actor output Schema

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

Every organic result: query, position, title, link, domain, snippet, date and change since the last run.

## `summaries` (type: `string`):

One free row per query: Google's total, results found and returned, pages read, People also ask, the AI Overview, related searches and a note on how it ended.

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

Counts per query, anything that failed, and cost.

# 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 for small business"
    ],
    "country": "us"
};

// Run the Actor and wait for it to finish
const run = await client.actor("locaihost/google-search").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 for small business"],
    "country": "us",
}

# Run the Actor and wait for it to finish
run = client.actor("locaihost/google-search").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": [
    "best crm for small business"
  ],
  "country": "us"
}' |
apify call locaihost/google-search --silent --output-dataset

```

## MCP server setup

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

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/E4CCzj5aar4YbGnbo/builds/4UGix5TCEKAwQddiM/openapi.json
