Live · Live Fetch API
Fetch
Fetch reads one web page and returns its main content as markdown. Navigation, ads and boilerplate are stripped; the title, description, author and dates come back as separate fields.
Request
Send a POST request to https://api.epochal.com/v1/fetch with two required headers and a JSON body.
| Header | Required | Value |
|---|---|---|
x-api-key | Yes | Your API key. See Authentication. |
Content-Type | Yes | application/json |
Cache-Control | No | How old a cached copy may be. See Fresh or cached. |
curl https://api.epochal.com/v1/fetch \
-H "x-api-key: $EPOCHAL_API_KEY" \
-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 | The page to read: a full http or https URL on the public web. |
max_characters | integer, 1 to 1,000,000 | 100000 | The most characters of content to return. Longer pages set truncated: true. |
Unknown fields are rejected with a 400.
Response
A 200 returns the page's content as markdown, its metadata, and a request id.
JSON
json
{
"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-08-19T06:12:00Z",
"language": "en",
"content": "# Battery plant start pushed back to late 2027\n\nThe cell maker said…",
"truncated": true,
"entity": null
}| Field | Meaning |
|---|---|
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 version 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 | The page's own summary, from its metadata. null when it declares none. |
author | The page's authors, comma-separated. null when it names none. |
published_at | When the page says it was first published. null when it declares no trusted date. |
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 | The stock, crypto asset, city's weather, sports league, person, organization or place when the URL is an Epochal World page or a LinkedIn profile linked to one. null for ordinary web pages. See World Entities. |
Fresh or cached
By default Fetch may serve a cached copy, which is faster. Send Cache-Control: no-cache to read
the page from the site now.
To set how old a cached copy may be, send a Cache-Control header with the oldest age you accept,
in seconds. This accepts a copy up to a day old:
cURL
bash
curl https://api.epochal.com/v1/fetch \
-H "x-api-key: $EPOCHAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Cache-Control: max-age=86400" \
-d '{"url": "https://news.example.com/energy/battery-plant-delay"}'max-age=0 reads the page fresh, the same as no-cache. The SDKs send this
header from max_age: live.fetch(url, max_age=86400) in Python, FetchRequest::max_age in Rust.
Cached copies are shared
A cached copy is kept for up to 7 days and served to anyone who fetches the same exact URL, until the site is read again. A URL that grants access by itself (a signed download link, a password reset link, a link carrying a session ID) therefore lets anyone else with that URL read the page from us, even after the link has expired at the site. Send such URLs only if your organization has zero data retention: Fetch then neither stores a copy nor serves one.
A URL carrying a session ID in a parameter such as jsessionid or PHPSESSID is never cached.
A page that could not be read
When the request is fine but the page cannot be read, Fetch still answers 200, with status
set to error, an empty content, and the reason in page_error. The request is billed like any
other.
JSON
json
{
"request_id": "7c2e5f0a-93b4-4d1e-a6f8-2b0c9e4d7a15",
"status": "error",
"page_error": {
"http_status_code": 404,
"message": "Page not found."
},
"id": null,
"url": "https://news.example.com/energy/missing",
"final_url": "https://news.example.com/energy/missing",
"title": "",
"description": null,
"author": null,
"published_at": null,
"language": null,
"content": "",
"truncated": false,
"entity": null
}Branch on http_status_code, not message. It is the code the site sent, the one you would get
reading the page yourself:
page_error.http_status_code | What happened |
|---|---|
4xx | The site refused or has no such page: 404 or 410 not found, 401 or 403 denied, 429 rate limited. |
5xx | The site failed. Retrying later may help. |
2xx | The site answered, but the page is empty, not a document, or has no readable content. |
3xx | The site's redirects lead to no page. |
null | No site answered: the host does not resolve or could not be reached. |
A page whose redirects lead to a URL that is never served reads Not served., with a 403 or
400; do not retry it.
How pages are read
Fetch reads each page once, directly, when you ask for it. Sites see it as the user agent
Epochal-User/1.0 (+https://epochal-user.crawler.epochal.com). Because every read is one you
requested, not a crawl, it does not consult robots.txt; a site can still block it by that user
agent.
Errors
A non-200 status means the request itself failed: it was invalid, or the failure was on our
side. Errors use the same JSON shape as every other endpoint. Check type, not message. No error
is billed.
| Status | type | What to do |
|---|---|---|
400 | invalid_request | url is missing, is not a full http/https URL, or targets a private or local host such as localhost or 10.0.0.7; or max_characters is out of range. 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, trial_only | The free requests for this API are used up, or it is in trial for your organization. Contact us. |
402 | insufficient_credits | Add credits in the console. |
403 | organization_suspended | Billing is suspended. Contact us. |
403 | spend_limit_reached | Raise the spend limit in the console, or wait for the next billing period. |
403 | url_not_allowed | This URL is never served. 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
Search ranks the live web for a query and returns results with snippets.
Read one URL and get back its main content as markdown.
Organization and per-IP rate limits, retry behavior, and pacing guidance.
Standard JSON error envelope, HTTP status codes, sandbox failure types, and retry rules.