Google Custom Search JSON API Alternative avatar

Google Custom Search JSON API Alternative

Pricing

from $3.00 / 1,000 searches

Go to Apify Store
Google Custom Search JSON API Alternative

Google Custom Search JSON API Alternative

Replacement for Google's Custom Search JSON API, which Google discontinues on January 1, 2027. Same /customsearch/v1 endpoint, same parameters, same JSON response, with live Google web results. Change the base URL and the key and keep your code.

Pricing

from $3.00 / 1,000 searches

Rating

0.0

(0)

Developer

roomy_tweet

roomy_tweet

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

11 hours ago

Last modified

Features

Limited permissionsSingle-tenantServer interface

Share

Google Custom Search JSON API alternative

Google is discontinuing the Custom Search JSON API on January 1, 2027. It is already closed to new customers, and Google's suggested replacement only covers search over up to 50 of your own domains.

This Actor answers the same endpoint, with the same parameters and the same JSON response, using live Google web results. Existing code keeps working after two changes: the base URL and the key.

It is an independent tool and is not affiliated with or endorsed by Google.

What changes in your code

Before:

GET https://www.googleapis.com/customsearch/v1?key=GOOGLE_API_KEY&cx=ENGINE_ID&q=web+scraping+tools

After:

GET https://roomy-tweet--google-custom-search-api.apify.actor/customsearch/v1?token=APIFY_TOKEN&cx=ENGINE_ID&q=web+scraping+tools
  • Base URL: copy it from this Actor's Server tab.
  • Key: send your Apify API token as token= in place of key=, or better, as an Authorization: Bearer <token> header. A leftover key= parameter is ignored.
  • Everything else stays: q, num, start, gl, hl, lr, cr, safe, siteSearch, dateRestrict, exactTerms, fileType and the rest, plus the response fields your code already reads (items[].title, link, snippet, displayLink, searchInformation.totalResults, queries.nextPage).
curl -H "Authorization: Bearer $APIFY_TOKEN" \
"https://roomy-tweet--google-custom-search-api.apify.actor/customsearch/v1?q=web+scraping+tools&num=5&gl=us"
import requests
response = requests.get(
"https://roomy-tweet--google-custom-search-api.apify.actor/customsearch/v1",
params={"q": "web scraping tools", "num": 5},
headers={"Authorization": f"Bearer {APIFY_TOKEN}"},
)
for item in response.json().get("items", []):
print(item["title"], item["link"])

/customsearch/v1/siterestrict is answered the same way, for code that called the Site Restricted API.

If your search engine was restricted to certain sites

A Programmable Search Engine kept its list of sites inside Google, under the cx ID. That list cannot be read from outside, so send the sites with the request:

/customsearch/v1?q=pricing&sites=example.com,docs.example.com,blog.example.com

sites takes up to 20 sites (hosts or paths such as example.com/blog). For a single site the API's own siteSearch=example.com also works, and siteSearchFilter=e excludes that site instead.

Response

{
"kind": "customsearch#search",
"queries": {
"request": [{ "title": "Google Custom Search - web scraping tools", "totalResults": "126", "searchTerms": "web scraping tools", "count": 10, "startIndex": 1, "inputEncoding": "utf8", "outputEncoding": "utf8", "safe": "off", "cx": "ENGINE_ID" }],
"nextPage": [{ "title": "Google Custom Search - web scraping tools", "totalResults": "126", "searchTerms": "web scraping tools", "count": 10, "startIndex": 11, "inputEncoding": "utf8", "outputEncoding": "utf8", "safe": "off", "cx": "ENGINE_ID" }]
},
"context": { "title": "Google" },
"searchInformation": { "searchTime": 0.18, "formattedSearchTime": "0.18", "totalResults": "126", "formattedTotalResults": "126" },
"items": [
{
"kind": "customsearch#result",
"title": "Scrapy — open source web scraping framework for Python",
"htmlTitle": "Scrapy — open source web scraping framework for Python",
"link": "https://www.scrapy.org/",
"displayLink": "www.scrapy.org",
"snippet": "An open source and collaborative framework for extracting the data you need from websites.",
"htmlSnippet": "An open source and collaborative framework for <b>extracting the data</b> you need from websites.",
"formattedUrl": "https://www.scrapy.org/",
"htmlFormattedUrl": "https://www.scrapy.org/"
}
]
}

Errors use the API's format too, so existing error handling keeps working:

{ "error": { "code": 400, "message": "'num' must be between 1 and 10.", "errors": [{ "message": "'num' must be between 1 and 10.", "domain": "global", "reason": "badRequest" }], "status": "INVALID_ARGUMENT" } }
StatusMeaningCharged
200Results, or a valid answer with no results (no items key, as in the API)Yes
400Invalid parameter (badRequest)No
429Your Apify account could not be charged, for example its spending limit was reachedNo
503Google did not return a readable page after three attempts; try againNo

Supported parameters

