All posts

Google Custom Search API alternative: what to use

Google Custom Search API alternative? Use a live SERP API like Wayfern to get whole-web results in one request. Compare and migrate before January 1, 2027.

  • custom-search-api
  • serp-api
  • wayfern
  • migration
  • whole-web-search
On this page

Google’s Custom Search JSON API overview says the API is closed to new customers, and existing customers have until January 1, 2027 to move, so any Google Custom Search API alternative has to be in production before that date. If you already have a key, plan the migration now. If you never had one, you need a different search API from the start.

This is for developers whose code calls cse.list(q='google custom search api alternative', num=10) today, or who planned to. Every engine has to move, and its search setting decides what can replace it.

You will be able to sort your engines by exposure, pick a type of replacement, and port the call. With the Wayfern Search API, the request becomes POST https://api.wayfern.com/api/search/v1, q becomes text, and num becomes limit. Each row carries rank, url and engine.

Key Takeaways

  • The JSON API ends for every engine on January 1, 2027. Whole-web engines lose the most, because Google’s replacements cover chosen sites only.
  • Google’s suggested replacement, Vertex AI Search, searches up to 50 domains, not the whole web.
  • A live SERP API needs a field-by-field port: in the Wayfern Search API, text, site and limit take over from q, siteSearch and num.
  • Live SERP billing follows provider results pages, so a high limit costs several pages, not one.

What is shutting down and when?

Google is discontinuing the Custom Search JSON API, so every project that calls cse.list needs a replacement search service before the shutdown reaches it. A third-party comparison page updated on 2026-07-16 puts it this way: “Google’s Custom Search JSON API is being discontinued, requiring developers to migrate to other search services.”

Image generated

Take the dates from Google’s own notice on the Custom Search JSON API overview, and treat that notice as the only authority. Secondhand summaries can lag behind it.

The two dates in the notice affect different people. The closed-to-new-customers rule doesn’t touch code that already runs on a key you hold.

It does block any new project, staging environment or contractor that needs a fresh key. If you don’t have a key yet, you can’t build on this API at all.

The January 1, 2027 date for existing customers sets your schedule. Plan for calls to fail after it unless Google’s notice describes a renewal path.

The notice also treats engines differently by configuration. An engine set to search the whole web is a different case from one restricted to a list of sites.

Open the Programmable Search Engine control panel and check the “Search the entire web” setting for each engine ID you call. Then grep your code for cse.list and the cx parameter. That inventory tells you which calls are exposed.

Once you have the list, map each live call to a replacement. Our SERP API use case covers the equivalent request fields for Google, Bing and DuckDuckGo.

Who does the Custom Search JSON API shutdown affect?

The JSON API ends for every customer, but the two kinds of engine land in different places. Google’s overview closes the API to new customers and gives existing ones until January 1, 2027, and Programmable Search Engine drops its Search the entire web option on the same day.

Your exposure depends on what each engine is allowed to search:

  • Whole-web engines. The engine searches the open web, and your code sends any query and gets ranked results back. Rank trackers, research scripts and RAG retrieval steps usually work this way. These calls stop working, and Google’s overview only invites full-web users to contact it about a separate solution.
  • Site-restricted engines. The engine searches a fixed list of sites, such as your own docs or store. These JSON API calls stop too, but Vertex AI Search can take over.

Google’s recommended path, Vertex AI Search, doesn’t help the first group. A Vertex AI Search app covers up to 50 domains, so it can’t replace whole-web results.

That cap fits internal site search or a product catalog. A query like google custom search api alternative needs results from thousands of unrelated sites, and 50 domains can’t supply them.

A comparison page from bestwebsearchapis.com describes the old API as “limited to a programmable search engine index.” That limit is why teams that needed open-web coverage were already looking elsewhere.

If you’re in the whole-web group, you need a provider that returns live results across the open web. Our SERP API use case covers one option, with Google, Bing and DuckDuckGo results in a single request.

Check the Search API reference for the exact fields before you map your cse.list calls.

Google Custom Search API alternatives: what are your whole-web options?

Your whole-web options fall into three groups: live SERP APIs, independent-index APIs, and AI search APIs, and each gives up something the Custom Search JSON API provided.

