Google Custom Search JSON API parameters on SpecStream
SpecStream
Search API · · 5 min read
Google ends the Custom Search JSON API for existing customers on January 1, 2027, 36 days from November 26, 2026. SpecStream answers the same request at https://api.specstream.ai/customsearch/v1: change the host from https://www.googleapis.com or https://customsearch.googleapis.com, put a SpecStream key where the Google key was, and the reply keeps Google's shape. Each call is a fast search at $1 per 1,000 searches of up to 10 results, against Google's $5 per 1,000 queries.
This page is the parameter by parameter reference. For the one line change in Python, JavaScript and curl, read the migration guide, or paste your own call into the Google CSE migrator and it writes the new code.
The request
curl "https://api.specstream.ai/customsearch/v1?key=$SPECSTREAM_KEY&q=lithium+battery+recycling+plants&num=10&start=1&dateRestrict=m6&gl=us"
/customsearch/v1/siterestrict answers too, for code written against the Site Restricted JSON API.
Parameters
| Parameter | What it does on SpecStream |
|---|---|
key |
Your SpecStream key. It can also go in the X-Goog-Api-Key header or as a Bearer token |
q |
The search |
num |
Results per call, 1 to 10, Google's own limit |
start |
The first result. start=0 reads as the first page, as Google answers it. A search pages up to result 100, as Google's does |
cx |
Accepted and not needed. No engine ID to create |
siteSearch, siteSearchFilter |
Keep one site (i, the default) or leave it out (e) |
exactTerms, hq |
Words every result must contain as written |
orTerms |
Words of which a result contains at least one |
excludeTerms |
Words no result contains |
fileType |
Results of one file type, such as pdf |
dateRestrict |
Results from the last d, w, m or y units, such as d7, w2, m6, y1 |
lowRange, highRange |
A range of numbers the results must hold |
lr, hl |
The language. lr (such as lang_de) wins, hl counts when lr is absent |
cr, gl |
The country. cr (such as countryDE) wins, gl counts when cr is absent |
safe |
Safe search |
sort |
sort=date puts dated results first, newest first, also with Google's :d and :r: suffixes |
searchType |
image returns image results |
imgSize, imgType, imgColorType, imgDominantColor |
Image filters for searchType=image |
fields |
A partial reply, in Google's selection syntax |
linkSite, relatedSite, rights, filter, c2coff, googlehost |
Accepted and changing nothing. link: and related: are operators Google itself retired |
Every parameter Google's reference lists is accepted, so code that sets every field of Google's request keeps working. Only a value a parameter cannot take is refused.
The reply
| Field | Content |
|---|---|
kind |
customsearch#search |
queries.request, queries.nextPage, queries.previousPage |
The page asked for and the pages around it, with count, startIndex and searchTerms |
searchInformation |
searchTime, formattedSearchTime, totalResults, formattedTotalResults |
spelling.correctedQuery |
A corrected search, when there is one |
items[].title, htmlTitle |
The page title, with the searched words in bold in htmlTitle |
items[].link, displayLink, formattedUrl |
The address and its host |
items[].snippet, htmlSnippet |
The passage that matched |
items[].mime, fileFormat |
The file type, for PDF and other documents |
items[].pagemap.metatags, cse_image |
The page's meta tags and its image |
items[].image |
For image results: contextLink, the page the image is on, with width, height, thumbnailLink and mime |
specstream |
What the Search API returns beyond Google's fields, on the reply and on each item |
As on Google, a reply with no result has no items key, so code that checks for it keeps its behavior.
Errors
Errors come back in Google's error body, with the code, the message, errors[].reason and Google's status name. A call with no key, sent on November 26, 2026:
{"error": {"code": 401, "message": "Missing API key. Send your SpecStream API key as key=<key>. Get a key at https://specstream.ai/workspace/agents?tab=keys", "errors": [{"message": "Missing API key. Send your SpecStream API key as key=<key>. Get a key at https://specstream.ai/workspace/agents?tab=keys", "domain": "global", "reason": "missing_api_key"}], "status": "UNAUTHENTICATED"}}
| HTTP code | Status | When |
|---|---|---|
| 400 | INVALID_ARGUMENT |
A parameter with a value it cannot take, such as searchType=video |
| 401 | UNAUTHENTICATED |
No key, or a key that is not valid |
| 402 | FAILED_PRECONDITION |
The balance needs credit before the call |
| 429 | RESOURCE_EXHAUSTED |
The key's rate limit |
| 500, 503, 504 | INTERNAL, UNAVAILABLE, DEADLINE_EXCEEDED |
A server error, to retry |
Price
| Google Custom Search JSON API | SpecStream drop-in address | |
|---|---|---|
| Price | $5 per 1,000 queries after 100 free a day | $1 per 1,000 searches of up to 10 results |
| Daily cap | 10,000 queries | None |
| 10,000 queries a day for 30 days | $1,485 | $300 |
| Status after January 1, 2027 | Ended | Open to every account |
A call that asks for the default search tier in place of the fast one costs $5 per 1,000 searches on SpecStream. Run your own volume through the AI search API cost calculator.
Keys for regulated teams
Two settings on each SpecStream key, set when you create it or later:
- Zero retention.
"zero_retention": trueon the key. A search made with it keeps no request text and no answer after the reply: it is not in the history, its answer is not reused for another call, and its log lines carry neither. The charge keeps the account, the key, the request ID, the price and the time. - EU only egress.
"eu_egress_only": trueon the key. Every search made with it, on/v1/web-searchand on every drop-in route including/customsearch/v1, leaves from SpecStream's server in Madrid and reaches each search engine and each page directly, never through a proxy in another country.
Both are set with POST https://api.specstream.ai/v1/account/keys or PATCH https://api.specstream.ai/v1/account/keys/{id}, and GET https://api.specstream.ai/v1/account/keys shows them.
Start
Get a key with $10 of credit, no card, then change the host. The Google Custom Search migration page walks through the move, and the API docs cover the native Search API.
More from the blog
Every postAI search API pricing 2026: SpecStream $1 per 1,000 vs Exa, Tavily
SpecStream's Search API costs $1 per 1,000 fast searches and $5 default, against Exa at $4 to $12, Tavily at $8 to $16, Firecrawl at $10 and Google Custom Search at $5 until it ends January 1, 2027
Nov 26, 2026 · SpecStream · 5 min read
Google Custom Search API shutdown 2027: migration guide
Google ends the Custom Search JSON API on January 1, 2027, 36 days from November 26, 2026
Nov 26, 2026 · SpecStream · 4 min read
Google Custom Search cutover checklist: 36 days to January 1
Google's Custom Search JSON API ends for existing customers on January 1, 2027
Nov 26, 2026 · SpecStream · 4 min read