Get Started
Overview
The Epochal API gives your agent the web as it is now, or as it was at any point in the past. The Time Portal APIs search, fetch and run code at a past instant. The Live APIs search and fetch the current web.
Get an API key and make your first request below, or follow the full Time Portal Quickstart or Live Quickstart.
Get started
Create an API key in the console, then prompt your AI coding agent to integrate the Live and Time Portal APIs.
The APIs
Search and explore the web as of any time.
/v1/time-portal/searchRetrieve an archived web page as it existed at an earlier instant.
/v1/time-portal/fetchRun code in a sandbox that lives in an earlier point in time.
/v1/time-portal/sandboxRank the live web for a query and get back results with snippets.
/v1/searchRead one web page and get back its main content as markdown, with its metadata.
/v1/fetchSee it in action
Step through a Time Portal agent run set to October 6, 2024, or try live queries in the Playground and interactive visualizer.
Boot a Linux microVM whose clock, OS image, packages, and network are gated to Oct 6, 2024.
- Created sandbox sbx_y45rfmhnkqk89hj7prmg1s
- Clock and network gated to 2024-10-06T23:59:59Z
- Image: ubuntu-24.04 (2024-10-01 build)
- date -u
- Sun Oct 6 23:59:59 UTC 2024
Quickstart
- Set your API key
Create a key in the API console and export it as
EPOCHAL_API_KEY:Shell
bash
export EPOCHAL_API_KEY="ek_…" - Search the web as of a past timestamp
Send a
POSTrequest to POST/v1/time-portal/search with your cutoff inAccept-Datetime:curl https://api.epochal.com/v1/time-portal/search \ -H "x-api-key: $EPOCHAL_API_KEY" \ -H "Accept-Datetime: 2026-03-01T00:00:00Z" \ -H "Content-Type: application/json" \ -d '{"query": "european battery gigafactory delays", "num_results": 2}'JSON
json
{ "as_of": "2026-03-01T00:00:00Z", "request_id": "7c2e5f0a-93b4-4d1e-a6f8-2b0c9e4d7a15", "results": [ { "title": "Battery plant start pushed back to late 2027", "url": "https://news.example.com/energy/battery-plant-delay", "snippet": "The cell maker said commissioning would slip by three quarters…", "published_at": "2026-02-11T06:12:00Z", "domain": "example.com", "language": "en", "entity": null } ], "entities": [] } - Fetch an archived page at the same instant
Pass a result's
urlto POST/v1/time-portal/fetch using the sameAccept-Datetime. Make sure to replace the example with aurlfrom your own Search response.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}'A page with no archived copy will return
200withstatusset toerrorand the reason inpage_error. Checkstatusbefore readingcontent. - Run an agent in a time-gated sandbox
Use the CLI to run Claude Code, Codex, or Grok Build inside a sandbox gated to any past date, or call POST/v1/time-portal/sandbox directly:
Shell
bash
epochal time-portal run --harness claude --model claude-sonnet-5-5 --as-of 2024-10-06 \ "Will AI research win a Nobel Prize this year?" - Search the live web
Leave out
Accept-Datetimeand call POST/v1/search to search the web as it is now. POST/v1/fetch reads any result in full. See the Live Quickstart.cURL
bash
curl https://api.epochal.com/v1/search \ -H "x-api-key: $EPOCHAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "european battery gigafactory delays", "num_results": 2}'
For agents
This documentation site also serves machine-readable files built directly from the guides and OpenAPI spec:
<path>.md— plain markdown twin of any docs or reference page/llms.txt— index of all pages with summaries/llms-full.txt— full documentation corpus in one file/SKILL.md— an Agent Skill file summarizing authentication, endpoints, and docs links
See For Agents for skill installation and MCP server setup.
Next steps
Get started with the search, fetch, and sandbox Time Portal APIs.
Get started with the Live Search and Fetch APIs.
Every Time Portal request evaluates against a point-in-time cutoff specified in Accept-Datetime.
Time Portal search gives ranked results from the time-gated web.
Time Portal fetch gives an archived copy of a page from the time-gated web.
A sandbox is a Linux virtual machine whose clock and network are set to an instant.
Search ranks the live web for a query and returns results with snippets.
Fetch reads one web page and returns its main content as markdown, with its metadata.