ParameterSupport
qYes. Google operators work ("phrase", -word, site:, filetype:)
num1 to 10
start1 to 100; start + num cannot pass 100, as in the API
gl, hl, lr, cr, safe, filter, googlehostYes
siteSearch, siteSearchFilterYes
sitesExtension: up to 20 sites, replaces the engine's site list
dateRestrictd[n], w[n], m[n], y[n]
sortdate and date:r:YYYYMMDD:YYYYMMDD
exactTerms, excludeTerms, orTerms, hq, fileTypeYes
cxAccepted and echoed back; the engine's settings are not read
keyIgnored; authentication is your Apify token
prettyPrintYes
searchType=imageNot supported: web results only (returns 400)
fields, callback, c2coff, lowRange, highRange, linkSite, rights, img*Ignored

What is different from Google's API

Read this before you switch, so nothing surprises you in production.

  • Results are Google web search results. A Programmable Search Engine ranked a little differently from google.com, and engine settings stored under cx (site list, promotions, synonyms, refinements) are not applied. Use sites for the site list.
  • items carry the core fields: title, htmlTitle, link, displayLink, snippet, htmlSnippet, formattedUrl, htmlFormattedUrl, plus mime and fileFormat for documents such as PDFs. There is no pagemap (page metadata and thumbnails) and no cacheId. htmlTitle has no bold marks.
  • totalResults is the number Google shows on the page ("About 126 results"). Google's page estimates are often much smaller than the API's used to be. When Google shows no number, the field holds the count of results seen so far, plus one while another page exists, so loops that page until totalResults keep working.
  • Some links are Google redirects. Google often hides each result's address behind a redirect (https://www.google.com/goto?url=…). The Actor follows it to the real address, but Google sometimes answers with a "Verifying your request" check instead. In tests on November 12, 2026, about 2 in 3 links came back with the real address and the rest stayed as Google's redirect. Such an item keeps the redirect in link (it still opens the right page in a browser), gets "unresolvedLink": true, and its displayLink still shows the real site. If you store or compare URLs, check that flag.
  • Speed. Google's API answered in well under a second. Here every request reads a live Google page, so expect seconds, not milliseconds, and a little longer for the first request after a quiet period while the server starts.
  • Limit of 100 results per query, 10 per request, the same as the API.

Use it without code

The Actor also has a normal input form. Add your queries, choose how many results you want per query and press Start. Results go to a dataset you can download as JSON, CSV or Excel, or send onward with Apify integrations (Make, n8n, Zapier, webhooks).

FieldWhat it does
Search queriesOne search per line
Results per query10 results = 1 search; up to 100
Only these sitesRestrict every search to up to 20 sites
Country, Interface languageThe API's gl and hl
Only recent resultsd7, w2, m6, y1
Exact phrase, Excluded words, File typeThe API's exactTerms, excludeTerms, fileType
Output formatOne row per result, or the API's JSON, one row per page

One row per result:

{
"query": "web scraping tools",
"position": 1,
"title": "Scrapy — open source web scraping framework for Python",
"link": "https://www.scrapy.org/",
"displayLink": "www.scrapy.org",
"snippet": "An open source and collaborative framework for extracting the data you need from websites.",
"htmlSnippet": "An open source and collaborative framework for <b>extracting the data</b> you need from websites.",
"totalResults": 126,
"searchedAt": "2026-11-12T18:20:00.000Z"
}

Every run also saves a REPORT record with the status of each query, the results saved and the searches charged.

Pricing

You pay per search: one request to the endpoint, or one page of up to 10 results in a run. This is the same unit Google billed. Requests that fail (400, 429, 503) are not charged. The current price per search is shown on this page.

The server runs in your own Apify account, so Apify's platform usage is billed to you as well, on top of the search price. In our test runs (November 2026) that came to about $0.0028 per search: $0.0025 for Google SERP proxy and about $0.0003 of compute. While the server waits for the next request after a burst, it keeps using a little compute (512 MB for up to 2 minutes, roughly $0.003 at Apify's standard rate). Your plan's prices apply, so check your own usage after a first batch.

FAQ

Is this Google's API? No. It is an independent Actor that reads public Google result pages and returns them in the format of the Custom Search JSON API. It is not affiliated with Google.

Do I still need a Programmable Search Engine or a Google API key? No. You only need an Apify account and its API token.

Can I keep cx in my requests? Yes. It is accepted and echoed back in queries.request[0].cx, so code that sends or checks it keeps working.

I used the free 100 queries a day. Is there a free tier here? Apify's free plan includes monthly platform credit that you can spend on this Actor.

Does image search (searchType=image) work? Not yet. The endpoint returns web results only and answers image requests with a 400 error.

How many results can I get for a query? Up to 100, ten per request, by raising start (1, 11, 21, …) or following queries.nextPage, exactly as with the API.

Something looks wrong. Open an issue on the Actor's Issues tab with the request you sent (without your token) and what you expected.