# Google Search API — SERP Results, People Also Ask & Related (`highbrow_fame/google-search-api`) Actor

Google search results as JSON for any query, country, language and device: rank, title, real destination URL, snippet and date, plus People also ask and related searches. Pay per result.

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

## Pricing

$2.00 / 1,000 search result delivereds

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 API — SERP Results, People Also Ask & Related

Turn any Google search into clean JSON in seconds: rank, title, **the real destination URL**, snippet and date for every organic result, plus the page's People also ask questions and related searches. Any country, any language, desktop or mobile, as many pages as you need. No Google account, no API key, no browser to babysit.

**Try it in 1 minute:**

1. Press **Start**. The prefilled input searches Google for "web scraping" and "apify" (US, English, first page).
2. A few seconds later the **Output** tab lists about 20 results: rank, title, URL, snippet, date, People also ask and related searches.
3. Download JSON, CSV or Excel, call it from the API or from an AI agent, or schedule it to track your rankings every day.

Price: **$2.00 per 1,000 results** (one result = one organic listing). Proxies are included. Queries that return nothing, captcha pages and errors are free.

**Use it to:**

- Track where your pages and your competitors' pages rank for hundreds of keywords, per country and device, on a schedule.
- Give an AI agent or a RAG pipeline live Google results with real, clickable URLs.
- Harvest People also ask questions and related searches for content planning and keyword research.
- Compare desktop and mobile results, or results between countries, in one run.
- Build a SERP dataset in a spreadsheet without maintaining a scraper.

**Why this one:**

- **Real URLs.** Google now hides result links behind its own redirect links. This Actor returns the page's actual address in `url`, and says so plainly (`urlResolved: false`) on the rare result where it could not.
- **Pay per result, not per run.** No monthly minimum, nothing to pay for empty queries or blocked pages.
- **Clean fields.** Snippet dates come split out as `YYYY-MM-DD`, People also ask and related searches as plain lists, and phone numbers and e-mail addresses are removed from snippets.

### Input

| Field | What it does |
|---|---|
| `queries` | Search terms, one per line. Required. |
| `country` | Two-letter country code, default `us`. |
| `language` | Two-letter language code, default `en`. |
| `maxPages` | Result pages per query, 1-10 (default 1, about 10 organic results per page). |
| `device` | `desktop` (default) or `mobile`. |
| `resultsPerPage` | 10, 20, 50 or 100. Google has often ignored values above 10 since September 2025; the Actor then reads the next pages itself, so use `maxPages` for more. |
| `googleDomain` | The Google host, e.g. `google.co.uk` (default `www.google.com`). |
| `includeRelated` | Where People also ask, related searches and the total count go: `every` record (default), the `first` record of each page, or `none`. |
| `includeAds` | Also deliver Google's text ads, marked `isAd: true` (default off). |
| `proxyConfiguration` | Set automatically; leave it as it is. |
| `maxConcurrency` | Queries searched at the same time, 1-10 (default 3). |

### Output

One record per organic result:

| Field | What it is |
|---|---|
| `query`, `country`, `language`, `device`, `page` | What was searched, where and on which page |
| `position` | Rank on the page among organic results (1 = first) |
| `rank` | Overall organic rank across pages; null for an ad |
| `title`, `url` | The result's title and the real address of the page |
| `urlResolved` | `true` when `url` is the real address; `false` when it could not be resolved. Then `url` is rebuilt from the displayed address (or null) and `googleUrl` holds Google's own link |
| `displayedUrl` | The address line Google shows under the title |
| `snippet`, `date` | The description text and, when Google shows one, its date as `YYYY-MM-DD` |
| `sitelinks[]` | Extra links under the result when Google shows them as plain links; usually empty |
| `isAd` | `true` only for an ad delivered with Include ads on |
| `peopleAlsoAsk[]` | The People also ask questions of the page, in order |
| `relatedSearches[]` | The related search terms at the bottom of the page |
| `totalResults` | Google's estimate ("About 2,340,000 results"), or null |
| `searchUrl` | The Google page the record comes from |
| `input`, `status`, `error`, `scrapedAt` | What you gave, `OK` / `NO_RESULTS` / `FAILED`, and why a query gave nothing |

#### Example

A real record from a search for "best running shoes" (US, desktop, October 2026):

```json
{
  "input": "best running shoes",
  "query": "best running shoes",
  "country": "us",
  "language": "en",
  "device": "desktop",
  "page": 1,
  "position": 1,
  "rank": 1,
  "title": "7 Best Running Shoes in 2026",
  "url": "https://runrepeat.com/guides/best-running-shoes",
  "urlResolved": true,
  "displayedUrl": "https://runrepeat.com › guides › best-running-shoes",
  "snippet": "The New Balance 1080 v15 stands out in the all-rounder game, bringing a whole new level of comfort while sustaining lightness and responsiveness ...",
  "date": "2026-09-12",
  "sitelinks": [],
  "isAd": false,
  "peopleAlsoAsk": ["What is the #1 running shoe?", "What is the best brand of running shoes?", "Is Hoka or Asics better?", "What are the best shoes for jogging?"],
  "relatedSearches": ["Best running shoes men", "Best running shoes women", "Best running shoes long distance", "Best running shoes for beginners"],
  "totalResults": null,
  "searchUrl": "http://www.google.com/search?q=best%20running%20shoes&hl=en&gl=us&num=10&start=0",
  "status": "OK",
  "scrapedAt": "2026-10-31T11:11:30.489Z"
}
```

