unlob Docs
Browse documentation

Quickstart

A key, one search, and the passage you came for.

Get a key

Create one in the console. It looks like ulb_ followed by 48 hex characters, and it is shown once — the API stores only a hash, so a key you did not copy has to be rotated rather than recovered.

Give each key a label. The label and the last four characters are all you will have to tell two keys apart later.

export UNLOB_API_KEY=ulb_...

A key you just created can answer 401 for up to about a minute while it propagates to the serving fleet. That is expected — see Authentication.

curl -sG -H "x-api-key: $UNLOB_API_KEY" https://api.unlob.com/search \
  --data-urlencode 'q=how does tokio schedule tasks'
{
  "vertical": "code",
  "routed": true,
  "mode": "hybrid",
  "total": 12,
  "results": [
    {
      "id": "3be72f8af6378060:0",
      "url": "https://docs.rs/tokio",
      "host": "docs.rs",
      "title": "Tokio",
      "snippet": "Tokio is an asynchronous runtime for Rust providing building blocks…",
      "host_rank": 1.0,
      "quality": 92,
      "score": 0.71,
      "independent_sources": 4,
      "centrality": 0.63
    }
  ]
}

Three things to notice, because they are what makes this different from a search API you have used before:

  • snippet is the passage text, not a teaser. Most questions end here. There is a get_document call, but you usually will not need it.
  • routed: true means you did not name a vertical and the router picked code from your query. Name one yourself when you know it — it is cheaper and more precise.
  • independent_sources is how many distinct hosts assert this story. It is on every hit, for free, and it is the cheapest guard against repeating a rumour.

Read a passage in full

curl -s -H "x-api-key: $UNLOB_API_KEY" \
  https://api.unlob.com/doc/3be72f8af6378060:0

Connect an MCP client

If your agent speaks MCP, you do not need any of the above. Point it at the endpoint and it gets all eleven tools:

https://api.unlob.com/mcp

Claude Code, for example:

claude mcp add --transport http unlob https://api.unlob.com/mcp \
  --header "x-api-key: $UNLOB_API_KEY"

Every other client is on Connect a client.

Ask the API what it can do

Before hard-coding a filter list, read the one this deployment actually has. It needs no key:

curl -s https://api.unlob.com/describe

It reports every filter with its meaning, the sort and collapse values, the search modes, and the verticals, content types and topics this deployment currently holds — which is not necessarily what the docs said last month.

Where to go next

  • Search modes — when to use keyword, semantic or hybrid, and the query grammar that works in all three.
  • Filters and sorting — narrowing, and the two parameters that bias rather than filter.
  • Search recipes — worked examples for the questions people actually ask.
  • The Coverage Graph — the six calls that replace a retrieval loop.