Google Custom Search API

Google Custom Search API Alternative for the 2027 Shutdown

Google's Custom Search JSON API ends on January 1, 2027. SnoopScan returns web search results as JSON from one POST request. Each parameter is mapped below, with before and after code in curl, Python and JavaScript.

1,500 credits a month free, which is 750 searches at 2 credits each. No card.

What Is Changing and When

Read on Google's own pages on 23 Nov 2026.

If your code calls customsearch.googleapis.com, it needs a new source of results before that date. If your Programmable Search Engine covers a fixed list of sites, search those sites with a site: query. If it covers the entire web, drop the engine ID.

Custom Search Parameters in SnoopScan

The cse.list parameters most code uses, next to their fields in the Search API (POST /v1/search) and in the Google SERP API (POST /v1/serp, the googleSerp tool on MCP). Use Search for links and snippets. Use the SERP API for Google's own ranking order or the AI Overview.

Custom SearchWhat it doesSearchSERPNotes
qThe search text.querykeywordCopy it across as is.
cxThe search engine ID, which holds the list of sites to search.Not needed. Searches the web.Not needed.To limit a search to some sites, add site: to the query. See below.
numResults per request, 1 to 10.limit, 1 to 50depth, 1 to 100Keep the same number, or raise it and make fewer calls.
startIndex of the first result. Google caps start plus num at 100.page, counting from 1None. Raise depth to read further down.With num 10, start 11 is page 2: page = floor((start − 1) / num) + 1.
glThe end user's country, as a two-letter code. Google uses it to boost results from that country.location.country, such as {"country": "US"}country, such as usThe search is run from that country.
lrRestrict results to a language, such as lang_en.language, such as enlanguage, such as enDrop the lang_ prefix.
siteSearch and siteSearchFilterInclude (i) or exclude (e) one site.Add site:example.com or -site:example.com to queryThe same, in keywordAn operator in the query, so check the results on your own searches.
dateRestrictResults from the last d[n] days, w[n] weeks, m[n] months or y[n] years.freshness: hour, day, week, month or yearNone.Fixed windows only. d1 is day, w1 is week, m1 is month and y1 is year. A window such as d3 or m6 has no match.

Searching Only Some Sites

SnoopScan has no saved engines, so there is no cx. Put the site restriction in the query:

{ "query": "site:docs.example.com OR site:blog.example.com pricing" }
One query, two sites. Use -site:example.com to leave a site out.

Test a few of your own queries: results depend on what the search index holds for those sites.

Reading the Response

Custom Search answerSnoopScan search answer
items[].linkdata.results[].url
items[].titledata.results[].title
items[].snippetdata.results[].description
items[].displayLink and formattedUrlNot returned. Read the host from url.
The order of itemsdata.results[].position
queries.nextPageSend the same request with page plus 1.
searchInformation.totalResultsNot returned.
spelling.correctedQueryNot returned. autoCorrect: false stops the query being corrected.
Not in the old answerdata.relatedSearches: the searches Google lists as related.

Migration Code, Before and After

The same search: page 2 of ten results for "web scraping api", from the US, in English, from the last month.

Before: Google Custom Search JSON API

curl -G 'https://customsearch.googleapis.com/customsearch/v1' \  --data-urlencode 'key=GOOGLE_API_KEY' \  --data-urlencode 'cx=SEARCH_ENGINE_ID' \  --data-urlencode 'q=web scraping api' \  --data-urlencode 'num=10' \  --data-urlencode 'start=11' \  --data-urlencode 'gl=us' \  --data-urlencode 'lr=lang_en' \  --data-urlencode 'dateRestrict=m1'
import requestsr = requests.get(    'https://customsearch.googleapis.com/customsearch/v1',    params={        'key': 'GOOGLE_API_KEY',        'cx': 'SEARCH_ENGINE_ID',        'q': 'web scraping api',        'num': 10,        'start': 11,        'gl': 'us',        'lr': 'lang_en',        'dateRestrict': 'm1',    },)for item in r.json().get('items', []):    print(item['link'], item['title'], item['snippet'])
const params = new URLSearchParams({  key: 'GOOGLE_API_KEY',  cx: 'SEARCH_ENGINE_ID',  q: 'web scraping api',  num: '10',  start: '11',  gl: 'us',  lr: 'lang_en',  dateRestrict: 'm1',});const r = await fetch(`https://customsearch.googleapis.com/customsearch/v1?${params}`);const { items = [] } = await r.json();for (const item of items) console.log(item.link, item.title, item.snippet);
A GET with the key and engine ID in the query string.

After: SnoopScan Search

