Skip to the page

Web Search API: GET and POST /v1/web-search

Reference for GET /v1/web-search and POST /v1/web-search on both speed="fast" ($1 per 1,000 searches, 937 ms median) and speed="default" ($5 per 1,000 searches), including live domain boosting and filtering with boost_domains, include_domains, and exclude_domains.

Endpoints and speed tiers

Send GET https://api.specstream.ai/v1/web-search with query parameters or POST https://api.specstream.ai/v1/web-search with a JSON body using the exact same parameter names. Use POST to keep queries and domain lists out of URL logs. Create a key under Agents & API; new accounts get $2 of credit, no card (2,000 fast searches or 400 default searches). SpecStream ranks first on WideSearch (60.93 low-cost, ahead of every search API) and scores 99 on SimpleQA Verified (full benchmark tables).

Already calling Exa, Tavily, Perplexity, Firecrawl, Google Custom Search, Brave, or Serper? Browse all 70+ drop-in API migration guides or generate a 1-line swap in the Drop-in API converter. See the overview in Search API docs or the live OpenAPI schema at api.specstream.ai/openapi.json.

Domain boosting and filtering

Three parameters control which sites appear in GET and POST /v1/web-search responses. Each parameter accepts up to 20 domains (nrk.no), subdomains (news.nrk.no), or TLDs (.no), sent as a JSON array, a single comma-separated string, or repeated query parameters. Optional path prefixes such as example.com/docs are supported, and leading schemes, www., or *. are stripped automatically.

ParameterTypeBehavior
boost_domainsstring[] | stringRank results from these sites first, followed by results from the rest of the web. Accepts up to 20 domains (nrk.no), subdomains (news.nrk.no), or TLDs (.no) as a JSON array or comma-separated string (or repeated GET query parameters). SpecStream also asks for the top boosted sites by name so their pages surface when a plain query returns none. Works with speed fast and default; cannot be combined with include_domains, news, or images (HTTP 422).
include_domainsstring[] | stringReturn only results from these sites. Accepts up to 20 domains (apple.com), subdomains (news.nrk.no), or TLDs (.no) as a JSON array or comma-separated string. Optional path prefixes such as example.com/docs are supported; leading scheme, www., and *. are normalized automatically. Cannot be combined with boost_domains (HTTP 422).
exclude_domainsstring[] | stringRemove results from these sites. Accepts up to 20 domains, subdomains, or TLDs (.no) as a JSON array or comma-separated string. Works alongside either include_domains or boost_domains, and across web, news, and image searches.

Combination rules: exclude_domains works with both include_domains and boost_domains. Combining include_domains and boost_domains in the same request returns 422, because include_domains already restricts the result set to those sites. Sending boost_domains with news=true or images=true also returns 422.

Calling through the You.com drop-in route (/you/v1/search)? boost_domains, include_domains, and exclude_domains pass straight through to the same live ranking layer (You.com migration guide).

cURL, Python, and JavaScript examples

cURL: POST /v1/web-search with boost_domains and exclude_domains (speed: "fast")

Terminal
curl -X POST https://api.specstream.ai/v1/web-search \
-H "Authorization: Bearer $SPECSTREAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "electric vehicle grid tariff updates",
"speed": "fast",
"num": 10,
"boost_domains": ["nrk.no", "regjeringen.no", ".no"],
"exclude_domains": ["pinterest.com", "reddit.com"]
}'

cURL: GET /v1/web-search with include_domains and exclude_domains (speed: "default")

Terminal
curl -G https://api.specstream.ai/v1/web-search \
-H "Authorization: Bearer $SPECSTREAM_API_KEY" \
--data-urlencode "q=EU AI Act GPAI enforcement timeline" \
-d "speed=default" \
-d "include_domains=europa.eu,eur-lex.europa.eu" \
-d "exclude_domains=blog.example.com"

Python: fast boost_domains and default include_domains

Python
import os
import requests
API_KEY = os.environ["SPECSTREAM_API_KEY"]
HEADERS = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
# 1. Fast search ($1/1,000): prioritize preferred domains and TLDs, keep rest of web after
fast_res = requests.post(
"https://api.specstream.ai/v1/web-search",
headers=HEADERS,
json={
"q": "offshore wind tender award",
"speed": "fast",
"num": 10,
"boost_domains": ["nrk.no", "news.nrk.no", ".no"],
"exclude_domains": ["pinterest.com"],
},
timeout=30,
)
fast_res.raise_for_status()
for src in fast_res.json()["data"]["sources"]:
print(src["url"], src["title"])
# 2. Default search ($5/1,000): strict domain allowlist with extracted answer and rows
default_res = requests.post(
"https://api.specstream.ai/v1/web-search",
headers=HEADERS,
json={
"q": "FDA 510(k) AI medical device guidance",
"speed": "default",
"include_domains": ["fda.gov", "federalregister.gov"],
"exclude_domains": ["accessdata.fda.gov"],
},
timeout=30,
)
default_res.raise_for_status()
data = default_res.json()["data"]
print(data.get("answer"), len(data.get("sources", [])))

JavaScript / TypeScript: POST /v1/web-search

