Page contents
exa/contentsFetch and clean the content of a set of pages.
- call
- Price: $0.0012
- Exa
- 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.
| Field | Type | Required | Description |
|---|---|---|---|
| urls | array | Yes | The pages to fetch, up to 100. |
| text | object | No | Return extracted page text; the object form caps its length. |
| highlights | object | No | Return the passages most relevant to a query. |
| summary | object | No | Return a written summary of each page. |
| maxAgeHours | integer | No | How 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.
