Menu

Search

Spaces

A saved scope for search. Describe a corner of the web once, then search it with one parameter.

Copy as MarkdownOpen in ChatGPT (opens in a new tab)Open in Claude (opens in a new tab)

A Space is a search scope with a name. It holds the things you would otherwise repeat on every request:

You save it once and pass its name as space on POST /v1/search. Spaces are free, and a search with a Space costs what the search costs.

A vertical search engine in one parameter

A search engine for one subject is mostly a decision about scope: which sites count, which kinds of page, what to leave out. A Space is that decision, saved. The agent that uses it does not need to know the list. It sends a query and a name.

JSON
{ "query": "sourdough hydration", "space": "baking" }

That is worth having when:

For a scope that is used once, send the fields on the request. A Space saves nothing there.

Only, or boost

mode says what the list of sites means.

modeThe searchUse it when
onlyReturns results from these sites and no others. The defaultThe answer must come from a closed set: your documentation, approved publishers, a list of journals
boostSearches everything and moves these sites aheadYou trust some sites more but still want to hear from the rest

only gives a short, clean list, and an empty one when those sites have nothing on the query. boost never comes back empty for that reason. If you are unsure, start with boost: it cannot hide a good result.

A Space does not need sites at all. One with no sites, remove_top_sites: 10000 and exclude_page_types: ["products", "listicles"] is a scope too: the long tail, without the shops.

A search inside a list uses the first 50 sites of a Space, and the answer says when a longer list was cut. The reference has the detail.

Curated Spaces

Some scopes we have made ourselves: Spaces for a subject, put together and kept by us. They are the same ones the MillionShort search site offers. Everyone can read them and search with them, with or without a key, and they are read-only.

JSON
{ "query": "cast iron seasoning", "space": "curated:home-cooking" }

curated:home-cooking stands for any curated slug; GET /v1/spaces?scope=curated lists the real ones. To change a curated Space, read it and create your own from its fields.

The request wins

A Space is a set of defaults. A parameter you send on the request replaces the Space's value for that setting, and everything you do not send comes from the Space. So one search can step outside the scope without changing it:

JSON
{ "query": "sourdough hydration", "space": "baking", "remove_top_sites": 0 }

Here the sites still come from the Space, and its popularity cut is switched off for this call. The answer lists what the Space supplied in data.space.applied and what the request replaced in data.space.overridden, so an agent can always see the scope it searched. The reference has the table of which parameter replaces which setting.

A worked example

A support assistant should answer from the product's documentation and two community sites, prefer tutorials, and never cite a shop page.

Create the Space once:

Example
Shell
curl https://api.millionshort.com/v1/spaces \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Support",
    "sites": ["docs.example.com", "example.org/community", "forum.example.net"],
    "lens": {
      "boost": ["type:tutorials", "type:documentation"],
      "bury": ["type:forums"],
      "block": ["type:products"]
    },
    "safe_search": "strict"
  }'

The answer carries the Space with its id and the slug made from its name, support. Every search of the assistant then names it:

Example
Shell
curl https://api.millionshort.com/v1/search \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "rotate an API key without downtime", "space": "support", "max_highlights": 2 }'

Only those three sites are searched. Tutorials and documentation come first, forum threads last, and product pages are left out. When the documentation moves to a new host, change the Space with one PATCH; the assistant's code and prompt stay as they are.

When a question needs the wider web, the assistant sends the same query with no space. The scope is a choice per search, not a setting of the key.

With the other controls

This page as Markdown ยท llms.txt