# SERP API (`apidojo/serp-api`) Actor

ast SERP API for Google. Send a keyword over HTTP and get the results page back as JSON: titles, links, visible URLs and snippets. Filter by country, language and safe search, and page through results. Ideal for rank tracking and SEO tools. $0.007 per request.

- **URL**: https://apify.com/apidojo/serp-api.md
- **Developed by:** [API Dojo](https://apify.com/apidojo) (community)
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$7.00 / 1,000 api requests

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

## 🔍 SERP API - Google Search Results API: Titles, Links & Snippets as JSON

Get Google search engine results pages (SERPs) like any REST API. This **SERP API** is an always-on Apify Standby Actor: send a `GET` request with a keyword, get the results back as JSON. No runs to start, no datasets to poll, no Google API key.

Search any keyword and get each result's title, link, visible link and snippet. Choose the country, interface language, safe search filter and result page. All through one simple endpoint.

**💰 Pricing:** $0.007 per successful request | **⚡ Response:** live JSON, no run startup | **🔓 No Google account or API key**

***

### 📋 Table of Contents

1. [How It Works](#-how-it-works)
2. [Quick Start](#-quick-start)
3. [Pricing](#-pricing)
4. [Endpoints](#-endpoints)
5. [Pagination](#-pagination)
6. [Response Format](#-response-format)
7. [Errors & Status Codes](#-errors--status-codes)
8. [Code Examples](#-code-examples)
9. [Free Plan](#-free-plan)
10. [Related Actors](#-related-actors)
11. [FAQ](#-frequently-asked-questions)
12. [Contact](#-contact)

***

### 🧭 How It Works

This Actor runs in [Apify Standby mode](https://docs.apify.com/platform/actors/running/standby). Instead of starting a run and waiting for a dataset, you call an HTTP endpoint and get the result in the response.

| | Classic Actor run | This SERP API (Standby) |
| --- | --- | --- |
| **How you call it** | Start a run, wait, read the dataset | Plain `GET` request |
| **Latency** | Run startup + scraping | Live response, no startup |
| **Result** | Dataset items | JSON in the HTTP response |
| **Billing** | Per run / per item | **Per request** |
| **Best for** | Large batch jobs | Apps, bots, agents, dashboards |

Every request returns one page of Google results. Use the `page` parameter to get the next page.

***

### 🚀 Quick Start

**1. Get your Apify API token** from [Console → Settings → API & Integrations](https://console.apify.com/settings/integrations?fpr=yhdrb).

**2. Call the endpoint:**

```bash
curl "https://apidojo--serp-api.apify.actor/search?query=Audi" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"
```

**3. Get JSON back:**

```json
{
  "status": 200,
  "message": "OK",
  "data": [
    {
      "type": "searchResult",
      "title": "Audi.com – the international Audi website",
      "link": "https://www.audi.com/",
      "visible_link": "www.audi.com",
      "snippet": "Sporty, luxurious, or compact – at Audi you will find the right vehicle for every requirement. Discover and configure our series models now. Discover all models."
    },
    { "...": "..." }
  ]
}
```

That's it. That request cost $0.007.

**Authentication:** send your Apify token in the `Authorization: Bearer <token>` header (recommended) or as a `?token=<token>` query parameter. The `Authorization` header is never forwarded to the upstream service.

***

### 💰 Pricing

One flat price for every request.

| Event | Price | When it fires |
| --- | --- | --- |
| **Request** (`request-event`) | **$0.007** per call | Every successful request that returns data |

- **Same price for every request.** Any keyword, country, language or page costs the same.
- **You only pay for successful responses.** A response is charged when it contains `data`. Invalid requests (`400`), not-found results, plan and rate-limit refusals and upstream errors are **not charged**.
- **No platform fees, no compute units, no runs.** Just the per-request price.

#### Cost Examples

| Scenario | Requests | Cost |
| --- | --- | --- |
| Search 1 keyword | 1 | **$0.007** |
| Search 1 keyword, 5 pages deep | 5 | **$0.035** |
| Search 100 keywords, first page each | 100 | **$0.70** |
| Search 1,000 keywords, first page each | 1,000 | **$7.00** |
| 10,000 calls in a month | 10,000 | **$70.00** |

> Results are charged per page. Requesting another `page` is a new request, so 10 pages = 10 requests = $0.07.

***

### 📚 Endpoints

All endpoints are `GET`. Base URL: `https://apidojo--serp-api.apify.actor`

#### 🔍 Search

| Endpoint | Description | Params |
| --- | --- | --- |
| `/search` | Google search results for a keyword | `query` (required), `safe`, `page`, `hl`, `country`, `count`, `noEncode` |

#### Parameters

| Param | Required | Type | Description |
| --- | --- | --- | --- |
| `query` | ✅ | string | Search keywords, 1 to 1,000 characters (e.g. `Audi`) |
| `safe` | | string | Safe search filter (e.g. `active`) |
| `page` | | string | Result page to retrieve (e.g. `1`). See [Pagination](#-pagination) |
| `hl` | | string | Interface language (e.g. `en`) |
| `country` | | string | Country to search from (e.g. `us`) |
| `count` | | string | Number of results to return. Only `10` is accepted |
| `noEncode` | | string | Skip encoding the query (e.g. `false`) |

The Actor sets no defaults. Optional params you leave out are not sent to the search backend.

> **Tip:** Send each param once. A repeated param (e.g. `hl=en&hl=de`) is not a string and is rejected with `400`.

The full OpenAPI spec is available on the Actor's **API** tab in Apify Console.

***

### 🔄 Pagination

`/search` is paginated by page number. There is no cursor. Pass `page` to choose which result page you get.

```bash
## Page 1
curl "https://apidojo--serp-api.apify.actor/search?query=Audi&page=1" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"

## Page 2
curl "https://apidojo--serp-api.apify.actor/search?query=Audi&page=2" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"
```

Stop when `data` comes back empty. Each page is one request ($0.007). A page that returns `data: []` still counts as a successful request.

***

### 📊 Response Format

Every response has the same envelope:

```json
{
  "status": 200,
  "message": "OK",
  "data": [ ]
}
```

| Endpoint | `data` contains |
| --- | --- |
| `/search` | Array of search result objects |

#### Search Result Object

```json
{
  "type": "searchResult",
  "title": "Audi.com – the international Audi website",
  "link": "https://www.audi.com/",
  "visible_link": "www.audi.com",
  "snippet": "Sporty, luxurious, or compact – at Audi you will find the right vehicle for every requirement. Discover and configure our series models now. Discover all models."
}
```

Key fields: `type` (always `searchResult`), `title`, `link` (the full result URL), `visible_link` (the URL as Google displays it), `snippet`.

***

### ⚠️ Errors & Status Codes

Errors use the same envelope, without `data`. **Requests that return no data are not charged.**

| Status | Meaning | Charged? |
| --- | --- | --- |
| `200` | Success | ✅ $0.007 |
| `400` | Invalid parameters. `errors` lists what's wrong | ❌ |
| `403` | Access not available on your plan or account | ❌ |
| `404` | Unknown endpoint or nothing found | ❌ |
| `429` | Monthly free request limit reached | ❌ |
| `502` | Upstream error, safe to retry | ❌ |
| `503` | Plan check temporarily unavailable, retry shortly | ❌ |

Example `400`:

```json
{
  "status": 400,
  "message": "Bad request",
  "errors": ["query.query: query is required"]
}
```

***

### 💻 Code Examples

#### cURL

```bash
curl "https://apidojo--serp-api.apify.actor/search?query=Audi&country=us&hl=en" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"
```

#### Python

```python
import requests

BASE = "https://apidojo--serp-api.apify.actor"
HEADERS = {"Authorization": "Bearer YOUR_APIFY_TOKEN"}

def search_google(query, pages=5):
    results = []
    for page in range(1, pages + 1):
        params = {"query": query, "page": str(page)}
        res = requests.get(f"{BASE}/search", headers=HEADERS, params=params, timeout=300).json()
        data = res.get("data") or []
        results += data
        if not data:
            break
    return results

for r in search_google("Audi", pages=3):  # max 3 requests = $0.021
    print(r["title"], r["link"])
```

#### JavaScript / Node.js

```javascript
const BASE = 'https://apidojo--serp-api.apify.actor';
const headers = { Authorization: `Bearer ${process.env.APIFY_TOKEN}` };

const params = new URLSearchParams({ query: 'Audi', country: 'us', hl: 'en' });
const res = await fetch(`${BASE}/search?${params}`, { headers });
const { data: results } = await res.json();

console.log(results.map((r) => `${r.title} - ${r.link}`));
```

#### Safe Search

```bash
curl "https://apidojo--serp-api.apify.actor/search?query=Audi&safe=active" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"
```

***

### 🆓 Free Plan

Apify Free plan users can try this API with a limited number of free requests each month. When the monthly limit is reached, the API answers `429` until the next month. [Subscribe to a paid Apify plan](https://apify.com/pricing?fpr=yhdrb) for unlimited requests.

***

### 🌴 Related Actors

Need bulk exports to a dataset, or other Google data? Use these Actors:

| Tool | Best For |
| --- | --- |
| 🏯 **[Google Search Scraper](https://apify.com/apidojo/google-search-scraper?fpr=yhdrb)** | Batch keyword lists exported to a dataset |
| 🔎 **[Google Search API](https://apify.com/apidojo/google-search-api?fpr=yhdrb)** | The same `/search` endpoint under a different Actor name |
| 🗺️ **[Google Maps API](https://apify.com/apidojo/google-maps-api?fpr=yhdrb)** | Google Maps places and reviews over HTTP |
| 🌐 **[Web Fetch API](https://apify.com/apidojo/web-fetch-api?fpr=yhdrb)** | Loading a result `link` and getting the page content |

***

### ❓ Frequently Asked Questions

#### What is a Standby Actor?

A Standby Actor is an always-running web server on Apify. You call it over HTTP like any API and get the response directly. No runs to start or datasets to read. [Learn more](https://docs.apify.com/platform/actors/running/standby).

#### How much does it cost?

**$0.007 per successful request**, the same for every search. 1,000 requests = $7. Failed and invalid requests are free.

#### Am I charged per result or per request?

Per request. A page of results costs $0.007 no matter how many results it contains.

#### Do I need a Google API key?

No. You only need an Apify API token.

#### How do I get more than one page of results?

Pass `page=2`, `page=3` and so on. Each page is a separate $0.007 request. See [Pagination](#-pagination).

#### How do I choose the country and language?

Use `country` for the country to search from (e.g. `us`) and `hl` for the interface language (e.g. `en`).

#### How is this different from the Google Search API Actor?

Both Actors call the same Google search backend with the same `/search` parameters, response format and price. Use whichever one fits your project.

#### How fast is it?

Responses come back live in the HTTP response. There is no run startup time.

#### Can I use it from an AI agent or bot?

Yes. It's a plain HTTP API with an OpenAPI spec, so it fits LLM tool calls, bots, backends and no-code tools that can make HTTP requests.

#### Where is the data stored?

Nowhere. Results are returned in the HTTP response only and are not saved to a dataset. For dataset exports, use the [Google Search Scraper](#-related-actors).

***

### 📞 Contact

If you need any sort of support, please send an email to **apidojo10@gmail.com**. You name it, we get it.

***

**Ready to call Google search like an API?** One endpoint, $0.007 per page, live JSON with no run startup. Grab your Apify token and send your first request. 🔍

# Actor input Schema

## Actor input object example

```json
{}
```

# Actor output Schema

## `overview` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("apidojo/serp-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("apidojo/serp-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 '{}' |
apify call apidojo/serp-api --silent --output-dataset

```

## MCP server setup

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