Skip to the page

Custom Search API example

Curl, Python and fetch that run after 2027.

Google discontinues the Custom Search JSON API on January 1, 2027, and it is closed to new customers today. The examples below call the same GET /customsearch/v1 at https://api.specstream.ai, which answers before and after that date.

Each example sends key, q and num and reads items[], as Google's documentation does. Only the base address and the key differ from Google's.

SpecStream scores 97.9 F-score on all 1,000 SimpleQA Verified questions, on the benchmarks page. Searches cost $5 per 1,000.

New accounts get $10 of credit, no card. It covers 2,000 searches.

The Custom Search call at SpecStream, at Google and on Vertex AI Search

SpecStreamGoogle Custom Search JSON APIVertex AI Search
The addressGET https://api.specstream.ai/customsearch/v1GET https://www.googleapis.com/customsearch/v1POST https://discoveryengine.googleapis.com/v1/{servingConfig}:search
After January 1, 2027Answers. Open to new accounts today, with $10 of credit and no cardDiscontinued on January 1, 2027, and closed to new customers nowGoogle's suggestion for up to 50 domains, with a free trial of 10,000 queries per account a month
What you sendkey, q, num and start. cx is accepted and not used. exactTerms, orTerms, siteSearch and hq shape the searchq, an API key and cx, the ID of a Programmable Search Engine you configuredA JSON body for a serving config you set up in Google Cloud
What comes backGoogle's JSON: kind, url, queries, context, searchInformation and items[]Metadata about the search and the engine, and an items array with the URL, title and text snippets of each resultSearch Enterprise Edition adds generated answers, at $4.00 per 1,000 queries
Price per 1,000$5 per 1,000 searches. A call of up to 10 results is $0.005$5 per 1,000 queries after 100 free queries a day, up to 10,000 a day, for existing customers$1.50 per 1,000 queries on Search Standard Edition
What it searchesThe whole live web, read at the moment of the callThe Programmable Search Engine you configuredUp to 50 domains. For full web search, Google asks you to contact it
Results a callnum from 1 to 10. Up to 100 in one search on GET /v1/web-search1 to 10, and never more than 100 for a queryBilled per query: any API call to Enterprise Search counts as one

The examples, and why they run on SpecStream

Other options after the Custom Search JSON API

How SpecStream scores

The same numbers as the benchmarks page, from the official tasks and scorers.

How to run the examples

1. Create a key under Agents & API in the workspace. A new account gets $10 of credit, no card, which covers 2,000 searches.

2. Put the key in the environment as SPECSTREAM_API_KEY.

export SPECSTREAM_API_KEY="your key"

3. Run any example above. In code that calls Google today, change https://www.googleapis.com or https://customsearch.googleapis.com to https://api.specstream.ai and the key. cx can stay in the call.

Frequently asked questions

Something we didn't answer? Talk to a human

What is an example of a Custom Search JSON API call?
GET /customsearch/v1?key=<key>&q=<query>&num=10 returns JSON with an items array. Google closes the API on January 1, 2027, and the same call answers at https://api.specstream.ai/customsearch/v1 with a SpecStream key.
Where is the Custom Search JSON API documentation?
Google's reference for cse.list is at developers.google.com/custom-search, read for this page on November 9, 2026. The SpecStream route follows it: the parameters, the reply and the error shape are Google's, and the fields it does not return are listed on this page.
Do I need a search engine ID (cx) for these examples?
No. cx is accepted and not used, so code that sends it runs unchanged. SpecStream searches the whole live web, and siteSearch keeps a search to one site.
How do I get the next page of results?
Send start with the value in queries.nextPage[0].startIndex: 11 after the first 10. Each page is one search at $0.005.
Can I call it from the browser?
Call it from your server or an edge function, so the key stays out of the page. The fetch example runs in Node 18 and later, Deno and Bun as written.
How much do the examples cost to run?
$0.005 a call of up to 10 results, so 2,000 calls fit in the $10 of credit a new account gets. Google charges existing customers $5 per 1,000 queries after 100 free a day.

Sources

SpecStream wrote this page. Each figure about Google comes from Google's own pages, and each other figure from that company's own page.

  1. Google Custom Search JSON API overviewdevelopers.google.com/custom-search/v1/overview, read Nov 9, 2026
  2. Google Custom Search JSON API reference, cse.listdevelopers.google.com/custom-search/v1/reference/rest/v1/cse/list, read Nov 9, 2026
  3. Google Custom Search JSON API, using RESTdevelopers.google.com/custom-search/v1/using_rest, read Nov 9, 2026
  4. Programmable Search Engine blog: updates to our web search productsprogrammablesearchengine.googleblog.com/2026/01/updates-to-our-web-search-products.html, read Nov 9, 2026
  5. Google Cloud: Agent Search pricingcloud.google.com/generative-ai-app-builder/pricing, read Nov 9, 2026
  6. Google Cloud: servingConfigs.search methodcloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.engines.servingConfigs/search, read Nov 9, 2026
  7. Gemini API: Grounding with Google Searchai.google.dev/gemini-api/docs/google-search, read Nov 9, 2026
  8. Brave Search APIbrave.com/search/api/, read Nov 9, 2026
  9. Brave, alternatives to the Google Search APIbrave.com/learn/google-api-shutdown/, read Nov 9, 2026
  10. SpecStream benchmarksspecstream.ai/benchmarks, read Nov 10, 2026
  11. SpecStream pricingspecstream.ai/pricing, read Nov 10, 2026
  12. SpecStream for agentsspecstream.ai/agents.md, read Nov 10, 2026