# Google Search Results Scraper - SERP & Rankings (`flash_scraper/google-serp-scraper`) Actor

Google SERP scraper that returns one clean row per result — keyword, position, title, URL, domain, description, organic vs paid, and a 0-100 SEO score. Track rankings for any keyword + country, dedup across queries, filter to your domain. No API key.

- **URL**: https://apify.com/flash\_scraper/google-serp-scraper.md
- **Developed by:** [Flash Scrape](https://apify.com/flash_scraper) (community)
- **Categories:** SEO tools, Lead generation, Automation
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.001 / serp result

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 SERP Scraper — search results, AI Overviews & rank tracking as a flat table

**Turn any keyword into a clean Google rank table.** This Google search results scraper returns one flat row per result — position, title, URL, registrable domain, description, sitelinks count, and a 0–100 SEO score — and it also captures what most SERP tools skip: **Google's AI Overview** (full answer text plus the source URLs it cites), **People Also Ask**, related searches, and paid ads. Pass your `targetDomain` and every matching row is flagged, turning the run into a rank tracker. Built for SEO teams, keyword researchers, and growth marketers who want a spreadsheet of rankings, not a nested JSON blob. **Pay-per-result** ($1 per 1,000 rows) with **no Google API key, no SERP-API subscription, and no login**.

### What it does

- **Runs Google searches** for your queries (or full Google search URLs) in any country and language — SERPs are fetched through Apify's own [`apify/google-search-scraper`](https://apify.com/apify/google-search-scraper), so you never manage proxies or keys.
- **Flattens each SERP into one row per result**: keyword, country, language, page, `resultType` (`organic`, `paid`, `ai_overview`, `people_also_ask`, `related_query`), position, title, URL, display URL, description, sitelinks count, emphasized keywords, and result date.
- **Captures Google's AI Overview as a row** — the full generative answer text in `description` plus every cited source URL in `sources`. If your SEO strategy cares whether the AI answer cites you, this is the field.
- **Extracts the registrable domain** from every result (correctly handling `co.uk`-style TLDs) and **dedupes across queries and pages**.
- **Tracks your rankings**: set `targetDomain` and matching rows get `isTarget: true`; set `onlyTargetDomain` for a pure "where do I rank?" dataset.
- **Scores each result 0–100** (`seo_score`) from rank position, sitelinks, description completeness, and target match, and sorts rows by keyword → page → type → position.

### Use cases

- **Rank tracking** — schedule a daily or weekly run for your keyword set and chart `position` for your domain over time in Google Sheets.
- **AI Overview monitoring** — see which keywords trigger an AI Overview, what it says, and whose pages it cites (yours or a competitor's).
- **Keyword research** — mine People Also Ask questions and related searches as tagged rows for content-brief ideas.
- **Competitor SERP analysis** — who owns page 1 for your money keywords, with sitelinks and ad presence per domain.
- **SERP data pipelines** — a lightweight Google search results API for agents and automations: clean flat JSON via the Apify API, MCP, Make, n8n, or Zapier.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `queries` | array | `["best crm software"]` | Search terms or full Google search URLs — one per line. |
| `countryCode` | string | `"us"` | Two-letter country code setting the Google domain/geo (e.g. `gb`, `ma`). Empty = default. |
| `languageCode` | string | `"en"` | Interface language code (e.g. `fr`, `es`). |
| `maxPagesPerQuery` | integer | `1` | SERP pages to scrape per query (1–20; 10 results ≈ 1 page). |
| `resultsPerPage` | integer | `10` | Organic results to request per page (1–100). |
| `mobileResults` | boolean | `false` | Return the mobile SERP instead of desktop. |
| `includePaidResults` | boolean | `false` | Also emit ads as rows (`resultType: "paid"`). |
| `includeAiOverview` | boolean | `true` | Emit Google's AI Overview (text + source URLs) as a row. |
| `includePeopleAlsoAsk` | boolean | `true` | Emit People Also Ask questions/answers as rows. |
| `includeRelatedQueries` | boolean | `false` | Emit related search suggestions as rows. |
| `targetDomain` | string | — | Your domain (e.g. `mysite.com`); matching results get `isTarget: true`. |
| `onlyTargetDomain` | boolean | `false` | Keep only rows matching the target domain (pure rank-tracking view). |

```json
{
  "queries": ["best crm software"],
  "countryCode": "us",
  "languageCode": "en",
  "maxPagesPerQuery": 1,
  "includeAiOverview": true,
  "includePeopleAlsoAsk": true,
  "targetDomain": "hubspot.com"
}
```

### Output

One dataset row per SERP result. All rows share the same columns, so the CSV export stays rectangular. An organic result:

```json
{
  "keyword": "best crm software",
  "country": "US",
  "language": "en",
  "page": 1,
  "resultType": "organic",
  "position": 2,
  "title": "Best CRM Software: Everything You Need to Know",
  "resultUrl": "https://www.salesforce.com/crm/best-crm/",
  "displayUrl": "Salesforce › crm",
  "domain": "salesforce.com",
  "description": "Compare the top CRM platforms for sales teams…",
  "siteLinksCount": 0,
  "emphasizedKeywords": "CRM, software",
  "resultDate": null,
  "websiteTitle": "Salesforce",
  "sources": [],
  "isTarget": false,
  "resultsTotal": 1240000000,
  "serpUrl": "https://www.google.com/search?q=best+crm+software",
  "seo_score": 100
}
```

An AI Overview row uses the same shape with `resultType: "ai_overview"`, `title: "AI Overview"`, the full answer text in `description`, and the cited URLs in `sources`. People Also Ask rows carry the question in `title` and the answer in `description`.

### Pricing

This actor uses Apify **pay-per-event pricing: $1 per 1,000 result rows** ($0.001 per row) — one of the cheapest ways to get structured Google search results without a SERP-API subscription. You're charged only for the rows delivered; control volume with `maxPagesPerQuery`, `resultsPerPage`, and the include-toggles. Tracking 100 keywords weekly at one page each costs roughly $1–2/month. The **free Apify plan is enough to try it** on a real keyword set first.

### Tips / FAQ

**Do I need a Google API key or proxies?** No. There's no key, no login, and no proxy setup — SERPs are fetched via Apify's maintained Google Search Scraper and returned to you already flattened.

**Why don't I always get an AI Overview row?** Google only shows AI Overviews on some queries, geos, and devices, and it can't always be captured — the row appears when Google served one and the crawl retrieved it. Absence of the row usually means Google didn't show one for that query/location.

**How do positions work across pages?** Google's own position is used when present; otherwise it's computed from the page number and `resultsPerPage`, so page 2 of a 10-result SERP starts at position 11.

**Do PAA and related rows count toward billing?** Every delivered row is a result, so yes — turn off `includePeopleAlsoAsk`/`includeRelatedQueries` if you only want the organic rank table.

**What if the search source is down?** Results come via an upstream data provider; on a transient outage the run ends gracefully with a "temporarily unavailable — please retry" message and **you're charged nothing**.

**Is scraping Google legal?** This collects **public** search results only and never uses a logged-in or personalized session. Google restricts automated access in its terms and changes its SERP layout often, so treat occasional gaps as normal. Use the data for SEO research.

### Related actors

- [Company & Domain Enricher](https://apify.com/flash_scraper/company-domain-enricher) — turn ranking domains into full company records
- [Email Pattern Finder](https://apify.com/flash_scraper/email-pattern-finder) — find work emails at the companies you discover in the SERP
- [LinkedIn Leads Scraper](https://apify.com/flash_scraper/linkedin-leads-scraper) — reach the people behind the ranking domains

**Support:** found a bug or need a feature? Open an Issue on this actor's **Issues tab** — typical response within 1 business day.

# Actor input Schema

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

Search terms (or full Google search URLs) — one per line. e.g. 'best crm software', 'coffee shops in Rabat'.

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

Two-letter country code that sets the Google domain / geo (e.g. 'us', 'gb', 'ma'). Leave empty for default.

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

Interface language code (e.g. 'en', 'fr', 'es').

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

How many SERP pages to scrape per query (10 results ≈ 1 page).

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

Number of organic results to request per page.

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

Return the mobile version of the SERP instead of desktop.

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

Also emit paid/ad results as rows (tagged resultType = paid).

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

Emit Google's AI Overview answer (text + source URLs) as a row (resultType = ai\_overview).

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

Emit People Also Ask questions/answers as rows (resultType = people\_also\_ask).

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

Emit related search suggestions as rows (resultType = related\_query).

## `targetDomain` (type: `string`):

Your domain, e.g. 'mysite.com'. Matching results are flagged isTarget = true so you can see where you rank.

## `onlyTargetDomain` (type: `boolean`):

Keep only results that match the target domain above (pure rank-tracking view).

## Actor input object example

```json
{
  "queries": [
    "seo tools",
    "email marketing software"
  ],
  "countryCode": "us",
  "languageCode": "en",
  "maxPagesPerQuery": 1,
  "resultsPerPage": 10,
  "mobileResults": false,
  "includePaidResults": false,
  "includeAiOverview": true,
  "includePeopleAlsoAsk": true,
  "includeRelatedQueries": false,
  "onlyTargetDomain": false
}
```

# Actor output Schema

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

No description

# 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"
    ],
    "countryCode": "us"
};

// Run the Actor and wait for it to finish
const run = await client.actor("flash_scraper/google-serp-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"],
    "countryCode": "us",
}

# Run the Actor and wait for it to finish
run = client.actor("flash_scraper/google-serp-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"
  ],
  "countryCode": "us"
}' |
apify call flash_scraper/google-serp-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/v8SWa0jLhtOwLZSk3/builds/43mxEf7HFAwNoT8RV/openapi.json
