# Google Search API (`apidojo/google-search-api`) Actor

Get live Google Search results as JSON with one HTTP request. Send a keyword and get titles, links and snippets, with country, language, safe search and page options. No Google API key, no runs to start. $0.007 per successful request.

- **URL**: https://apify.com/apidojo/google-search-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

## 🔍 Google Search API - Real-Time Google Search Results as JSON

Call Google Search like any REST API. This **Google Search API** is an always-on Apify Standby Actor: send a `GET` request with a keyword, get Google search results back as JSON in seconds. No runs to start, no datasets to poll, no Google API key.

Search any keyword, pick the country and interface language, turn safe search on, and page through results. All through one simple endpoint: `GET /search`.

**💰 Pricing:** $0.007 per successful request | **⚡ Response:** live JSON, seconds | **🔓 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 Google Search 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 call returns one page of Google search 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 an endpoint:**

```bash
curl "https://apidojo--google-search-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, every request.

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

- **Same price for every page.** Page 1 and page 5 of a search cost the same.
- **You only pay for responses that contain data.** Invalid requests (`400`), unknown endpoints (`404`), plan and 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, 10 pages deep | 10 | **$0.07** |
| Search 100 keywords, first page each | 100 | **$0.70** |
| Search 1,000 keywords | 1,000 | **$7.00** |
| 10,000 calls in a month | 10,000 | **$70.00** |

> Pagination is charged per page. Asking for the next `page` is a new request, so 10 pages = 10 requests = $0.07.

***

### 📚 Endpoints

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

#### 🔍 Search

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

#### Parameters

All parameters are query string parameters and are passed as text.

| Param | Required | Description | Example |
| --- | --- | --- | --- |
| `query` | ✅ | The search keywords. 1 to 1,000 characters. | `Audi` |
| `page` | ❌ | Result page to retrieve. See [Pagination](#-pagination). | `1` |
| `country` | ❌ | Country to search from. | `us` |
| `hl` | ❌ | Interface language. | `en` |
| `safe` | ❌ | Safe search filter. | `active` |
| `count` | ❌ | Number of results to return. The only accepted value is `10`. Any other value returns `400`. | `10` |
| `noEncode` | ❌ | Skip encoding the query. | `false` |

> **Note:** The OpenAPI spec also lists an optional `X-Providers` request header. It is for internal use. Leave it out for normal use.

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

***

### 🔄 Pagination

`/search` is paged with the `page` parameter. Increase it by one to get the next page.

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

## Page 2
curl "https://apidojo--google-search-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 response that contains a `data` field is charged, even when the list is empty, so set a page limit in your code.

***

### 📊 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`, `title`, `link`, `visible_link`, `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, or upstream rate limit | ❌ |
| `502` | Upstream error, safe to retry | ❌ |
| `503` | Plan check temporarily unavailable, retry shortly | ❌ |

Other errors from the upstream service are passed through with their original status code. They carry no `data`, so they are not charged.

Example `400`:

```json
{
  "status": 400,
  "message": "Bad request",
  "errors": ["query.count: Invalid input: expected \"10\""]
}
```

***

### 💻 Code Examples

#### cURL

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

#### Python

```python
import requests

BASE = "https://apidojo--google-search-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

print(len(search_google("Audi", pages=3)))  # max 3 requests = $0.021
```

#### JavaScript / Node.js

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

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

for (const { title, link } of results) console.log(title, link);
```

#### Country and Language

```bash
curl "https://apidojo--google-search-api.apify.actor/search?query=Audi&country=us&hl=en&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, CSV or Excel instead of live calls, or other Google data over HTTP?

| Tool | Best For |
| --- | --- |
| 🏯 **[Google Search Scraper](https://apify.com/apidojo/google-search-scraper?fpr=yhdrb)** | Large keyword lists exported to a dataset |
| 🔎 **[SERP API](https://apify.com/apidojo/serp-api?fpr=yhdrb)** | The same `/search` endpoint, parameters and price under a different Actor |
| 🗺️ **[Google Maps API](https://apify.com/apidojo/google-maps-api?fpr=yhdrb)** | Live Google Maps place search, place details and reviews |

***

### ❓ 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 page. 1,000 requests = $7. Failed and invalid requests are free.

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

Per request. A full page of results costs the same as a page with only a few.

#### 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).

#### Can I search from a specific country or in a specific language?

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

#### How is this different from SERP API?

[SERP API](https://apify.com/apidojo/serp-api?fpr=yhdrb) serves the same `/search` endpoint with the same parameters, response format and price. Use whichever one fits your project.

#### How fast is it?

Responses come back live, usually within seconds. 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. For dataset, CSV or Excel 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 in seconds. 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/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 = {}

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

```

## MCP server setup

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