# Research from primary sources

The document that said it first is rarely at the top of a result list. Removing the most popular sites takes away the coverage that sits on top of it.

Primary-source research is any work where the output must cite the origin: the filing, the opinion, the paper, the dataset, the standard. Analysts, journalists, policy teams and due-diligence teams all need it, and so does a model that is asked to cite. The glossary has more on [primary sources in RAG](https://millionshort.com/docs/glossary/what-are-primary-sources-in-rag).

## The problem

Search for anything newsworthy and the top results are coverage: articles that summarize articles that summarize a press release about the document. Each step drops detail and adds interpretation. The original often sits on a site that will never outrank the sites that write about it: a regulator's subdomain, a university server, a standards body, the personal site of the person who did the work. Re-ranking does not fix this when the original was not in the list to begin with.

## How MillionShort addresses it

- **Remove the coverage layer.** [`remove_top_sites`](https://millionshort.com/docs/search/remove-top-sites) removes results from the N most popular sites. With the large publishers and aggregators gone, what is left is the layer under them. This is [long-tail search](https://millionshort.com/docs/glossary/what-is-long-tail-search).
- **Search where originals are kept.** Several of the [13 sources](https://millionshort.com/docs/search/sources) hold primary material by nature: `law` (United States), `academic`, `medical`, `finance` and `contracts`. One call searches up to 5 and returns one ranked list, and each source costs the same as `web`.
- **Stay inside sites you trust.** `include_domains` limits a search to up to 25 sites you name, such as an agency or a publisher you already rely on. `exclude_domains` blocks a site that keeps restating the story. See [Lenses](https://millionshort.com/docs/search/lenses).
- **Filter by kind.** `page_types` and `topics` keep only matching results; the slugs come from `GET /v1/sources`.
- **Check the site.** Each result has [`popularity` and `risk`](https://millionshort.com/docs/search/popularity-and-risk). A long-tail site is not automatically an original, so these help you decide what to open. `POST /v1/domain` returns both for up to 25 domains for 1 credit.
- **See why.** `explain: true` adds `why` and `signals` to each result, free.

## Two searches

The web without its 1,000 most popular sites, alongside the law source:

```bash
curl https://api.millionshort.com/v1/search \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "heat pump subsidies eligibility rule",
    "sources": ["web", "law"],
    "remove_top_sites": 1000,
    "num_results": 20,
    "max_chars_per_result": 1200
  }'
```

```python
import os

import requests

r = requests.post(
    "https://api.millionshort.com/v1/search",
    headers={"Authorization": "Bearer " + os.environ["MILLIONSHORT_API_KEY"]},
    json={
        "query": "heat pump subsidies eligibility rule",
        "sources": [
            "web",
            "law"
        ],
        "remove_top_sites": 1000,
        "num_results": 20,
        "max_chars_per_result": 1200
    },
    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": "heat pump subsidies eligibility rule",
    "sources": [
      "web",
      "law"
    ],
    "remove_top_sites": 1000,
    "num_results": 20,
    "max_chars_per_result": 1200
  }),
});
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": "heat pump subsidies eligibility rule",
      "sources": [
        "web",
        "law"
      ],
      "remove_top_sites": 1000,
      "num_results": 20,
      "max_chars_per_result": 1200
    }
  }
}
```

The same question limited to sites you name:

```bash
curl https://api.millionshort.com/v1/search \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "heat pump subsidies eligibility rule",
    "include_domains": ["example.gov", "example.org"],
    "explain": true
  }'
```

```python
import os

import requests

r = requests.post(
    "https://api.millionshort.com/v1/search",
    headers={"Authorization": "Bearer " + os.environ["MILLIONSHORT_API_KEY"]},
    json={
        "query": "heat pump subsidies eligibility rule",
        "include_domains": [
            "example.gov",
            "example.org"
        ],
        "explain": True
    },
    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": "heat pump subsidies eligibility rule",
    "include_domains": [
      "example.gov",
      "example.org"
    ],
    "explain": true
  }),
});
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": "heat pump subsidies eligibility rule",
      "include_domains": [
        "example.gov",
        "example.org"
      ],
      "explain": true
    }
  }
}
```

The first call searches two sources for twenty results and costs 2.5 credits. The second costs 1. In the first response, each result's `popularity.bucket` shows where its site stands. (The count in `summary.removed.popularity` stays 0 on some sources, `web` among them, even when the cut worked.)

## Working method

1. Search once without the filter to see the coverage and learn the terms the story uses.
2. Search again with `remove_top_sites` at 1,000, then 10,000, and add the specialist source that fits.
3. Open the candidates and confirm each one is the original, not a copy. The API does not know which page said it first.
4. Cite the URL of the original, and keep the `request_id` if you need to show how you found it.

## What it does not do

- **It does not identify primary sources.** It removes popular sites and searches specialist sources. Deciding that a page is the origin is your job, or your model's.
- **No live fetch of a document in a search.** A snippet goes up to 2,000 characters, and `include_content: true` adds the page text we hold to `web` and `news` results. That text is our copy from the day we captured the page, so read the page as it is now before you quote it: that is what [Extract](https://millionshort.com/docs/extract/parameters) is for.
- **No generated answers from a search.** For an answer written by us, [Agent](https://millionshort.com/docs/agent) is a separate, metered call: a written answer with a checked quote for every statement.
- **No date filter on web pages, and the web source is not continuously refreshed.** It is refreshed periodically and web results carry no date. Results from `news`, `social` and `hn` are fresh and dated. `start_date`, `end_date` and `time_range` work on them, and on `law`, `academic`, `medical`, `finance` and `contracts`, among others.
- **Law is United States only.**

## Read next

- [Long-tail research](https://millionshort.com/docs/search/guides/long-tail-research), the guide.
- [Search for research agents](https://millionshort.com/docs/use-cases/research-agents), when an agent does the searching.
- Glossary: [What are primary sources in RAG?](https://millionshort.com/docs/glossary/what-are-primary-sources-in-rag) and [What is long-tail search?](https://millionshort.com/docs/glossary/what-is-long-tail-search)
