API Reference

Search API

The Search API performs federated multi-backend web search with HyperFusion neural ranking, QATBE token-budgeted extraction, and SCS semantic segmentation — all in a single request.

POST/v1/search

Request

Headers

HeaderValueRequired
AuthorizationBearer hsx_...Yes
Content-Typeapplication/jsonYes

Body parameters

ParameterTypeRequiredDescription
querystringYesSearch query. Max 500 characters.
tierstringNoDetail level: key_facts (~200 tok), summary (~1k tok, default), detailed (~5k tok), complete (~20k tok).
token_budgetintegerNoOverride tier with exact token budget. Range: 100–10,000.
max_sourcesintegerNoMaximum sources to search. Range: 1–20. Default: 10.
backendsstring[]NoForce specific backends: brave, google, bing, stackoverflow, github, reddit. Default: auto-selected by ABS algorithm.
languagestringNoBCP-47 language code for results (e.g. en, de). Default: en.
freshnessstringNoFilter by date: day, week, month, year. Default: no filter.
include_domainsstring[]NoRestrict results to these domains.
exclude_domainsstring[]NoExclude results from these domains.

Example request

search.sh
curl -X POST https://api.hypersearchx.zuhabul.com/v1/search \
  -H "Authorization: Bearer hsx_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "rust async programming best practices",
    "tier": "detailed",
    "max_sources": 8,
    "freshness": "year"
  }'
search.ts
const res = await fetch("https://api.hypersearchx.zuhabul.com/v1/search", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.HSX_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: "rust async programming best practices",
    tier: "detailed",
    max_sources: 8,
    freshness: "year",
  }),
});
const data = await res.json();
search.py
import os, requests

r = requests.post(
    "https://api.hypersearchx.zuhabul.com/v1/search",
    headers={"Authorization": f"Bearer {os.environ['HSX_API_KEY']}"},
    json={
        "query": "rust async programming best practices",
        "tier": "detailed",
        "max_sources": 8,
        "freshness": "year",
    }
)
r.raise_for_status()
data = r.json()

Response

response.json
{
  "meta": {
    "query": "rust async programming best practices",
    "tier": "detailed",
    "tokens_used": 4821,
    "sources_count": 8,
    "duration_ms": 1247,
    "result_id": "09742460-58db-44fd-9036-502ed26565e2",
    "backends_used": ["brave", "stackoverflow", "github"]
  },
  "results": [
    {
      "title": "Async in Rust: A comprehensive guide",
      "url": "https://tokio.rs/tokio/tutorial",
      "domain": "tokio.rs",
      "snippet": "Tokio is an asynchronous runtime for the Rust programming language...",
      "score": 0.941,
      "published_at": "2024-11-15T00:00:00Z",
      "source_type": "documentation"
    }
  ]
}

Response fields

meta

FieldTypeDescription
querystringThe query as processed (post-expansion)
tierstringDetail tier used
tokens_usedintegerTokens consumed from your budget
sources_countintegerTotal sources searched across all backends
duration_msintegerEnd-to-end latency in milliseconds
result_idstringUUID for this result set
backends_usedstring[]Which search backends were queried

results[]

FieldTypeDescription
titlestringPage title
urlstringFull URL of the result
domainstringHostname of the result
snippetstringToken-budgeted QATBE-extracted content
scorefloatHyperFusion neural ranking score (0–1)
published_atstring?ISO 8601 publication date if available
source_typestring?Content classification: documentation, blog, forum, paper, etc.

Detail tiers

The tier parameter controls the QATBE (Query-Aware Token-Budgeted Extraction) algorithm. Higher tiers extract more content per source but consume more of your token budget:

TierApprox tokensBest for
key_facts~200Quick answers, chatbot responses, speed-critical apps
summary~1,000General AI context, RAG pipelines, default choice
detailed~5,000Thorough research, long-form content generation
complete~20,000Full document extraction, comprehensive analysis

Backend selection

By default, the Adaptive Backend Selector (ABS) algorithm analyzes your query and selects the optimal combination of backends. You can override this:

json
{
  "query": "tokio select macro explanation",
  "tier": "summary",
  "backends": ["stackoverflow", "github", "brave"]
}

Available backends: brave, google, bing, stackoverflow, github, reddit, searxng

Next steps