Time Portal · Fetch

Fetch

Time Portal fetch gives an archived copy of a page from the time-gated web.

Request

Send a POST request to https://api.epochal.com/v1/time-portal/fetch with three headers and a JSON body.

HeaderRequiredValue
x-api-keyYesYour API key. See Authentication.
Accept-DatetimeYesThe instant the request is set to: a past HTTP-date or RFC 3339 instant at or after 1970-01-01T00:00:00Z. For every form it accepts, see How the Instant Works.
Content-TypeYesapplication/json
curl https://api.epochal.com/v1/time-portal/fetch \
  -H "x-api-key: $EPOCHAL_API_KEY" \
  -H "Accept-Datetime: 2026-03-01T00:00:00Z" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://news.example.com/energy/battery-plant-delay",
    "max_characters": 2000
  }'

Body fields

FieldTypeDefaultDescription
urlstringrequiredFull http or https URL to retrieve.
max_charactersinteger, 1 to 1,000,000100000Maximum characters of content to return. Longer pages set truncated: true. Ignored for format: "page".
formatstructured or pagestructuredstructured returns extracted markdown and metadata in JSON. page returns the raw archived document body with its Content-Type header.

Unknown fields are rejected with 400.

Response

A 200 returns the page's content and metadata, with the instant and a request id.

JSON

json

{
  "as_of": "2026-03-01T00:00:00Z",
  "request_id": "7c2e5f0a-93b4-4d1e-a6f8-2b0c9e4d7a15",
  "status": "success",
  "id": "6b81feebde1a4821a125fb307894e7ad",
  "url": "https://news.example.com/energy/battery-plant-delay",
  "final_url": "https://news.example.com/energy/battery-plant-delay/",
  "title": "Battery plant start pushed back to late 2027",
  "description": "The cell maker said commissioning would slip.",
  "author": "Jane Doe",
  "published_at": "2026-02-11T06:12:00Z",
  "language": "en",
  "content": "# Battery plant start pushed back to late 2027\n\nThe cell maker said…",
  "truncated": true,
  "entity": null
}
FieldMeaning
as_ofThe instant the read was set to, from Accept-Datetime.
request_idIdentifies this request in Epochal's logs; quote it when reporting a problem.
statussuccess when the page was read; error when it could not be, with the reason in page_error.
page_errorWhy the page could not be read: the site's http_status_code and a short message. Absent on success.
idIdentifies the exact stored copy served. null when unknown.
urlThe URL as requested.
final_urlThe URL the content was read from, after redirects and normalization.
titleThe page's title.
descriptionPage summary from metadata. null if not specified.
authorPage authors, comma-separated. null if none are listed.
published_atWhen the page was published. null when unknown.
languageThe page's language as a BCP 47 tag. null when not detected.
contentThe page's extracted text as markdown, at most max_characters long.
truncatedWhether max_characters cut content short.
entityWhen the URL is an Epochal World page, the crypto asset, city's weather, person, organization, or place it names, as of the instant. It has a type and properties. null for an ordinary web page. See World Entities.

A page that could not be read

When the request is fine but there is no readable copy of the page, the response is still a 200, with status set to error, an empty content, and the reason in page_error:

page_error.http_status_codeWhat happened
nullThere is no copy of the page from at or before the instant. Try a later Accept-Datetime, or search first for a URL that has one.
4xxThe site refused the read or had no such page then, such as 404 or 403. Do not retry the same URL at the same instant.
5xxThe site failed when the copy was read.
2xxThe copy has no readable content.

A page whose redirects lead to a URL that is never served reads Not served., with a 403 or 400. A read that reaches no page counts as a request like any other.

With format: page the body is the document itself, so the page's outcome is in two response headers instead, on every 200:

Response headerDescription
x-fetch-status-codeArchived origin's HTTP status code (200 on success, or the origin's 404, 403, 429, 500, etc.). 0 when no copy exists at or before Accept-Datetime or the host was unreachable. Matches page_error.http_status_code above.
x-fetch-status-messageHuman-readable summary (OK. on success, or page_error.message). Branch on the numeric code, not the message.

When the page was not read, the body is empty and omits Content-Type and Memento-Datetime. The HTTP status is still 200, and the request still counts against your quota. A non-200 status means the API request itself failed. Treat x-fetch-status-code as the page's status:

Status linex-fetch-status-codeWhat happenedWhat to do
2002xxThe page was read; the body is the document.Use it.
2004xx or 5xxThe origin site returned this status when archived.Avoid retrying the same URL at the same instant because the archived response will not change.
2000No copy from at or before the instant, or the host could not be reached.Try a later Accept-Datetime or another URL instead of retrying.
not 200absentThe request failed; see Errors.Act on the status: fix the request, wait for Retry-After, or retry with backoff.

In a sandbox, an agent's reads go through this same call, and the response is reshaped so ordinary HTTP clients work. See Images and Network.

cURL

bash

curl -sS -D - -o page.html https://api.epochal.com/v1/time-portal/fetch \
  -H "x-api-key: $EPOCHAL_API_KEY" \
  -H "Accept-Datetime: 2026-03-01T00:00:00Z" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://news.example.com/energy/missing", "format": "page"}'
# HTTP/2 200
# x-fetch-status-code: 404
# x-fetch-status-message: Page not found.

Errors

A non-200 status means the request itself failed, in either format. Errors use the same JSON shape as every other endpoint. No error counts against your free requests.

StatustypeWhat to do
400invalid_requesturl is missing, is not a full http/https URL, targets a private/local host, uses a port other than 80 or 443, or includes embedded credentials; max_characters is out of range; or Accept-Datetime is missing, invalid, not in the past, or before 1970. See error.message for details.
401invalid_api_keyThe x-api-key header is missing, or the key is unknown, revoked, or expired. Fix the key.
402free_quota_exhaustedYour organization has exhausted its free trial requests. Contact us for more.
403url_not_allowedThis URL is blocked from fetching. Use another source instead of retrying.
429rate_limit_exceededRate limit exceeded. Wait for Retry-After before retrying.
500, 503, 504internal_error, service_unavailable, timeoutSomething failed on Epochal's side. Retry with backoff.

For the cause and fix of each, see Errors.

Next steps

Search

Time Portal search gives ranked results from the time-gated web.

How the Instant Works

Every Time Portal request evaluates against a point-in-time cutoff specified in Accept-Datetime.

Sandbox

A sandbox is a Linux virtual machine whose clock and network are set to an instant.

Errors

Standard JSON error envelope, HTTP status codes, sandbox failure types, and retry rules.