# Freshness and dates

Which sources are current, which are not, and how to get recent material into a search.

Not every source is equally fresh, and the API says so openly.

## The web source is not a live feed

`web` is a large index that is refreshed periodically, not continuously. That has three consequences:

- A page that changed recently may show its earlier text in the snippet.
- A page published in recent months may not be there yet.
- Web results carry no date. `published_date` is `null` on every `web` result.

For a question whose answer does not change week to week, none of this matters. For a question about this week, add a source that is kept current.

## The sources that are current

| Source | How fresh | Dates on results | Date filter |
|---|---|---|---|
| `social` | New posts within minutes. Holds the last 30 days | Yes | Yes |
| `hn` | New threads within minutes. Holds the last 30 days | Yes | Yes |
| `news` | Every hour | Yes | Yes |
| `podcasts` | Twice a day. Also holds years of history | Yes | Yes |
| `academic`, `medical` | Every day. Also hold years of history | Yes | Yes |
| `finance` | New filings are added in batches, so the newest can be some days old. Holds the last year of filings | Yes | Yes |
| `law` | Statutes and regulations every day; court opinions every quarter. Opinions carry their date | Some | Yes |
| `contracts`, `communities` | Every day | No | Yes |
| `web` | A large snapshot, rebuilt from time to time | No | No, with a warning |
| `smallweb` | Refreshed every week | Some | No, with a warning |
| `discussions` | Varies | Rarely | No, with a warning |

`contracts` and `communities` are filtered on a date the record holds but the result does not show.

`published_date` is `YYYY-MM-DD`, or a year alone, when the source knows it, and `null` otherwise.

[`GET /v1/sources`](https://millionshort.com/docs/api-reference/sources) returns this as data. Each source has a `freshness`, which is a `cadence` and a sentence, and for `web` also the dates between which its pages were captured. Each source also lists the `filters` it applies.

## Getting recent material

Send a date filter. `time_range` is `day`, `week`, `month` or `year`. `start_date` and `end_date` are days written `YYYY-MM-DD`, and both days are included. `time_range` cannot be combined with the two dates. All three are free.

The filter is applied by the sources whose records carry a date: `news`, `hn`, `social`, `communities`, `podcasts`, `academic`, `medical`, `law`, `finance` and `contracts`.

`web` pages carry no date of their own, so a date filter is not applied to `web`. The same holds for `smallweb` and `discussions`. Their results come back as if the filter had not been sent, and the response names them in a `filter_not_applied` warning. A filter is never ignored silently.

`hn` and `social` hold the last 30 days, so a date range that ends earlier returns nothing from them, and the warning says so.

For a question about this week:

1. **Ask a current source in the same call.** One search can ask up to five sources.
2. **Send `time_range`.** The dated sources return only what falls inside it.
3. **Treat undated `web` results as background.** They were not filtered by date. Read `warnings` to see which sources the filter did not reach.

```bash
curl https://api.millionshort.com/v1/search \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "central bank interest rate decision",
    "sources": ["news", "social", "web"],
    "num_results": 30,
    "time_range": "week"
  }'
```

```python
import os

from millionshort import MillionShort

client = MillionShort(api_key=os.environ["MILLIONSHORT_API_KEY"])

r = client.search(
    "central bank interest rate decision",
    sources=["news", "social", "web"],
    num_results=30,
    time_range="week",
)
recent = [hit for hit in r.results if hit["source"] != "web"]
background = [hit for hit in r.results if hit["source"] == "web"]
for hit in recent:
    print(hit["published_date"], hit["source"], hit["title"])
print(len(background), "undated web results kept as background")
for warning in r.warnings:
    print("warning:", warning["code"], warning["message"])
```

```ts
import { MillionShort } from 'millionshort';

const client = new MillionShort({ apiKey: process.env.MILLIONSHORT_API_KEY });

const r = await client.search('central bank interest rate decision', {
  sources: ['news', 'social', 'web'],
  numResults: 30,
  timeRange: 'week',
});
const recent = r.results.filter((hit) => hit.source !== 'web');
const background = r.results.filter((hit) => hit.source === 'web');
for (const hit of recent) {
  console.log(hit.published_date, hit.source, hit.title);
}
console.log(background.length, 'undated web results kept as background');
for (const warning of r.warnings) console.log('warning:', warning.code, warning.message);
```

The same call as a tool of the MCP server:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "search",
    "arguments": {
      "query": "central bank interest rate decision",
      "sources": [
        "news",
        "social",
        "web"
      ],
      "num_results": 30,
      "time_range": "week"
    }
  }
}
```

This call costs 3 credits for the three sources and 1 for the twenty results beyond the first ten. The date filter costs nothing.

`language` and `country` are filters too, and each is applied by the sources that can apply it. The `web` source stores no language. It is mostly English, with pages in other languages too, so the language of each web result is detected from its text and a `language` filter is applied to that; the response says so in a `language_detected` warning. Every result carries its `language` when it is known. The [Search reference](https://millionshort.com/docs/search/parameters#dates-language-and-country) has the table.

## Being told when something new appears

You can poll a search on a schedule yourself, or let [Monitor](https://millionshort.com/docs/monitor/parameters) do it for you: it runs a search on an interval and reports only the results it has not seen before. The [news monitoring guide](https://millionshort.com/docs/monitor/guides/news-monitoring) shows both.

## Reading a page as it is now

A snippet is the text the index holds. So is `content`, which `include_content: true` adds to `web` and `news` results: `captured_from` and `captured_to` say when we captured the page. To read a page as it is at this moment, use [Extract](https://millionshort.com/docs/extract/parameters), which fetches a page and returns clean text with the time it was fetched.
