Replace the Google Custom Search JSON API in Node.js
Google ends the Custom Search JSON API on January 1, 2027. Move your Node.js code to SpecStream today: the same search in one call, $1 per 1,000 searches against $5, and no daily limit.
A new account gets $2 of credit, no card: 2,000 free test searches. Start the Starter plan at $49 a month for 49,000 searches.
- $1
- per 1,000 searches on SpecStream, fast tier
- $5
- per 1,000 queries on Google Custom Search, until it closes
- 80%
- lower search cost from the first call
- Jan 1, 2027
- the day Google ends the Custom Search JSON API
Before and after in Node.js
GitHub counted 5,008 JavaScript files that contain the address of the Custom Search JSON API on November 20, 2026. On Node.js 18 and later the call needs no package: fetch and URL are built in. The switch changes one address, one header and the name of the array you loop over.
const url = new URL("https://www.googleapis.com/customsearch/v1"); url.searchParams.set("key", process.env.GOOGLE_API_KEY); url.searchParams.set("cx", process.env.GOOGLE_CSE_ID); url.searchParams.set("q", "open source vector databases"); url.searchParams.set("num", "10"); const res = await fetch(url); if (!res.ok) throw new Error("Google Custom Search: " + res.status); const { items = [] } = await res.json(); for (const item of items) console.log(item.title, item.link, item.snippet);
const url = new URL("https://api.specstream.ai/v1/web-search"); url.searchParams.set("q", "open source vector databases"); url.searchParams.set("num", "10"); url.searchParams.set("speed", "fast"); const res = await fetch(url, { headers: { Authorization: "Bearer " + process.env.SPECSTREAM_API_KEY }, }); if (!res.ok) throw new Error("SpecStream search: " + res.status); const { data } = await res.json(); for (const source of data.sources) console.log(source.title, source.url, source.snippet);
The shortest path: keep your code
Change the URL string to https://api.specstream.ai/customsearch/v1 and set key to a SpecStream key. items, link and snippet keep their names.
// was https://www.googleapis.com/customsearch/v1 const url = new URL("https://api.specstream.ai/customsearch/v1"); url.searchParams.set("key", process.env.SPECSTREAM_API_KEY); url.searchParams.set("q", "open source vector databases"); url.searchParams.set("num", "10"); const { items = [] } = await (await fetch(url)).json(); for (const item of items) console.log(item.title, item.link, item.snippet);
$1 per 1,000 searches against $5
SpecStream costs 80% less than Google Custom Search from the first call, with no daily limit and no plan to choose.
What changes in the request and the reply
Each Google field, where it goes on the Search API, and what the Google compatible address keeps.
Move Node.js code in five steps
About ten minutes for one call site.
- Create a SpecStream keySign up with no card. A new account gets $2 of credit, which covers 2,000 fast searches.
- Store the keySet
SPECSTREAM_API_KEYwhere your Node.js code runs. KeepGOOGLE_API_KEYuntil the switch is live, then remove it together withGOOGLE_CSE_ID. - Change the requestSet the URL to
https://api.specstream.ai/v1/web-search, add theAuthorizationheader andspeed=fast, and loop overdata.sources. - Read the replyRead
data.sourcesin place ofitems.linkbecomesurl, andtitleandsnippetkeep their names. - Test before January 1, 2027Run your own queries in the Google CSE migrator and compare both replies before you remove the Google key.
Start now
Test your own query, start on free credit, or prepay for production.
- Google CSE migratorRun a query and see the Google shaped reply beside the SpecStream reply, with the code for your call.
- Start with $2 of creditNo card. It covers 2,000 fast searches, and the key works on the API and over MCP.
- $1,000 prepay packPay once by card and get $1,200 of credit. It does not expire.
- $5,000 prepay packFor production volume. Pay once by card and search from the same balance.
The same move in other stacks
Questions
Something we didn't answer? Talk to a human
When does the Google Custom Search JSON API shut down?
What is the fastest way to replace Google Custom Search in Node.js?
https://api.specstream.ai/customsearch/v1 and set key to a SpecStream key. items, link and snippet keep their names.What does SpecStream cost against Google Custom Search?
Do I need a Programmable Search Engine ID?
/v1/web-search you leave cx out, and on the Google compatible address it is accepted and not used. To keep a search inside one site, write site:example.com in q.Is the reply the same as Google's?
https://api.specstream.ai/customsearch/v1 the reply keeps Google's JSON: items with title, link, snippet and displayLink, searchInformation.totalResults and queries.nextPage. On /v1/web-search each result is in data.sources with title, url, site and snippet, and passages=true adds the best passages of each page.How accurate is SpecStream search?
Can an agent pay per call with no account?
What is the best alternative to the Google Custom Search JSON API?
customsearch/v1 request with Google's JSON reply, costs $1 per 1,000 searches against Google's $5, has no daily limit, and is #1 across 15 public web search and extraction benchmarks.Is there a drop in replacement for customsearch.googleapis.com?
https://www.googleapis.com/customsearch/v1 or https://customsearch.googleapis.com/customsearch/v1 to https://api.specstream.ai/customsearch/v1, with a SpecStream key in key. q, num, start, siteSearch, exactTerms, excludeTerms, orTerms, dateRestrict, fileType, lr, gl, safe and searchType=image carry over, and cx is accepted and not used.Is there a cheaper API than Google Custom Search?
What happens to my code on January 1, 2027?
Does the googleapis npm package work with SpecStream?
rootUrl to https://api.specstream.ai/ in the options of customsearch.cse.list and pass a SpecStream key as auth. The plain fetch call on this page does the same with no package.Keep your search working after January 1
One call changed. $1 per 1,000 searches, no daily limit, and $2 of credit to start.