> For the complete documentation index, see [llms.txt](https://agpt.co/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://agpt.co/docs/integrations/block-integrations/contents.md).

# Exa Contents

Blocks for retrieving and extracting content from web pages using Exa's contents API.

## Exa Contents

### What it is

Fetches clean text, highlights or summaries for known URLs with Exa Contents, using cached copies or fresh fetches

### How it works

This block sends the URLs (or, if no URLs are given, the deprecated document IDs) to Exa's `/contents` endpoint in one request and returns each page's text, plus highlights, a summary, subpages or extra links when you ask for them. It fails before calling Exa if neither URLs nor IDs are set. Statuses reports per URL whether the fetch succeeded and whether the page came from Exa's cache or a fresh crawl.

Max Age Hours replaces the deprecated Livecrawl option and wins when both are set. Legacy Livecrawl values are translated: 'always' is sent as max age 0, 'never' as -1, 'fallback' (the default) as Exa's default, and 'preferred' is passed through unchanged. Snapshot As Of returns stored page versions only and is rejected together with Max Age Hours or a translated Livecrawl value; the run is billed from the dollar cost Exa reports, at 150 credits per US dollar.

### Inputs

| Input                     | Description                                                                                                                                                                                                                                   | Type                                                                                         | Required |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------- |
| urls                      | Up to 100 page URLs to fetch (preferred over 'ids')                                                                                                                                                                                           | List\[str]                                                                                   | No       |
| ids                       | \[DEPRECATED - use 'urls' instead] Array of document IDs obtained from searches                                                                                                                                                               | List\[str]                                                                                   | No       |
| text                      | Return each page's text                                                                                                                                                                                                                       | bool                                                                                         | No       |
| text\_max\_characters     | Maximum characters of text per page (1 to 1,000,000). Leave empty for the full page.                                                                                                                                                          | int                                                                                          | No       |
| text\_include\_html\_tags | Keep lightweight HTML tags in the text so an LLM can see the page structure                                                                                                                                                                   | bool                                                                                         | No       |
| text\_verbosity           | How much of each page to render: 'compact' (Exa's default) keeps the main content, 'standard' adds surrounding context, 'full' returns the most complete text                                                                                 | "compact" \| "standard" \| "full"                                                            | No       |
| text\_include\_sections   | Only keep text from these page sections (best effort)                                                                                                                                                                                         | List\["header" \| "navigation" \| "banner" \| "body" \| "sidebar" \| "footer" \| "metadata"] | No       |
| text\_exclude\_sections   | Drop text from these page sections, e.g. navigation and footer (best effort)                                                                                                                                                                  | List\["header" \| "navigation" \| "banner" \| "body" \| "sidebar" \| "footer" \| "metadata"] | No       |
| highlights                | The passages of each page most relevant to a query. Sent only when a query, max characters or (deprecated) sentence count is set                                                                                                              | HighlightSettings                                                                            | No       |
| summary                   | LLM-generated summary of each page (billed per page). Sent only when a query or schema is set                                                                                                                                                 | SummarySettings                                                                              | No       |
| max\_age\_hours           | Maximum age of cached content, in hours (-1 to 720). Older pages are fetched fresh; 0 always fetches fresh, -1 only uses the cache. Leave empty (recommended) to use the cache and fetch pages that have no cached copy. Overrides Livecrawl. | int                                                                                          | No       |
| snapshot\_as\_of          | Return each page as Exa stored it at this time: an ISO 8601 date-time or a date (midnight UTC). Never fetches live pages, so it cannot be combined with Max Age Hours or Livecrawl.                                                           | str                                                                                          | No       |
| livecrawl                 | Deprecated by Exa: use Max Age Hours instead. Translated as always -> 0, never -> -1, fallback (default) -> Exa's default; 'preferred' has no equivalent and is passed through.                                                               | "never" \| "fallback" \| "always" \| "preferred"                                             | No       |
| livecrawl\_timeout        | How long a fresh page fetch may take, in milliseconds (1 to 90000)                                                                                                                                                                            | int                                                                                          | No       |
| subpages                  | Number of subpages to crawl per page (0 to 100)                                                                                                                                                                                               | int                                                                                          | No       |
| subpage\_target           | Keyword(s) to find specific subpages of search results                                                                                                                                                                                        | str \| List\[str]                                                                            | No       |
| extras                    | Extra links and images to return for each page                                                                                                                                                                                                | ExtrasSettings                                                                               | No       |
| user\_identifier          | Opaque ID of the end user this request is for (1-64 letters, digits, '\_' or '-', e.g. a UUID or hash). Never an email or name.                                                                                                               | str                                                                                          | No       |

### Outputs

| Output        | Description                                                                                        | Type                    |
| ------------- | -------------------------------------------------------------------------------------------------- | ----------------------- |
| error         | Error message if the request failed                                                                | str                     |
| results       | List of document contents with metadata                                                            | List\[ExaSearchResults] |
| result        | Single document content result                                                                     | ExaSearchResults        |
| context       | Deprecated by Exa: the pages as one string for LLMs. Prefer the text or highlights of each result. | str                     |
| request\_id   | Unique identifier for the request                                                                  | str                     |
| statuses      | Status information for each requested URL                                                          | List\[ContentStatus]    |
| cost\_dollars | Cost breakdown for the request                                                                     | CostDollars             |

### Possible use case

**Content Aggregation**: Retrieve full article content from multiple URLs for analysis or summarization.

**Competitive Research**: Fetch competitor pages fresh with Max Age Hours set to 0 to extract current product and pricing details.

**Data Enrichment**: Fetch detailed content from URLs discovered through Exa searches to build comprehensive datasets.

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://agpt.co/docs/integrations/block-integrations/contents.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