CriterionLive SERP API (Wayfern)Independent-index API (Brave)AI search API (Tavily, Exa, Sonar)
Data freshnessLive fetch, 5-minute cacheProvider’s own crawlRetrieved per request
CoverageGoogle, Bing, DuckDuckGoOne index, not Google’sPassages and answers
Billing unitProvider results pagePer vendor planPer vendor plan
Rate limit30 requests a minutePer vendor planPer vendor plan
IntegrationRanked rows with ad flagsNew response schemaText for LLM context

All three groups widen coverage beyond a programmable search engine index, if you accept a different result shape.

A live SERP API fetches the engine’s results page when you ask. The Wayfern Search API takes POST /api/search/v1, defaults to google, and accepts google, bing and duckduckgo in engines.

Billing follows the page, not the result. Per Wayfern’s pricing, Wayfern charges 2 credits per provider results page fetched, cache hits included.

Search is limited to 30 requests a minute, according to Wayfern’s rate limits page. If you request limit=200 for one engine, expect several pages of billing.

An independent-index API such as Brave Search API answers from its own crawl. That removes any dependence on Google’s markup, but rankings won’t match what Google shows.

Rank trackers should treat that as disqualifying. Product search and general lookup usually won’t.

AI search APIs return text meant for a model, not ten links. Tavily, Exa and Perplexity Sonar fit retrieval and RAG, where the next step is a prompt. They’re a poor fit when you need absolute rank, ad positions or a site: operator.

For agent workflows, see our page on live web data for AI agents and the buyer’s guide to AI agent tools.

The table lists billing and rate limits for Brave, Tavily, Exa and Sonar as “per vendor plan”, so check each vendor’s current docs before you commit.

Best for:

  • Live SERP API: rank tracking and any job that needs Google’s actual ordering.
  • Independent-index API: general lookup where you don’t need Google’s ordering.
  • AI search API: LLM and RAG pipelines that consume passages, not result rows.

How do I migrate from Google Custom Search JSON API to a live SERP API?

You migrate from the Google Custom Search JSON API to the Wayfern Search API by renaming eight request parameters and three response fields, then replacing the start pagination loop. Plan on an hour for a script with one query path.

  1. Create a search-scoped token. Put the wf_ token in WF_TOKEN and delete key and cx. Wayfern has no engine ID, and it queries the whole web. Pricing is 2 credits per provider results page, and there is no free tier, so check the pricing page before you test.
  2. Rename the request parameters. The full field list is in the Search API reference.
cse.listWayfern
qtext
numlimit
startstart (offset)
siteSearchsite
dateRestrictdate=YYYYMMDD..YYYYMMDD
fileTypefiletype
glregion
lrlang

dateRestrict takes relative values such as d7. You now compute the two dates yourself.

  1. Rename the response fields. items[].link becomes results[].url, items[].title becomes results[].title, and items[].snippet becomes results[].description. Per the SERP API page, each row also carries rank, which counts organic results only. absolute_rank counts every row, ads included, so sort on rank if you want organic positions.
  2. Replace the pagination loop. Google’s cse.list reference says the API will “never return more than 100 results”, so old loops stop at start=91. Drop the start=11, 21, 31 arithmetic and feed pagination.next_start back in until has_more is false.
  3. Check meta.engines_failed. A blocked engine can look like an empty list, so treat a non-empty value as an error, not as zero results.

Here is the loop from step 4 as Python. It replaces service.cse().list(q=q, cx=CX, num=10, start=n):

import os, requests

URL = "https://api.wayfern.com/api/search/v1"
H = {"Authorization": f"Bearer {os.environ['WF_TOKEN']}"}

def search(text, **opts):
    body = {"text": text, "limit": 10, **opts}
    while True:
        data = requests.post(URL, json=body, headers=H, timeout=60).json()
        for r in data["results"]:
            yield r["rank"], r["url"], r["title"], r["description"]
        page = data["pagination"]
        if not page["has_more"]:
            return
        body["start"] = page["next_start"]

The Node version is one request:

