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.
| Parameter | Type | Behavior |
|---|---|---|
boost_domains | string[] | string | Rank 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_domains | string[] | string | Return 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_domains | string[] | string | Remove 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")
cURL: GET /v1/web-search with include_domains and exclude_domains (speed: "default")
Python: fast boost_domains and default include_domains
JavaScript / TypeScript: POST /v1/web-search
All request parameters
| Parameter | Type | Behavior |
|---|---|---|
q | string (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. |
num | integer (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. |
page | integer (1 to 10) | Result page index (default 1) continuing the same ranked list. |
passages | boolean | Reads top result pages and returns evidence highlights per source plus top passages across sources. Cannot be combined with compact, news, or images. |
compact | boolean | Returns 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_ms | integer (0 to 3500) | Milliseconds to wait for page text when passages=true or compact=true. |
like, unlike | string[] (max 20 each) | Search from example URLs: pages similar to like come first, excluding unlike and named URLs. Web search only. |
language, country, safe | string | Two-letter language code (de), two-letter country code (DE), and safe search level (off, moderate, or strict). |
news, images | boolean | Switch to news items or image results at the fast-tier price ($1 per 1,000). Not compatible with boost_domains or passages. |
engines, engines_asked | string, boolean | Narrow 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:
Status codes
| Status | What happened |
|---|---|
401 | missing_api_key or invalid_token: send Authorization: Bearer <key>. |
402 | insufficient_balance: add credit in Workspace Settings, Usage and billing, or pay per call with x402 or Stripe MPP. |
403 | Key lacks finds:spend scope or would exceed its spend_cap_cents limit. |
409 | Idempotency-Key was already answered. Send a new key for a fresh call. |
422 | Validation 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. |
503 | Rate 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.