# Google Search Scraper & SERP Results API (`xtech/google-search-results-api`) Actor

Collect Google search result pages as JSON for SEO research, keyword tracking, and competitor discovery. Control language, country, and result offset; batch up to 20 queries. $0.0027/request attempt + $0.002/run. Paid Apify plan required.

- **URL**: https://apify.com/xtech/google-search-results-api.md
- **Developed by:** [Xtech](https://apify.com/xtech) (community)
- **Categories:** SEO tools
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.70 / 1,000 api request attempts

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/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 Scraper & SERP Results API

Collect Google search result pages as structured JSON for SEO research, keyword tracking, and competitor discovery.

Use the Apify input form or API to send **1–20 requests per run**. Each successful request saves one complete response page in the dataset. No proxy setup or separate API key is needed.

### What can you use it for?

- Collect query snapshots to compare search visibility over time.
- Discover competing pages and domains for selected keywords.
- Feed localized search results into a research or content planning pipeline.

### Quick start

1. Use a paid Apify account and set a spending limit that covers your batch.
2. Paste the example below into the input form, then replace the query values.
3. Start the Actor and open its dataset when the run finishes.

```json
{
  "requests": [
    {
      "q": "coffee beans",
      "num": 10
    }
  ]
}
```

### Input parameters

Wrap query objects in the `requests` array. Each object requests one page.

| Parameter | Meaning |
|---|---|
| `q` | Required search query. |
| `num` | Optional requested result count, 1–100; actual totals may vary. |
| `start` | Optional result offset. |
| `hl, gl` | Optional language and two-letter country code. |
| `location` | Optional human-readable search origin. |
| `safe` | Optional `active` or `off` adult-content filter. |
| `fast_mode` | Optional organic-only mode, excluding other result groups. |

### Output and pagination

Each successful request creates one dataset record with:

| Field | Meaning |
|---|---|
| `requestIndex` | Zero-based position of the request in your batch. |
| `queryParams` | The query parameters used for that request. |
| `upstreamRunId` | Request receipt identifier, when returned. |
| `output` | The complete response page, including returned result arrays and pagination metadata. |

Result arrays stay nested inside `output`; individual results are **not** flattened into separate dataset rows. JSON is the recommended export format for preserving the full response. Available fields depend on the query and returned page. Output order can vary: use `requestIndex` to match records to inputs.

Supply `start` in a new request to fetch a subsequent offset. Results vary with query and localization; there is no automatic ranking history.

### Pricing

**$0.0027 per request attempt + $0.002 per valid run.** All data returned in a page is included in that request fee; there is no separate per-result fee.

| Batch | Actor event charges |
|---|---:|
| 1 request | $0.0047 |
| 10 requests | $0.029 |
| 20 requests | $0.056 |

Empty pages and failed request attempts also incur the request fee. The Actor charges before calling the data API. Invalid input, an unacceptable price quote, or an insufficient batch spending limit stops paid requests. A batch stops on an error; already attempted requests remain billed, and another in-flight request may still be charged.

### Requirements and limits

This Actor collects search result pages. It does not crawl the linked websites, guarantee an exact result count, or guarantee that any particular rich result appears.

- External customers on paid Apify plans only. Free-plan, owner, platform test, development, CI, and standby runs are disabled.
- Run with **128 MiB** of memory. A batch contains at most 20 requests, with two concurrent workers.
- Pagination is manual. Requested result counts are best-effort limits, not guaranteed totals.
- Each response is limited to 4 MiB. Paid request attempts are not automatically retried.

### Frequently asked questions

#### Do I need my own API key or proxy?

No. Supply only the supported query parameters. Connection settings are managed by the Actor.

#### Is there a free trial?

No. This Actor requires a paid Apify plan and bills per request attempt.

#### Can I call it from my application?

Yes. Use the Actor's **API** button in Apify Console for its run endpoint and authenticated code examples. Paying customers can schedule or automate purchases using Apify.

#### Why is a page one dataset row?

A row preserves the complete response and its pagination metadata. Process the nested result arrays in your application if you need one row per result.

### Related data APIs

- [Google Maps Scraper & Business Search API](https://apify.com/xtech/google-maps-search-api)
- [Google Shopping Scraper & Product Search API](https://apify.com/xtech/google-shopping-search-api)
- [Instagram Posts Scraper & User Posts API](https://apify.com/xtech/instagram-posts-api)
- [TikTok Video Search Scraper & Keyword API](https://apify.com/xtech/tiktok-video-search-api)

### Support

For input or output questions, use the Actor's Issues tab when available. Include the run ID and a description of the problem; omit credentials and private data.

This is an independent Xtech tool, unaffiliated with or endorsed by the named platform.

# Actor input Schema

## `requests` (type: `array`):

1–20 query parameter objects; each object fetches one page and incurs one request fee. Pagination is manual.

## Actor input object example

```json
{
  "requests": [
    {
      "q": "coffee beans",
      "num": 10
    }
  ]
}
```

# Actor output Schema

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

Complete JSON response pages stored in the default dataset.

# 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 = {
    "requests": [
        {
            "q": "coffee beans",
            "num": 10
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtech/google-search-results-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 = { "requests": [{
            "q": "coffee beans",
            "num": 10,
        }] }

# Run the Actor and wait for it to finish
run = client.actor("xtech/google-search-results-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 '{
  "requests": [
    {
      "q": "coffee beans",
      "num": 10
    }
  ]
}' |
apify call xtech/google-search-results-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xtech/google-search-results-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/L44bjpRd6NaoaSl7G/builds/JTa6Nms3HNQKGXM2f/openapi.json