curl -X POST https://api.snoopscan.com/v1/search \  -H 'Authorization: Bearer sk_YOUR_KEY' \  -H 'Content-Type: application/json' \  -d '{ "query": "web scraping api", "limit": 10, "page": 2, "location": { "country": "US" }, "language": "en", "freshness": "month"}'
import requestsr = requests.post(    'https://api.snoopscan.com/v1/search',    headers={'Authorization': 'Bearer sk_YOUR_KEY'},    json={        'query': 'web scraping api',        'limit': 10,        'page': 2,        'location': {'country': 'US'},        'language': 'en',        'freshness': 'month',    },)for item in r.json()['data']['results']:    print(item['url'], item['title'], item['description'])
const r = await fetch('https://api.snoopscan.com/v1/search', {  method: 'POST',  headers: { Authorization: 'Bearer sk_YOUR_KEY', 'Content-Type': 'application/json' },  body: JSON.stringify({    query: 'web scraping api',    limit: 10,    page: 2,    location: { country: 'US' },    language: 'en',    freshness: 'month',  }),});const { data } = await r.json();for (const item of data.results) console.log(item.url, item.title, item.description);
A POST with a bearer key and a JSON body. Results come back under data.results.

Keep the Old Code Reading items

If much of your code reads items, link and snippet, reshape the answer once at the edge.

# Same call, with the answer reshaped to the old items listcurl -s -X POST https://api.snoopscan.com/v1/search \  -H 'Authorization: Bearer sk_YOUR_KEY' \  -H 'Content-Type: application/json' \  -d '{"query": "web scraping api", "limit": 10}' \  | jq '{items: [.data.results[] | {link: .url, title: .title, snippet: .description}]}'
def to_cse_items(data):    """Reshape a search answer into the items list the old code reads."""    return [        {'link': x['url'], 'title': x['title'], 'snippet': x['description']}        for x in data['data']['results']    ]items = to_cse_items(r.json())
const toCseItems = ({ data }) =>  data.results.map((x) => ({ link: x.url, title: x.title, snippet: x.description }));const items = toCseItems(await r.json());
Maps each result to link, title and snippet.

The Python and JavaScript clients make the same call.

Price Per 1,000 Searches

List prices from each vendor's own page, read on 23 Nov 2026. Prices change.

ServicePer 1,000Terms
Google Custom Search JSON API$5.00100 free queries a day, then up to 10,000 a day. Closes to new customers now and ends on January 1, 2027.
Brave Search API$5.00$5 in free credits every month. Prepaid credits, no subscription.
SpecStream$5.00$1 per 1,000 on its fast tier. $10 of credit on sign-up.
Serper$1.00Prepaid: 50,000 queries for $50. Down to $0.30 per 1,000 at 12.5 million queries.
Bright Data SERP API$1.50Pay as you go. 5,000 free requests a month.
SnoopScan Search $0.90 to $2.40 2 credits a search. The low figure is the Scale plan and the high figure is Starter. 1,500 free credits a month. A search that needs a paid source costs more.

Our figures are the rate card and plan prices at full use of a month's credits. The Credits page explains what each call costs. A Google SERP API response carries a cost field with the charge. See Compare for side-by-side pages on other tools.

Use It From an AI Agent

The MCP server gives Claude, Cursor and other MCP clients a search tool and a googleSerp tool.

Prompt Use SnoopScan to search the web for web scraping api and list the top 10 results with their links.

Get a Key and Run the First Search

The free credits are enough to move a small project over before January 1.

Get an API Key

FAQ

When does the Google Custom Search JSON API shut down?

Google's overview page says the API is discontinued on January 1, 2027, and that it is not available to new customers. Google's Programmable Search Engine blog says existing engines can keep the "Search the entire web" option until that date.

What replaces the cx parameter?

Nothing; there is no engine to configure. SnoopScan searches the web by default. To search one site or a few, put site:example.com in the query, joined with OR.

How do I search only my own website?

Add site:yourdomain.com to the query text, for example "site:example.com pricing". To leave a site out, use -site:example.com. This is what siteSearch with siteSearchFilter did.

Is the response the same as the Custom Search JSON API?

No. The results arrive under data.results with url, title, description and position, in place of items with link, title and snippet. The migration section has a short function that reshapes the answer into the old items list.

Is there a drop-in endpoint at /customsearch/v1?

No. It is a small edit to the request and to where the code reads results, a few lines in most code bases.

How many results can one request return?

Google allowed 10 a request and 100 in total for a query. A SnoopScan search returns up to 50 a request, and the page field moves through further pages.

Can I restrict results to the last 3 days or the last 6 months?

Not exactly. dateRestrict takes any number, such as d3 or m6. The freshness field takes hour, day, week, month or year, so use the nearest window.

What does a search cost?

On the rate card a search is 2 credits. That is $0.90 to $2.40 per 1,000 searches, depending on the plan. A search that needs a paid source costs more, and the Credits page explains the rates.

Can an AI agent use it through MCP?

Yes. The MCP server has a search tool for the web and a googleSerp tool for a Google results page, so an agent in Claude, Cursor or another MCP client can run the same searches without code.

Sources