Page contents

by Exa

exa/contents

Fetch and clean the content of a set of pages.

Billed per
call
Price
Price: $0.0012
Provider
Exa
Timeout
5 min

Overview

Given up to a hundred URLs, or document ids from an earlier search, returns readable extracted text rather than raw markup, served from cache or crawled fresh depending on the age tolerance given. Beyond text it can return query-relevant highlights with relevance scores, a written summary, and extras such as outbound links, images, and code blocks. A per-URL status array reports which pages were served from cache, which were crawled, and which failed, so a partial failure stays visible.

One entry per URL with its text, highlights, and summary, plus a status list saying how each page was obtained.

Input

These go in the input object of the run request.

FieldTypeRequiredDescription
urlsarrayYesThe pages to fetch, up to 100.
textobjectNoReturn extracted page text; the object form caps its length.
highlightsobjectNoReturn the passages most relevant to a query.
summaryobjectNoReturn a written summary of each page.
maxAgeHoursintegerNoHow stale a cached copy may be; 0 forces a fresh crawl.

Requests up to 1 MB.

Example

Use your own API key and a saved idempotency key for each new job. Replace image or media placeholders with your own publicly reachable HTTPS URLs. Keep the same key and request body when recovering a timeout.

# Set once per job; reuse this key and the identical body after a timeout.
: "${AGENTSKY_IDEMPOTENCY_KEY:?Set a unique, saved key for this job}"
curl --fail-with-body https://gateway.agentsky.dev/v1/run \
  -H "authorization: Bearer $AGENTSKY_API_KEY" \
  -H "content-type: application/json" \
  -H "Idempotency-Key: $AGENTSKY_IDEMPOTENCY_KEY" \
  -d '{"provider":"exa","endpoint":"contents","input":{"urls":["https://example.com"],"text":{"maxCharacters":2000},"maxAgeHours":24}}'
# If status is READY/RUNNING, poll GET /v1/runs/{runId} with the same API key.

Pricing

$0.0012 per call using your plan when signed in. Read the final customer charge from price.amount.value after the run finishes. A RUNNING response is not the final bill.

Questions