# Search

One call, one to five sources, one ranked list, and filters that say what kind of web you want.

```text
POST https://api.millionshort.com/v1/search
```

Search is live. It answers from our own independent index: the web, Billions+ pages, and twelve specialist sources beside it. One request names one to five sources and gets back one ranked list in one shape, whichever sources answered.

```bash
curl https://api.millionshort.com/v1/search \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "sourdough starter hydration", "remove_top_sites": 10000 }'
```

```python
import os

import requests

r = requests.post(
    "https://api.millionshort.com/v1/search",
    headers={"Authorization": "Bearer " + os.environ["MILLIONSHORT_API_KEY"]},
    json={
        "query": "sourdough starter hydration",
        "remove_top_sites": 10000
    },
    timeout=30,
)
r.raise_for_status()
for hit in r.json()["data"]["results"]:
    print(hit["position"], hit["title"], hit["url"])
```

```ts
const res = await fetch('https://api.millionshort.com/v1/search', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.MILLIONSHORT_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "query": "sourdough starter hydration",
    "remove_top_sites": 10000
  }),
});
if (!res.ok) throw new Error(`POST /v1/search failed: ${res.status}`);
const { data } = (await res.json()) as {
  data: { results: { position: number; title: string; url: string }[] };
};
for (const hit of data.results) console.log(hit.position, hit.title, hit.url);
```

The same call as a tool of the MCP server:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "search",
    "arguments": {
      "query": "sourdough starter hydration",
      "remove_top_sites": 10000
    }
  }
}
```

## What it is for

- **Grounding a model.** Results come with long snippets, the passages that best answer the query, and for web and news the page text we hold, so many jobs need no second call.
- **Reaching past the usual sites.** `remove_top_sites` takes the most popular sites out of the results. What is left is the long tail: specialists, primary sources, small sites.
- **Asking the right specialist.** Papers, court opinions, filings, forum threads, podcasts and news each have a source built for them, and one call can ask up to five.
- **Judging a result before reading it.** Every result says how popular its site is and whether it carries a risk label.

## In this section

| Part | Page |
|---|---|
| Quickstart | [A first search, then one filter at a time](https://millionshort.com/docs/search/quickstart) |
| Parameters | [Every request field and the whole response](https://millionshort.com/docs/search/parameters) |
| Guides | [RAG, agent tool use, long-tail research](https://millionshort.com/docs/search/guides), and the [filter recipes](https://millionshort.com/docs/search/filters#agent-recipes) |
| Pricing and limits | [What a search costs and how many you can run](https://millionshort.com/docs/search/pricing) |
| Errors | [The errors and warnings of a search](https://millionshort.com/docs/search/errors) |

## What a search can do

| Page | What it covers |
|---|---|
| [Sources](https://millionshort.com/docs/search/sources) | The 13 sources, a page each: what it holds, what its results carry, queries to try |
| [Mixture of Experts](https://millionshort.com/docs/search/mixture-of-experts) | Why the sources are separate specialists, and how one call asks several |
| [Filters](https://millionshort.com/docs/search/filters) | Every filter on one page, with recipes for agents |
| [Remove top sites](https://millionshort.com/docs/search/remove-top-sites) | The popularity cut: `remove_top_sites` and `only_top_sites` |
| [Lenses](https://millionshort.com/docs/search/lenses) | Boost, bury, block, or search only named sites |
| [Spaces](https://millionshort.com/docs/search/spaces) | A saved scope, passed as `space` |
| [Topics and page types](https://millionshort.com/docs/search/topics-and-page-types) | 24 subjects and 23 kinds of page to keep or leave out |
| [Popularity and risk](https://millionshort.com/docs/search/popularity-and-risk) | What each result says about its site |
| [Site signals](https://millionshort.com/docs/search/site-signals) | Traffic trend, where a site is popular, what it is built with |
| [Freshness](https://millionshort.com/docs/search/freshness) | How current each source is, and how to read dates |
| [Highlights and page text](https://millionshort.com/docs/search/highlights) | The best passages of each result, and the text of the page itself |

## Beside the API

The same search is a tool of the hosted [MCP server](https://millionshort.com/docs/mcp), with or without a key, and a method of the [Python](https://millionshort.com/docs/sdks/python) and [TypeScript](https://millionshort.com/docs/sdks/typescript) SDKs. Two smaller calls go with it: [`GET /v1/sources`](https://millionshort.com/docs/api-reference/sources) lists the sources, page types and topics a search accepts, and [`POST /v1/domain`](https://millionshort.com/docs/api-reference/domain) returns popularity and risk for any site.

## With the other endpoints

Search finds pages. [Extract](https://millionshort.com/docs/extract) reads them, [Monitor](https://millionshort.com/docs/monitor) watches a search for new results, [Map](https://millionshort.com/docs/map) and [Crawl](https://millionshort.com/docs/crawl) find and read the pages of one site, and [Places](https://millionshort.com/docs/places) finds businesses and points of interest. [Agent](https://millionshort.com/docs/agent) runs several searches to answer one question, with a checked quote for every statement. [The endpoints](https://millionshort.com/docs/endpoints) has all six at a glance.