### FAQ

**Is this an official API?** No. It's an unofficial API that reads Google's public results page and turns it into JSON.

**Do I pay anything on top of the price per result?** No. Proxies are included, and queries that return nothing, captcha pages and errors are free.

**What happens on a captcha?** The query gets a free `FAILED` record whose error says so, and it is not retried: the Actor never solves captchas or works around blocks. It is rare; if it happens, run the query again later.

**What if a result's URL can't be resolved?** You still get the result, with `urlResolved: false`, `url` rebuilt from the address Google displays (or null) and Google's own link in `googleUrl`. Nothing is dropped.

**Why do I get fewer than 10 results on a page, or no People also ask?** Google fills some slots with videos, images, news and other features that are not organic listings; the Actor delivers the organic ones with their position among them. People also ask and related searches are there only when Google shows them for that query, country and language.

**Does it return ads?** Only when **Include ads** is on; then text ads come with `isAd: true` and their own position among the ads. Ads appear on these pages only now and then.

**Like it?** A short review on the Store page helps other people find this Actor. Something missing or broken, like a Google layout change or a missing field? Tell us on the Issues tab; we read every one.

### Related Actors

- [Google Jobs API](https://apify.com/highbrow_fame/google-jobs-api): job listings with salary and apply links
- [Google Ads Transparency Scraper](https://apify.com/highbrow_fame/google-ads-transparency): every ad an advertiser runs on Google
- [Google News API](https://apify.com/highbrow_fame/google-news-api): headlines by keyword and topic
- [News Search API](https://apify.com/highbrow_fame/news-search-api): news by keyword with date range and full text
- [Sitemap Extractor](https://apify.com/highbrow_fame/sitemap-url-extractor): every URL, date and image from a site's sitemaps
- [PageSpeed Insights API](https://apify.com/highbrow_fame/pagespeed-api): Lighthouse scores and web vitals

# Actor input Schema

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

Search terms, one per line. Each is searched on Google and every organic result becomes one record.

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

Two-letter country code for the results (Google's gl parameter): us, gb, de, fr, in, br ...

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

Two-letter language code of the interface and results (Google's hl parameter): en, de, fr, es, pt ...

## `maxPages` (type: `integer`):

How many result pages to read per query (1-10). Google serves 10 organic results per page.

## `device` (type: `string`):

Desktop results (default) or the mobile page, fetched with a phone's User-Agent.

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

Google's num parameter: 10, 20, 50 or 100. Since September 2025 Google often ignores values above 10 and serves 10 anyway; the Actor then follows Google's own Next link, so use Pages per query for more results.

## `googleDomain` (type: `string`):

The Google host to search on, e.g. www.google.com, google.co.uk, google.de. Country and language are set by the fields above; the domain changes only which Google front door is used.

## `includeRelated` (type: `string`):

Where the page-level data (People also ask, related searches, total result count) goes: on every record of the page (default), on the first record of each page only, or nowhere.

## `includeAds` (type: `boolean`):

Also deliver text ads that Google shows above or below the results, marked isAd: true (charged like a result). Ads rarely appear on proxied pages.

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

Set automatically; leave it as it is. Proxy use is included in the price per result. Another proxy setting is replaced at run time.

## `maxConcurrency` (type: `integer`):

How many queries to search at the same time (1-10). Pages of one query are read one after another.

## Actor input object example

```json
{
  "queries": [
    "web scraping",
    "apify"
  ],
  "country": "us",
  "language": "en",
  "maxPages": 1,
  "device": "desktop",
  "resultsPerPage": 10,
  "googleDomain": "www.google.com",
  "includeRelated": "every",
  "includeAds": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "GOOGLE_SERP"
    ]
  },
  "maxConcurrency": 3
}
```

# Actor output Schema

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

Every result as a JSON record, with a status for each input.

## `resultsCsv` (type: `string`):

The same records as CSV, for a spreadsheet.

# 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",
        "apify"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "GOOGLE_SERP"
        ]
    }
};

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

# Run the Actor and wait for it to finish
run = client.actor("highbrow_fame/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",
    "apify"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "GOOGLE_SERP"
    ]
  }
}' |
apify call highbrow_fame/google-search-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,highbrow_fame/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/STpQtv7bv4jXl4prR/builds/Uvl9Ftx6izKS5qqs1/openapi.json
