Skip to content
unlob
GET

/search

The main query surface: returns metadata-only passage hits — url, host, title, snippet, score and world-model signals — but never the page body.

Search accepts a boolean query (rust AND async, -python, "exact phrase") and roughly thirty filters covering language, site, date, quality, authority, topic and graph centrality. It runs in keyword, semantic or hybrid mode; hybrid is the default and fuses BM25 with vector results by reciprocal rank.

Every hit is metadata only. That is a deliberate constraint rather than a limitation: an agent that receives ten full page bodies has spent its context before it has decided which page it wanted. Fetch the text you actually need with /doc/:id.

Hits carry more than relevance. centrality, community_id, independent_sources and in_degree are baked into the index at build time, so you can filter and sort by how well-connected or how well-corroborated a result is without paying for a graph query.

Request

GET /searchbash
curl -H "x-api-key: $UNLOB_API_KEY" \
  "https://api.unlob.com/search?q=rust+AND+async+-python&vertical=code&mode=hybrid&limit=5"
ParameterTypeDescription
qrequiredstringThe query. Supports AND / OR, `-` negation and "quoted phrases".
modekeyword | semantic | hybrid

default: hybrid

Retrieval strategy.
limitinteger

default: 10

Number of hits. `0` returns the count only.
verticalstringRestrict to one vertical core. Omit to auto-route.
sitestringRestrict to a single host.
exclude_sitestring[]Hosts to drop from results.
langstringISO language code. Also accepts `langs[]` for several.
from / tounix timestampCrawl-time window (`fetched_at`).
published_from / published_tounix timestampContent-date window — usually the recency you actually mean.
termstringAn exact salient-term needle that must be present.
sourcecc | deltaCrawl provenance: the batch corpus or the delta crawler.
min_host_rankfloatFloor on host authority.
min_qualityintegerFloor on passage quality score.
min_centralityfloatFloor on graph centrality.
min_independent_sourcesintegerRequire corroboration by N distinct hosts.
content_typestring[]article, news, docs, code, academic, forum, and more.
authoritystring[]edu, gov, org, com, other.
topicstring[]Topic tags assigned at index time.
tldstring[]Top-level domains to include.
safeboolean

default: true

Drops explicit content.
min_words / max_wordsintegerPassage length bounds.
sortstring

default: relevance

relevance, recency, host_rank, quality, published, words or centrality.
collapsenone | host | page | storyDeduplicate results by host, page or story cluster.
facetsboolean

default: false

Return facet counts alongside results.
fieldsstring[]Project only the fields you need.
prefer_recent / prefer_authoritybooleanSoft ranking preferences rather than hard filters.

Response

{ vertical, routed, mode, total, results: WebHit[], facets? }, where each WebHit carries url, host, title, snippet, score, published_at, content_type, authority, word_count, host_rank, quality, centrality, community_id, independent_sources and in_degree.


              
              {
            
              
                "vertical": "code",
            
              1
                "routed": true,
            
              
                "mode": "hybrid",
            
              
                "total": 128,
            
              
                "results": [
            
              
                  {
            
              
                    "id": "p:8f2c...",
            
              
                    "url": "https://docs.rs/tokio/latest/tokio/",
            
              
                    "host": "docs.rs",
            
              
                    "title": "tokio - Rust",
            
              2
                    "snippet": "A runtime for writing reliable, asynchronous...",
            
              3
                    "score": 0.912,
            
              
                    "host_rank": 0.87,
            
              
                    "quality": 92,
            
              4
                    "centrality": 0.41,
            
              5
                    "independent_sources": 6,
            
              
                    "published_at": 1730332800,
            
              
                    "content_type": "docs",
            
              
                    "source": "cc"
            
              
                  }
            
              
                ]
            
              
              }
            
  1. routed — True when the vertical was inferred from the query rather than supplied by you. Set `vertical` explicitly whenever you already know it — it is the single highest-leverage thing you can do to an ambiguous query.

  2. snippet — A snippet, never the page body. This is the difference that decides an agent's token bill: ten results cost a few hundred tokens instead of tens of thousands, and you fetch the full text of only the one the agent chose.

  3. score — The fused relevance score for this query. It ranks results within one response and is not comparable across queries — do not threshold on it as if it were an absolute quality measure.

  4. centrality — How well connected this page is within the link graph. A coverage-graph signal, returned on every hit at no extra cost and filterable without a second call.

  5. independent_sources — How many separately-owned hosts carry this claim, after near-duplicates and syndication are collapsed. The cheapest corroboration check available anywhere — it is already on the result you have.

The fields worth understanding before you write against this endpoint.

From an agent

This endpoint is also exposed as the MCP tool web_search, so an agent can call it without any HTTP code.

mcp: web_searchjson
// Find recent Rust async runtime documentation, excluding Python results.
{ "query": "rust AND async -python", "vertical": "code", "sort": "published", "limit": 8 }

Try this endpoint

Every endpoint is available on the free tier. Get a key and run the example above unchanged.