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.
| Header | Required | Value |
|---|---|---|
x-api-key | Yes | Your API key. See Authentication. |
Accept-Datetime | Yes | The 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-Type | Yes | application/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
| Field | Type | Default | Description |
|---|---|---|---|
url | string | required | Full http or https URL to retrieve. |
max_characters | integer, 1 to 1,000,000 | 100000 | Maximum characters of content to return. Longer pages set truncated: true. Ignored for format: "page". |
format | structured or page | structured | structured 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
}| Field | Meaning |
|---|---|
as_of | The instant the read was set to, from Accept-Datetime. |
request_id | Identifies this request in Epochal's logs; quote it when reporting a problem. |
status | success when the page was read; error when it could not be, with the reason in page_error. |
page_error | Why the page could not be read: the site's http_status_code and a short message. Absent on success. |
id | Identifies the exact stored copy served. null when unknown. |
url | The URL as requested. |
final_url | The URL the content was read from, after redirects and normalization. |
title | The page's title. |
description | Page summary from metadata. null if not specified. |
author | Page authors, comma-separated. null if none are listed. |
published_at | When the page was published. null when unknown. |
language | The page's language as a BCP 47 tag. null when not detected. |
content | The page's extracted text as markdown, at most max_characters long. |
truncated | Whether max_characters cut content short. |
entity | When 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_code | What happened |
|---|---|
null | There 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. |
4xx | The 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. |
5xx | The site failed when the copy was read. |
2xx | The 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 header | Description |
|---|---|
x-fetch-status-code | Archived 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-message | Human-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 line | x-fetch-status-code | What happened | What to do |
|---|---|---|---|
200 | 2xx | The page was read; the body is the document. | Use it. |
200 | 4xx or 5xx | The origin site returned this status when archived. | Avoid retrying the same URL at the same instant because the archived response will not change. |
200 | 0 | No 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 200 | absent | The 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.
| Status | type | What to do |
|---|---|---|
400 | invalid_request | url 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. |
401 | invalid_api_key | The x-api-key header is missing, or the key is unknown, revoked, or expired. Fix the key. |
402 | free_quota_exhausted | Your organization has exhausted its free trial requests. Contact us for more. |
403 | url_not_allowed | This URL is blocked from fetching. Use another source instead of retrying. |
429 | rate_limit_exceeded | Rate limit exceeded. Wait for Retry-After before retrying. |
500, 503, 504 | internal_error, service_unavailable, timeout | Something failed on Epochal's side. Retry with backoff. |
For the cause and fix of each, see Errors.
Next steps
Time Portal search gives ranked results from the time-gated web.
Every Time Portal request evaluates against a point-in-time cutoff specified in Accept-Datetime.
A sandbox is a Linux virtual machine whose clock and network are set to an instant.
Standard JSON error envelope, HTTP status codes, sandbox failure types, and retry rules.