> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getclean.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> getclean's own MCP server is at https://mcp.getclean.ai/mcp. The /mcp path of this docs site is Mintlify's search over these pages, not getclean.
> Every answer of the API opens with outcome. A page that could not be read is a record whose outcome says why, never an HTTP error; read outcome before anything else.
> The API's contract is the OpenAPI 3.1 file at https://docs.getclean.ai/openapi.yaml; the SDKs are generated from it.
> The product's name is written getclean, in lower case.

# Time machine: read a page as it was on a past day

> Name a day, and fetch the page as an archive stored it on or before that day. The response says when the copy was made and when the next one was, so you can step through a page's past and find the day a sentence changed.

A backtest must see only what could be known on the trade date. A reporter must show what a statement said before it was edited. A lawyer needs the terms as they were on the day a customer signed. Each needs a page as it was, not as it is. Send the day as `as_of_date`, and the fetch reads the page from an archive's copy of that time.

## Fetch the page as of a day

```bash cURL theme={"theme":"css-variables"}
curl https://api.getclean.ai/v1/contents \
  --header "Authorization: Bearer $GETCLEAN_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{ "url": "SOURCE_URL", "as_of_date": "2026-10-01" }'
```

```python Python theme={"theme":"css-variables"}
import datetime

from getclean import GetClean

client = GetClean()

record = client.fetch_contents(url="SOURCE_URL", as_of_date=datetime.date(2026, 10, 1))
```

```typescript TypeScript theme={"theme":"css-variables"}
import { GetClean } from "getclean";

const client = new GetClean();

const record = await client.fetchContents({ url: "SOURCE_URL", as_of_date: "2026-10-01" });
```

Replace `SOURCE_URL` with the address of the page.

The copy that comes back is the latest one made on or before the end of that day, in UTC. The record is like any other: the main content with its structure, sections, blocks, and a fingerprint.

## Read which copy came back

The response says where the copy is from and when it was made. This one is cut to those fields.

```json 201 Created theme={"theme":"css-variables"}
{
  "outcome": { "kind": "delivered", "reason": "whole" },
  "source": {
    "carrier": "archive",
    "archive": { "captured_at": "2026-09-02T14:11:36Z" },
    "next_capture_at": "2026-10-14T06:02:10Z"
  }
}
```

`captured_at` is the moment the archive made the copy. Here the day asked for was 2026-10-01 and the copy is from 2026-09-02, so the page might have changed in between without a copy. A date that the page prints about itself is a claim of the page. The time of the copy is what was observed.

A copy later on the same day can come back. If you need the page before an event of that day, ask for the day before.

## Step forward copy by copy

`next_capture_at` is the time of the next copy after this one. Fetch that day, and the next, to walk through the page's past.

To find the day a sentence appeared or went, compare 2 copies. Both are records, so `compare_contents` returns what changed between them, block by block. For the request, see [Find the one cell that changed](https://docs.getclean.ai/read/track-what-changed.md).

## Read many pages as of their own days

In a batch each address can have its own `as_of_date`. A backtest over 20 pages and 20 trade dates is one call.

```json Part of a request to fetch_contents_batch theme={"theme":"css-variables"}
{
  "items": [
    { "url": "SOURCE_URL", "as_of_date": "2026-03-03" },
    { "url": "SECOND_SOURCE_URL", "as_of_date": "2026-06-09" }
  ]
}
```

## Search as of a day

`search` takes `as_of_date` too. A datasource that has its past searches as it was at the end of that day, and each result that the search fetches is read from an archive's copy. The catalog says for each datasource whether it has its past, in `history`.

## Know what a past day cannot give

An archive has only the copies it made. If there is no copy on or before the day, the record's outcome is `failed` with the reason `no_history`, and `source.archives_consulted` names the archives that were asked. Nothing is guessed in its place.

The copy is the page as the archive served it. Its links point into the archive. The country and the language of the visit cannot be chosen for a copy, and no picture of the page is made.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.