typescript
const API_KEY = process.env.SPECSTREAM_API_KEY!
// Fast tier ($1/1,000) with boost_domains + exclude_domains
const boosted = await fetch("https://api.specstream.ai/v1/web-search", {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
q: "european sovereign cloud compliance",
speed: "fast",
num: 10,
boost_domains: ["europa.eu", "bsi.bund.de", ".eu"],
exclude_domains: ["medium.com"],
}),
}).then((r) => r.json())
console.log(boosted.data.sources.map((s: { url: string }) => s.url))
// Default tier ($5/1,000) with strict include_domains
const scoped = await fetch("https://api.specstream.ai/v1/web-search", {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
q: "NIS2 reporting deadline",
speed: "default",
include_domains: ["enisa.europa.eu", "eur-lex.europa.eu"],
}),
}).then((r) => r.json())
console.log(scoped.data.answer)

All request parameters

ParameterTypeBehavior
qstring (required)Query in everyday words in any language, 1 to 2,000 characters. Supports site:, -site:, -word, -"phrase", filetype:, after:, and before: operators. Optional only when like is sent.
speed"default" | "fast"fast ($1 per 1,000 searches, 937 ms median) returns ranked results and snippets without model reading. default ($5 per 1,000 searches) also reads results to return answer and rows.
numinteger (1 to 100)Number of sources to return (default 10; up to 200 with images=true). Each started block of 10 additional results adds $0.0012 on fast or $0.006 on default.
pageinteger (1 to 10)Result page index (default 1) continuing the same ranked list.
passagesbooleanReads top result pages and returns evidence highlights per source plus top passages across sources. Cannot be combined with compact, news, or images.
compactbooleanReturns compact sources only (title, url, dates, and one best-matching snippet capped at source_max_chars, default 4,000) to reduce agent token overhead.
pages_wait_msinteger (0 to 3500)Milliseconds to wait for page text when passages=true or compact=true.
like, unlikestring[] (max 20 each)Search from example URLs: pages similar to like come first, excluding unlike and named URLs. Web search only.
language, country, safestringTwo-letter language code (de), two-letter country code (DE), and safe search level (off, moderate, or strict).
news, imagesbooleanSwitch to news items or image results at the fast-tier price ($1 per 1,000). Not compatible with boost_domains or passages.
engines, engines_askedstring, booleanNarrow engines for one call (for example engines=-CN) and set engines_asked=true to inspect which engines answered.

Response shape

Every successful call returns {"data": {...}}. With speed="fast", data.sources returns ranked results in about a second without model reading. With speed="default", data.answer and data.rows are included alongside data.sources:

JSON
{
"data": {
"kind": "fact",
"query": "Who is the CEO of Stripe",
"answer": {
"value": "Patrick Collison",
"page": "https://en.wikipedia.org/wiki/Patrick_Collison",
"seen_at": "2026-11-05T01:06:52+00:00"
},
"rows": [
{
"name": "Patrick Collison",
"page": "https://en.wikipedia.org/wiki/Patrick_Collison",
"probability": 0.64
}
],
"sources": [
{
"url": "https://en.wikipedia.org/wiki/Patrick_Collison",
"title": "Patrick Collison - Wikipedia",
"site": "en.wikipedia.org",
"cited": true
},
{
"url": "https://www.forbes.com/profile/patrick-collison/",
"title": "Patrick Collison - Forbes",
"site": "forbes.com",
"cited": false
}
],
"took_ms": 2404,
"price_usd": 0.005
}
}

Status codes

StatusWhat happened
401missing_api_key or invalid_token: send Authorization: Bearer <key>.
402insufficient_balance: add credit in Workspace Settings, Usage and billing, or pay per call with x402 or Stripe MPP.
403Key lacks finds:spend scope or would exceed its spend_cap_cents limit.
409Idempotency-Key was already answered. Send a new key for a fresh call.
422Validation error: q out of range, more than 20 sites in a domain parameter, invalid site syntax, include_domains combined with boost_domains, or boost_domains sent with news or images.
503Rate limit reached or search busy. Wait the seconds in Retry-After and retry.

Frequently asked questions

What is the difference between boost_domains and include_domains?

include_domains restricts the reply strictly to the listed domains, subdomains, or TLDs. boost_domains places matching sites first and runs bounded recall searches for the top boosted sites by name so their pages appear even when a plain query returns none, then appends results from the rest of the web. Sending both together returns HTTP 422.

How many domains can I send in boost_domains, include_domains, or exclude_domains?

Each parameter accepts up to 20 domains (apple.com), subdomains (news.nrk.no), or TLDs (.no), sent either as a JSON array or as one comma-separated string in POST, or repeated or comma-separated query parameters in GET. Sending more than 20 returns HTTP 422.

Does boost_domains work with both speed fast and speed default?

Yes. boost_domains, include_domains, and exclude_domains all work on both speed="fast" ($1 per 1,000 searches, 937 ms median) and speed="default" ($5 per 1,000 searches). boost_domains applies to web searches only and returns HTTP 422 when combined with news=true or images=true.

Can I pass TLDs like .no or .gov in boost_domains, include_domains, and exclude_domains?

Yes. Country and generic endings such as .no, .de, .eu, or .gov work in all three parameters. For country endings in boost_domains, SpecStream also targets that country during recall searches.

How much does /v1/web-search cost and how do I start?

New accounts start with $2 of free credit with no card required, which covers 2,000 fast searches ($1 per 1,000) or 400 default searches ($5 per 1,000) of up to 10 results each. SpecStream ranks first on WideSearch (60.93 low-cost, ahead of every search API) and scores 99 on SimpleQA Verified.