# Google Custom Search API Alternative: Change One Base URL (`apricot_blackberry/google-cse-dropin`) Actor

Queries in, Google Custom Search JSON (items, queries, searchInformation) out. Change one base URL before the Jan 1, 2027 shutdown. $0.004 per page.

- **URL**: https://apify.com/apricot_blackberry/google-cse-dropin.md
- **Developed by:** [Creator Fusion](https://apify.com/apricot_blackberry) (community)
- **Categories:** Developer tools, SEO tools, AI
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 search page (up to 10 results)s

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Custom Search API Alternative: Change One Base URL

This **Google Custom Search API alternative** answers your existing **Google Custom Search JSON API** (`/customsearch/v1`) calls with the same JSON (`items`, `queries`, `searchInformation`). Google shuts down the Custom Search JSON API on January 1, 2027; here you change one base URL, swap `key=` for an Apify `token=`, and keep your parser.

Use it as a live **Standby API** (`GET /customsearch/v1`) or as a **batch run** that writes one dataset row per Google result. Results come from google.com, not from your Programmable Search Engine (`cx` is accepted and ignored).

### Who it's for

- **Developers migrating off Google's Custom Search JSON API.** It is closed to new customers, and existing customers must migrate by January 1, 2027.
- **SEO analysts** who want the Google top 10 for hundreds of keywords as a CSV.
- **AI agents (MCP) and no-code builders** (n8n, Make, Zapier) who need ranked Google links with snippets.

#### Change one base URL

Before:

```text
https://www.googleapis.com/customsearch/v1?key=YOUR_GOOGLE_KEY&cx=YOUR_CX&q=apify&start=11
```

After:

```text
https://apricot-blackberry--google-cse-dropin.apify.actor/customsearch/v1?token=YOUR_APIFY_TOKEN&cx=YOUR_CX&q=apify&start=11
```

Copy the exact Standby URL from the Actor's API tab in Apify Console. Your response parser stays the same. `cx` is accepted, echoed in `queries.request[0]` and otherwise ignored, so ranking can differ from what your CSE returned.

### Sample output

Batch mode writes one dataset row per result. Real rows from the offline smoke run (`test/smoke-input.json`): a normal result, then the single row a zero-result query returns.

```json
[
  {
    "status": "ok",
    "query": "apify web scraping",
    "page": 1,
    "totalResults": "143",
    "totalResultsEstimated": false,
    "request": { "q": "apify web scraping", "num": 10, "start": 1, "gl": "us", "hl": "en", "safe": "off" },
    "fetchedAt": "2026-11-06T15:05:02.824Z",
    "rank": 4,
    "title": "Apify Basics: How To Scrape Anything In Minutes (No Code)",
    "link": "https://www.youtube.com/watch?v=pKgup8tsPv8",
    "displayLink": "www.youtube.com",
    "snippet": "In this video we walk through the basics of Apify.com, and how you can use it immediately to scrape anything you want: Google, Facebook, Tik ...",
    "htmlSnippet": "In this video we walk through the basics of Apify.com, and <b>how you can use it immediately to scrape anything</b> you want: Google, Facebook, Tik ...",
    "formattedUrl": "https://www.youtube.com/watch?v=pKgup8tsPv8"
  },
  {
    "status": "ok",
    "query": "zzqxv no results zzqxv",
    "page": 1,
    "totalResults": "0",
    "totalResultsEstimated": false,
    "request": { "q": "zzqxv no results zzqxv", "num": 10, "start": 1, "gl": "us", "hl": "en", "safe": "off" },
    "fetchedAt": "2026-11-06T15:05:02.615Z",
    "rank": null,
    "title": null,
    "link": null,
    "displayLink": null,
    "snippet": null,
    "htmlSnippet": null,
    "formattedUrl": null
  }
]
```

A zero-result query returns one row with `"rank": null` (the page was fetched and parsed, so it is charged). `correctedQuery` is added when Google offers "Did you mean". A failed query returns `{"status":"error","query":"...","input":{"query":"..."},"error":{"code":"...","message":"..."}}` and is never charged. Batch error codes: `INVALID_ARGUMENT`, `BUDGET_EXHAUSTED`, `SERP_BLOCKED`, `SERP_UPSTREAM`, `TIMEOUT`, `PARSE_ERROR`.

#### Output fields

| Field | Type | Description |
|---|---|---|
| `status` | string | `ok` or `error` |
| `query` | string | The search term from `queries` |
| `rank` | integer or null | 1-based position across pages; `null` for a zero-result query |
| `page` | integer | Results page (1 = results 1-10); each page is one `cse-query` event |
| `title`, `link`, `displayLink`, `snippet`, `htmlSnippet`, `formattedUrl` | string | Same meaning as CSE `items[]` |
| `totalResults` | string | Google's result count (CSE `searchInformation.totalResults`) |
| `totalResultsEstimated` | boolean | `true` when the count was estimated from the page |
| `correctedQuery` | string | "Did you mean" spelling, when offered |
| `request` | object | Echo of `q`, `num`, `start` and the refinements that were set |
| `fetchedAt` | string | ISO 8601 fetch time |
| `error.code`, `error.message` | string | Error rows only |

Dataset views: `overview` (query, rank, title, link, displayLink, snippet, page, totalResults, fetchedAt, status) and `flat` (status, query, rank, page, title, link, displayLink, snippet, formattedUrl, totalResults, totalResultsEstimated, fetchedAt, error.code, error.message; scalar columns only, safe for Google Sheets). Download as JSON, CSV, Excel or HTML.

### Pricing

Pay per event, one flat price on every Apify plan.

| Event | Price (all tiers) | When it fires |
|---|---|---|
| `cse-query` | $0.004 | Once per parsed Google results page of up to 10 results, in batch or Standby |

That is $4.00 per 1,000 pages, against $5 per 1,000 queries on Google's API. Errors, CAPTCHAs and retries are never charged.

Worked examples:

- **100 keywords, top 10 each** (`maxResultsPerQuery: 10`): 100 pages = 100 x $0.004 = **$0.40**.
- **500 keywords, top 30 each** (`maxResultsPerQuery: 30`): 3 pages per keyword = 1,500 pages = **$6.00**.
- **10,000 Standby calls with `num=10`**: 10,000 pages = **$40.00**.

The run stops cleanly when your maximum charge (`maxTotalChargeUsd`) is reached: batch writes `BUDGET_EXHAUSTED` rows for the remaining queries; Standby answers HTTP 429.

### Input

Batch mode. Only `queries` is required; every other field has a default, so an agent can call with one field:

```json input
{ "queries": ["best crm 2026"] }
```

Example with refinements:

```json input
{ "queries": ["apify web scraping", "headless browser api"], "maxResultsPerQuery": 20, "gl": "us", "hl": "en", "siteSearch": "github.com", "siteSearchFilter": "e", "dateRestrict": "m3", "fileType": "pdf", "safe": "active" }
```

| Field | Type | Default | Description |
|---|---|---|---|
| `queries` | string\[] (1-1000) | `["apify web scraping"]` | Search terms, one per line |
| `maxResultsPerQuery` | integer 1-100 | `10` | Results per query; every 10 is one `cse-query` event |
| `gl` | string | `us` | Country code that geolocates results |
| `hl` | string | `en` | Interface language |
| `lr` | string | empty | Result language, `lang_xx` (e.g. `lang_en`) |
| `safe` | `off` / `active` | `off` | SafeSearch |
| `siteSearch` | string | empty | One domain to include or exclude (e.g. `apify.com`) |
| `siteSearchFilter` | `i` / `e` | `i` | `i` include only `siteSearch`, `e` exclude it |
| `dateRestrict` | string | empty | `d7`, `w2`, `m3`, `y1` |
| `fileType` | string | empty | File extension, e.g. `pdf` |
| `exactTerms` | string | empty | Phrase every result must contain |
| `excludeTerms` | string | empty | Words that must not appear |
| `orTerms` | string | empty | At least one of these words must appear |
| `filter` | `1` / `0` | `1` | `1` hides near-duplicates, `0` shows them |

There are no secret fields and no proxy settings to configure.

### Use with AI agents (MCP)

Add this server to Claude, Cursor or any MCP client:

```text
https://mcp.apify.com?tools=apricot_blackberry/google-cse-dropin
```

Example `call-actor` input:

```json
{
  "actor": "apricot_blackberry/google-cse-dropin",
  "input": {
    "queries": [
      "best crm 2026"
    ],
    "maxResultsPerQuery": 10
  },
  "callOptions": {
    "maxTotalChargeUsd": 1
  }
}
```

Then read the run's default dataset (one row per result). Always set a spending cap with `maxTotalChargeUsd` as a run option (never inside `input`); at $0.004 per page, `maxTotalChargeUsd: 1` covers 250 pages.

### API

Run it synchronously and get the dataset items back (`maxTotalChargeUsd` is a query parameter, not input):

```bash
curl -X POST "https://api.apify.com/v2/acts/apricot_blackberry~google-cse-dropin/run-sync-get-dataset-items?maxTotalChargeUsd=1" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"queries":["best crm 2026"],"maxResultsPerQuery":10}'
```

JavaScript (`apify-client`):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('apricot_blackberry/google-cse-dropin').call(
    { queries: ['best crm 2026'], maxResultsPerQuery: 10 },
    { maxTotalChargeUsd: 1 },
);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((r) => `${r.rank} ${r.link}`));
```

Python (`apify-client`):

```python
import os
from decimal import Decimal
from apify_client import ApifyClient

