Search one project's documentation
Use site= with vertical=code and content_type[]=docs to restrict a search to one project’s documentation instead of filtering the results afterwards.
The problem
The instinct is to put the domain in the query string — "tokio docs.rs async" — and hope ranking does the rest. It usually will not: the domain becomes ordinary query terms competing with the real ones, so you get pages *about* docs.rs alongside pages *on* it, and the results are quietly worse for a reason that is hard to see.
What to send
sitedocs.rs
A hard restriction to one host. Not a hint, not a boost.
verticalcode
Disambiguates by construction — "rust" cannot return metallurgy from the code vertical.
content_type[]docs
Excludes blog posts and forum threads on the same host.
- Unfiltered query128 hits
- Scoped to the code vertical
vertical=code47 hits - Restricted to one host
site=docs.rs19 hits - Documentation only
content_type[]=docs11 hits
The code
curl -H "x-api-key: ulb_..." \
"https://api.unlob.com/search?q=async+runtime&site=docs.rs&vertical=code&content_type[]=docs&limit=10"import httpx
r = httpx.get(
"https://api.unlob.com/search",
headers={"x-api-key": "ulb_..."},
params={
"q": "async runtime",
"site": "docs.rs",
"vertical": "code",
"content_type[]": "docs",
"limit": 10,
},
)
for hit in r.json()["results"]:
print(hit["score"], hit["url"])The mistake to avoid
Putting the domain in `q` instead of `site`. It looks like it works — you get plausible results — which is exactly what makes it expensive to discover. Filters are evaluated before scoring; query terms compete with your real ones.
Frequently asked questions
Can I search several sites at once?
`site` takes one host. For a small set, run one call per host and merge — they are independent and can go in parallel. To go the other way and remove hosts, `exclude_site[]` accepts several.
Does site include subdomains?
It matches the host as indexed. If a project splits documentation across `docs.example.com` and `example.com/docs`, that is two calls or one `tld`-scoped query, not one `site` value.
Try it against your own queries
10,000 requests a month on the free tier, no card. Enough to run a real evaluation set rather than a demo.