const res = await fetch("https://api.wayfern.com/api/search/v1", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.WF_TOKEN}`, "Content-Type": "application/json" },
  body: JSON.stringify({ text: "site audit", limit: 10, site: "example.com" }),
});
const { results, pagination } = await res.json();

Success looks like the same query returning rank 1 to 10 with populated url fields. Stop the generator when you have enough rows, because it keeps paging while has_more is true.

Python and Node.js examples for Google Custom Search API alternative migration

You replace a cse.list call with one POST to the Wayfern Search API, and the Python and Node.js versions below each run in under 25 lines. Allow about 15 minutes per language. The developer docs cover token setup in full.

  1. Export the token. Use the search-scoped wf_ token from the previous section as WF_TOKEN. Keep it out of source control.

  2. Run the Python version. Send the request body as JSON, with the token in the Authorization header.

import os
import requests

resp = requests.post(
    "https://api.wayfern.com/api/search/v1",
    headers={"Authorization": f"Bearer {os.environ['WF_TOKEN']}"},
    json={
        "text": "google custom search api alternative",
        "limit": 10,
        "region": "us",
        "lang": "en",
        "site": "example.com",
        "filetype": "pdf",
        "date": "20260101..20261231",
    },
    timeout=60,
)
resp.raise_for_status()
for row in resp.json()["results"]:
    print(row["rank"], row["url"], row["title"], row["description"])
  1. Run the Node.js version. This uses the built-in fetch, so you need Node 18 or later and no extra package.
const res = await fetch("https://api.wayfern.com/api/search/v1", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.WF_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    text: "google custom search api alternative",
    limit: 10,
    region: "us",
    lang: "en",
    site: "example.com",
    filetype: "pdf",
    date: "20260101..20261231",
  }),
});
if (!res.ok) throw new Error(`Search failed: ${res.status}`);
const data = await res.json();
for (const { rank, url, title, description } of data.results) {
  console.log(rank, url, title, description);
}
  1. Trim the body to what you used. Only text is needed for a plain query. Delete site, filetype and date if your old call didn’t set them, because a leftover filter narrows results without any error. Check accepted region and lang values in the API reference.

  2. An empty results list with a non-empty meta.engines_failed is a failure, not “no matches”.

Once both scripts print rows, replace the old parsing code with the four results fields and delete the start loop.

When the loop works against your own queries, buy a credit pack and try the Search API on your real query set.

Frequently asked questions

Is there a drop-in replacement for the Google Custom Search JSON API?

No API copies the cse.list request and response exactly, so plan a code change. Your pick depends on whether you need live SERPs, an independent index, or AI-native search. Wayfern’s Search API returns live Google, Bing and DuckDuckGo results at 2 credits per provider results page.

Not for the JSON API. Google’s overview points to Vertex AI Search, which covers up to 50 domains, so teams that need whole-web results move to a third-party live SERP or index API.

Can I use a site-restricted CSE after 2027?

Not through the JSON API, which ends for every engine on January 1, 2027, per Google’s overview. Existing site-restricted engines keep the on-page search box under the Programmable Search Engine rules, and Vertex AI Search covers up to 50 domains for API access.

What is the cheapest live SERP API?

No source names one cheapest API, so compare cost per 1,000 queries at your volume. Serpent’s developer guide gives one published example: $0.03 per 1,000 Web units on Serpent’s Enterprise credit after a $1,000 deposit. Wayfern’s rates are on the pricing page.

How do I migrate my cse.list query to Wayfern?

Send a POST to https://api.wayfern.com/api/search/v1 with a search-scoped wf_ token. Rename q to text, num to limit, and siteSearch to site.

Next steps after the Google Custom Search API shutdown

Your next steps are an inventory this week, a staging test this month, and a production cutover before January 1, 2027.

  • This week: List every cse.list call in your code. Mark the ones that hit a whole-web engine, because those are the calls that stop.
  • This month: Point a staging copy at the Wayfern Search API. Send text, limit and region to the live SERP endpoint, then run your 20 most common queries. Check that your parser reads every renamed field.
  • Keep the old key as a fallback until the cutoff, then delete it.

The developer docs walk through token setup in a few minutes. The cost of testing is capped: credit packs and plans stop at zero, so a bad test loop can’t overspend.

Buy the smallest pack, run your query set on the Search API, and compare the output before you commit to a plan.

Sources

Custom Search JSON API overview | Programmable Search… · API Reference - CDP, Web Data & Search | Wayfern · Custom Search JSON API Alternatives | yeiichi · Best Google Custom Search API alternatives in 2026 · SERP API - Google, Bing & DuckDuckGo | Wayfern · Pricing - Credits for Browsers & the Web Data API | Wayfern · Method: cse.list | Custom Search JSON API | Google for… · nodejs.org. Every other source is linked where the article cites it.

See us more often in Google

One click marks Wayfern as a preferred source in Google, so our posts can show up more often in your Top Stories, AI Mode and AI Overviews.