SearchSpace API
One authenticated POST returns ranked results from across the web, with optional metadata filters and inline page contents. The API is JSON over HTTPS — no SDK required.
Base URL: https://q.searchspace.io
Quickstart
Grab a key from the console and send your first query.
curl https://q.searchspace.io/v1/search \
-H "authorization: Bearer $SEARCHSPACE_API_KEY" \
-H "content-type: application/json" \
-d '{ "query": "how do vector databases work", "top_k": 5 }'Prefer to explore interactively? The playground builds the exact request body as you toggle filters, runs it live, and shows ready-to-paste snippets in cURL, Python and TypeScript.
Authentication
Every request needs an API key. Create one in the console; it's shown only once, so store it securely and pass it as a Bearer token (or x-api-key). Keep keys server-side — never ship them in client code.
# Pass your key with either header — both are accepted.
authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxx
x-api-key: sk_live_xxxxxxxxxxxxxxxxxxxxxxxxEndpoints
/v1/search is the primary endpoint. The Exa-compatible routes accept Exa's request/response shape, so an existing Exa SDK works unchanged by pointing it at the base URL above.
/v1/search/search/contents/findSimilar/healthzThe search request
A search is a JSON body with a query and any of the optional fields below.
querystring · requiredThe natural-language search query.
top_knumberNumber of results to return, 1–100. Default 10.
filtersFilterExprMetadata filters — see Filters below.
contentsContentsPage text / highlights to return inline — see Page contents.
sourcestring[]Restrict to these source tags, e.g. wikipedia, github_code.
exclude_sourcestring[]Exclude these source tags.
rank_mode"both" | "vector" | "bm25"Ranking signal. Default both — hybrid vector + BM25.
Filters
The filters object narrows results by metadata. Within a field, values are OR'd; across fields they are AND'd. Dates are Unix seconds.
languagestring[]ISO-639-1 codes, e.g. en, de, ja.
countrystring[]ISO country codes.
domain_includestring[]Only return results from these domains.
domain_excludestring[]Never return results from these domains.
tldstring[]Restrict to these top-level domains, e.g. edu.
content_typestring[]article · blog · news · forum · encyclopedia · documentation · reference · landing · pricing · other.
source_classstring[]news · academic · government · commercial · community · personal · other.
crawl_date_after / crawl_date_beforenumberUnix seconds — bound when the page was crawled.
publish_date_after / publish_date_beforenumberUnix seconds — bound the page's publish date.
min_doc_length / max_doc_lengthnumberBound document length, in bytes.
categorystring[]Corpus + code taxonomy: wikipedia, github_code, news, llms_txt, live_crawl, code_rust, code_python, …
min_stars / max_starsnumberGitHub repository star range (code results).
Response
200 OK returns a results array and a latency_ms timing. Each result carries the fields below; text, highlights and highlight_scores appear only when requested via contents.
{
"results": [
{
"doc_id": "9f2c4e1a7b8d...",
"url": "https://example.com/vector-databases",
"title": "How vector databases work",
"snippet": "...approximate nearest-neighbor search over embeddings...",
"score": 0.94,
"crawl_date": "2026-06-11",
"domain": "example.com",
"language": "en"
}
],
"latency_ms": 38
}doc_idstringStable 32-hex identifier for the result document.
urlstringCanonical page URL.
titlestring | nullPage title, when available.
snippetstring | nullQuery-relevant keyword window extracted from the page.
scorenumberRelevance score; higher is more relevant.
crawl_datestringISO date the page was crawled.
domainstringThe result's domain.
languagestringDetected ISO-639-1 language.
textstring?Full page text — present only when contents.text was requested.
highlightsstring[]?Excerpts — present only when contents.highlights was requested.
highlight_scoresnumber[]?Per-highlight density scores, parallel to highlights.
Code search
The index includes GitHub source code, segmented by language. Restrict to all code with filters.category: ["github_code"], to a language with code_rust / code_python, and gate on repo popularity with filters.min_stars / filters.max_stars. A file carries both github_code and its language category (categories are multi-valued), so the two compose.
curl https://q.searchspace.io/v1/search \
-H "authorization: Bearer $SEARCHSPACE_API_KEY" \
-H "content-type: application/json" \
-d '{
"query": "lock-free ring buffer",
"top_k": 10,
"filters": {
"category": ["code_rust"],
"min_stars": 1000
}
}'Page contents
There's no separate document-fetch call. Ask for page text or query-relevant highlights right in the search request with the contents object, and they come back inline on every result.
curl https://q.searchspace.io/v1/search \
-H "authorization: Bearer $SEARCHSPACE_API_KEY" \
-H "content-type: application/json" \
-d '{
"query": "how do vector databases work",
"top_k": 5,
"contents": {
"text": { "max_characters": 2000 },
"highlights": { "num_sentences": 3 }
}
}'textboolean | { max_characters?: number }Return the full page text; optionally cap its length.
highlightsboolean | { num_sentences?: number, highlights_per_url?: number, query?: string }Return query-relevant excerpts. Defaults: 1 sentence, 3 highlights per result, scored against the search query.
Rate limits
Limits are enforced per API key. Exceeding them returns 429; back off briefly and retry.
Errors
Errors use standard HTTP status codes and return a JSON body with an error message. 5xx responses are safe to retry with backoff.
400 Bad RequestMalformed JSON or an invalid filter value.
401 UnauthorizedMissing or invalid API key.
402 Payment RequiredOut of credits — top up in the console.
429 Too Many RequestsRate limit exceeded for your plan; retry after a moment.
502 Bad GatewayThe search backend was unreachable. Safe to retry.
504 Gateway TimeoutThe query exceeded its time budget. Retry or narrow it.