Skip to main content

Just want working code?

Stop reading. Visit contents coding agent reference and copy paste to your agent.

What it is

/contents returns clean, structured content from any URL, handling JavaScript-rendered pages, PDFs, and complex layouts automatically. You pass in URLs and choose full page text, targeted highlights, or LLM-generated summaries. It can also crawl linked subpages to pull content from entire site sections in a single request. All contents features are also available in /search for returned URLs, at no extra charge up to 10 results per search ($1/1000 pages afterwards). We recommend using /search in this way instead of /contents for web search tool use cases.
Use /contents when you already know the URLs. If you are starting from a query and want Exa to find the pages first, start with Search.

Key capabilities

Content modes

Choose the content view that matches the task:

Subpage crawling

Automatically discover and extract content from linked pages within a site. Pass subpages: 10 and optionally subpageTarget: ["docs", "about"] to focus on relevant sections.

Content freshness

Control whether results come from cache or are freshly crawled with maxAgeHours:

Dynamic highlights

Dynamic Highlights is available as a research preview on /search and /contents. Include the Exa-Beta: dynamic-highlights-2026-08-28 header on every request that sets dynamic: true.
Regular highlights find relevant excerpts within each page independently. Dynamic Highlights considers the pages together and allocates one shared context budget across the result set. Useful pages can receive more context, while redundant or weak pages can receive less context. Use it when several pages will feed the same agent or RAG context. Keep regular highlights when every page needs its own excerpt or a predictable per-page limit.
On /search, enable it inside contents.highlights:
Response:
The most useful pages above received several thousand characters of the shared budget, while thinner pages received a few hundred.
The response shape does not change: each result still has a highlights array.
Do not combine dynamic: true with maxCharacters. Dynamic Highlights sizes and distributes the shared output budget automatically.

Common use cases

Get the most relevant excerpts without needing the full page.
Extract specific fields from any page using a JSON schema.
Pull content from a docs site, targeting specific sections.

Human Quickstart

Get your API key from the Exa Dashboard, then set it as an environment variable:
Install the SDK:
Then make your first request:

Next

Last modified on August 28, 2026