client = ApifyClient(token=os.environ["APIFY_TOKEN"])
run = client.actor("apricot_blackberry/google-cse-dropin").call(
    run_input={"queries": ["best crm 2026"], "maxResultsPerQuery": 10},
    max_total_charge_usd=Decimal("1"),
)
for row in client.dataset(run["defaultDatasetId"]).list_items().items:
    print(row["rank"], row["link"])
```

For CSV, read `https://api.apify.com/v2/datasets/<datasetId>/items?view=flat&format=csv`.

### Standby API

Base URL `https://apricot-blackberry--google-cse-dropin.apify.actor` (copy the exact URL from the Actor's API tab).

- `GET /customsearch/v1`. `GET /` is the readiness probe and returns `200 {"ok":true}`.
- Authenticate with `Authorization: Bearer <Apify API token>` or `?token=<Apify API token>`. Latency: typically 4-8 s; when Google's search proxy is under heavy load, 20-45 s. Requests time out at 60 s (then `503`, not charged). Set your HTTP client timeout to at least 65 s. Hard timeout 25 s, then `503`. Set your HTTP client timeout to at least 30 s.
- Supported parameters: `q` (required), `num` 1-10 (default 10), `start` 1-91, `gl`, `hl`, `lr`, `cr`, `safe`, `siteSearch` + `siteSearchFilter` (`i` include, `e` exclude), `exactTerms`, `excludeTerms`, `orTerms`, `hq`, `fileType`, `dateRestrict` (`d7`, `w2`, `m3`, `y1`), `filter` (`0`/`1`). Other documented CSE parameters are accepted and listed in the response header `X-CF-Ignored-Params`. `key` and `token` are never echoed; `url.template` has the token stripped.
- Each successful request is one `cse-query` event ($0.004).

```bash
curl -H "Authorization: Bearer $APIFY_TOKEN" \
  "https://apricot-blackberry--google-cse-dropin.apify.actor/customsearch/v1?q=best+crm+2026&num=10&gl=us"
```

Response: `kind`, `url`, `queries.request[]`, `queries.nextPage[]` (only when a next page exists and `start+num<=91`), `queries.previousPage[]`, `context.title` ("Creator Fusion CSE Drop-in"), `searchInformation` (`totalResults` is a string), `spelling.correctedQuery` when Google offers "Did you mean", and `items[]` (`kind`, `title`, `htmlTitle`, `link`, `displayLink`, `snippet`, `htmlSnippet`, `formattedUrl`, `htmlFormattedUrl`). Extra top-level `cfMeta`: `totalResultsEstimated`, `upstreamMs`, `requestId`, `unresolvedLinks`.

Errors use Google's envelope:

```json
{"error":{"code":400,"message":"Required parameter: q","errors":[{"message":"Required parameter: q","domain":"global","reason":"required"}],"status":"INVALID_ARGUMENT"}}
```

| HTTP | status | When |
|---|---|---|
| 400 | `INVALID_ARGUMENT` | missing `q`, `num` outside 1-10, `start+num-1>100`, bad enum, `searchType=image` (use `apricot_blackberry/google-image-search-api`) |
| 404 | `NOT_FOUND` | unknown path |
| 429 | `RESOURCE_EXHAUSTED` (`reason: budgetExhausted`) | run budget spent |
| 503 | `UNAVAILABLE` (`reason: backendError`) | Google blocked every attempt, or timeout |
| 500 | `INTERNAL` | unexpected error |

### n8n, Make and Zapier

In n8n add an HTTP Request node: method `GET`, URL `https://apricot-blackberry--google-cse-dropin.apify.actor/customsearch/v1`, query parameters `q` = `{{ $json.keyword }}`, `num` = `10`, and header `Authorization` = `Bearer <your Apify token>`. Map `items[].link`, `items[].title`, `items[].snippet` downstream. Make (HTTP, Make a request) and Zapier (Webhooks by Zapier, GET) take the same URL, parameters and header. For batch runs, use the Apify app in n8n, Make or Zapier with the Actor `apricot_blackberry/google-cse-dropin`.

### FAQ

**Is this a Google Custom Search JSON API replacement?** Yes. It returns the same `customsearch/v1` JSON shape. Change the base URL and replace `key=` with `token=`; parsing stays the same.

**Are results identical to Google CSE?** No. They are google.com results for your query; CSE ranking differs from google.com and we do not promise identical ordering.

**What happens after January 1, 2027?** Nothing changes for this Actor. It does not depend on Google's Custom Search JSON API.

**Can I use my site-restricted engine (`cx`)?** `cx` is accepted and ignored here. For site-restricted search, use `apricot_blackberry/google-site-search-api`.

**Can I get image results?** Use `apricot_blackberry/google-image-search-api` (`searchType=image`).

### Limits

- `pagemap` and `cacheId` are not populated (they need a page fetch per result); the fields are omitted.
- `cx` is accepted and ignored; site-restricted engines are served by a separate Actor.
- `searchType=image` returns 400; use `apricot_blackberry/google-image-search-api`.
- Results stop at index 100 (`start+num-1<=100`), as in Google's API; batch `maxResultsPerQuery` is capped at 100 and `queries` at 1,000.
- Google returns encrypted redirect links to datacenter-style clients; the Actor resolves each one to the real URL before returning it. Some links make Google show a short verification step first; the Actor waits it out (a few seconds), which is why a request can take longer. Measured 2026-11-09: typically 75-90% of links resolve to the real URL; the rest stay as working Google redirect URLs when Google rate-limits the resolution step. If a link cannot be resolved in time, `link` stays as the Google redirect URL (it still opens the right page) and `cfMeta.unresolvedLinks` counts them. The page is charged once either way.
- `totalResults` is Google's estimate. When Google shows no count, it is estimated from the page and `totalResultsEstimated` is `true`.
- Error-envelope field names follow Google's standard API error format; they have not been compared with a live CSE error sample.
- The Actor returns only what Google shows publicly on its results page; it collects no personal data beyond that.

### Support

Built by Creator Fusion LLC (Creator Fusion Labs). Questions and bug reports: contact@creatorfusion.net, or open an issue on the Actor's Issues tab.

If this Actor saved you time, please leave a review on its [Apify Store page](https://apify.com/apricot_blackberry/google-cse-dropin). Honest reviews, good or bad, are how other people decide whether to trust it, and we read every one. Found a problem? Open an issue on the Issues tab and we will fix it.

# Actor input Schema

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

Search terms, one per line (1 to 1000), exactly as you would type them into Google. Each term returns up to "Max results per query" results, one dataset row per result. Example: best crm 2026

## `maxResultsPerQuery` (type: `integer`):

How many results to return for each query, an integer from 1 to 100. Results are fetched 10 per page and every page is one billable cse-query event ($0.004), so 10 = 1 event, 20 = 2 events, 100 = 10 events. Example: 10

## `gl` (type: `string`):

Two-letter country code (ISO 3166-1 alpha-2, lowercase) that geolocates results, the same as the CSE gl parameter. Example: us, de or gb.

## `hl` (type: `string`):

Interface language code, the same as the CSE hl parameter. Example: en, de or pt-BR.

## `lr` (type: `string`):

Restrict results to one language, written lang_xx (the CSE lr parameter). Leave empty for all languages. Example: lang_en

## `safe` (type: `string`):

SafeSearch level (the CSE safe parameter): off or active. Example: off

## `siteSearch` (type: `string`):

One domain to restrict results to, or exclude (the CSE siteSearch parameter). Include or exclude is set by "Site filter mode". Leave empty for the whole web. Example: apify.com

## `siteSearchFilter` (type: `string`):

Whether siteSearch includes (i) or excludes (e) that site (the CSE siteSearchFilter parameter). Ignored when siteSearch is empty. Example: i

## `dateRestrict` (type: `string`):

Only results from a recent period (the CSE dateRestrict parameter): d\[number] days, w\[number] weeks, m\[number] months or y\[number] years. Leave empty for any date. Example: d7 or m3

## `fileType` (type: `string`):

Only results of one file type, as a file extension without the dot (the CSE fileType parameter). Leave empty for all types. Example: pdf or docx

## `exactTerms` (type: `string`):

A phrase that every result must contain (the CSE exactTerms parameter). Leave empty for none. Example: web scraping

## `excludeTerms` (type: `string`):

Words that must not appear in any result, separated by spaces (the CSE excludeTerms parameter). Leave empty for none. Example: jobs salary

## `orTerms` (type: `string`):

Extra words where at least one must appear in each result, separated by spaces (the CSE orTerms parameter). Leave empty for none. Example: api tutorial

## `filter` (type: `string`):

Duplicate-content filter (the CSE filter parameter): 1 hides near-duplicate results (Google default), 0 shows them. Example: 1

## Actor input object example

```json
{
  "queries": [
    "best crm 2026",
    "apify web scraping"
  ],
  "maxResultsPerQuery": 10,
  "gl": "us",
  "hl": "en",
  "lr": "lang_en",
  "safe": "off",
  "siteSearch": "apify.com",
  "siteSearchFilter": "i",
  "dateRestrict": "d7",
  "fileType": "pdf",
  "exactTerms": "web scraping",
  "excludeTerms": "jobs salary",
  "orTerms": "api tutorial",
  "filter": "1"
}
```

# Actor output Schema

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

All result rows in the default dataset, overview view (query, rank, title, link, snippet).

## `flat` (type: `string`):

The same rows as scalar CSV columns, safe to open in Google Sheets or Excel.

# 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": [
        "apify web scraping"
    ],
    "gl": "us",
    "hl": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("apricot_blackberry/google-cse-dropin").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": ["apify web scraping"],
    "gl": "us",
    "hl": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("apricot_blackberry/google-cse-dropin").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": [
    "apify web scraping"
  ],
  "gl": "us",
  "hl": "en"
}' |
apify call apricot_blackberry/google-cse-dropin --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apricot_blackberry/google-cse-dropin"
        }
    }
}
```

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/vTpYU6gPTKTGmVAI4/builds/QZikk3x9h8PulCwzg/openapi.json
