API reference

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.

POST /v1/search
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.

Headers
# Pass your key with either header — both are accepted.
authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxx
x-api-key: sk_live_xxxxxxxxxxxxxxxxxxxxxxxx

Endpoints

/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.

POST/v1/search
Primary search — ranked results with optional filters and inline contents.
POST/search
Exa-compatible search (camelCase request/response).
POST/contents
Exa-compatible — fetch text/highlights for result ids or URLs.
POST/findSimilar
Exa-compatible — nearest neighbours of an indexed URL.
GET/healthz
Liveness probe.

The search request

A search is a JSON body with a query and any of the optional fields below.

query
string · required

The natural-language search query.

top_k
number

Number of results to return, 1–100. Default 10.

filters
FilterExpr

Metadata filters — see Filters below.

contents
Contents

Page text / highlights to return inline — see Page contents.

source
string[]

Restrict to these source tags, e.g. wikipedia, github_code.

exclude_source
string[]

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.

language
string[]

ISO-639-1 codes, e.g. en, de, ja.

country
string[]

ISO country codes.

domain_include
string[]

Only return results from these domains.

domain_exclude
string[]

Never return results from these domains.

tld
string[]

Restrict to these top-level domains, e.g. edu.

content_type
string[]

article · blog · news · forum · encyclopedia · documentation · reference · landing · pricing · other.

source_class
string[]

news · academic · government · commercial · community · personal · other.

crawl_date_after / crawl_date_before
number

Unix seconds — bound when the page was crawled.

publish_date_after / publish_date_before
number

Unix seconds — bound the page's publish date.

min_doc_length / max_doc_length
number

Bound document length, in bytes.

category
string[]

Corpus + code taxonomy: wikipedia, github_code, news, llms_txt, live_crawl, code_rust, code_python, …

min_stars / max_stars
number

GitHub 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.

200 OK · application/json
{
  "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_id
string

Stable 32-hex identifier for the result document.

url
string

Canonical page URL.

title
string | null

Page title, when available.

snippet
string | null

Query-relevant keyword window extracted from the page.

score
number

Relevance score; higher is more relevant.

crawl_date
string

ISO date the page was crawled.

domain
string

The result's domain.

language
string

Detected ISO-639-1 language.

text
string?

Full page text — present only when contents.text was requested.

highlights
string[]?

Excerpts — present only when contents.highlights was requested.

highlight_scores
number[]?

Per-highlight density scores, parallel to highlights.

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.

POST /v1/search
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 }
    }
  }'
text
boolean | { max_characters?: number }

Return the full page text; optionally cap its length.

highlights
boolean | { 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.

Free4 requests / second · 100 requests / minute
Scale1,000 requests / 10s
Enterprise5,000 requests / 10s

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 Request

Malformed JSON or an invalid filter value.

401 Unauthorized

Missing or invalid API key.

402 Payment Required

Out of credits — top up in the console.

429 Too Many Requests

Rate limit exceeded for your plan; retry after a moment.

502 Bad Gateway

The search backend was unreachable. Safe to retry.

504 Gateway Timeout

The query exceeded its time budget. Retry or narrow it.