/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
curl -H "x-api-key: $UNLOB_API_KEY" \
"https://api.unlob.com/search?q=rust+AND+async+-python&vertical=code&mode=hybrid&limit=5"| Parameter | Type | Description |
|---|---|---|
qrequired | string | The query. Supports AND / OR, `-` negation and "quoted phrases". |
mode | keyword | semantic | hybrid default: hybrid | Retrieval strategy. |
limit | integer default: 10 | Number of hits. `0` returns the count only. |
vertical | string | Restrict to one vertical core. Omit to auto-route. |
site | string | Restrict to a single host. |
exclude_site | string[] | Hosts to drop from results. |
lang | string | ISO language code. Also accepts `langs[]` for several. |
from / to | unix timestamp | Crawl-time window (`fetched_at`). |
published_from / published_to | unix timestamp | Content-date window — usually the recency you actually mean. |
term | string | An exact salient-term needle that must be present. |
source | cc | delta | Crawl provenance: the batch corpus or the delta crawler. |
min_host_rank | float | Floor on host authority. |
min_quality | integer | Floor on passage quality score. |
min_centrality | float | Floor on graph centrality. |
min_independent_sources | integer | Require corroboration by N distinct hosts. |
content_type | string[] | article, news, docs, code, academic, forum, and more. |
authority | string[] | edu, gov, org, com, other. |
topic | string[] | Topic tags assigned at index time. |
tld | string[] | Top-level domains to include. |
safe | boolean default: true | Drops explicit content. |
min_words / max_words | integer | Passage length bounds. |
sort | string default: relevance | relevance, recency, host_rank, quality, published, words or centrality. |
collapse | none | host | page | story | Deduplicate results by host, page or story cluster. |
facets | boolean default: false | Return facet counts alongside results. |
fields | string[] | Project only the fields you need. |
prefer_recent / prefer_authority | boolean | Soft 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"
}
]
}
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.
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.
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.
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.
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.
From an agent
This endpoint is also exposed as the MCP tool web_search, so an agent can call it without any HTTP code.
// 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.