# Exa Contents API

> Extract clean page contents for a list of URLs: full text, highlights, AI summaries and metadata, from cache or with a live crawl.

Source: https://www.sandbase.ai/apis/exa/contents
API reference: https://www.sandbase.ai/apis/exa/contents/docs

## Facts

- Provider: Exa
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/exa/contents`
- Price: $0.0045 per call
- Capabilities: web scraping, content extraction
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

`POST https://api.sandbase.ai/v1/api/exa/contents` with `Authorization: Bearer $SANDBASE_API_KEY` and the parameters as a JSON body.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `ids` | array | yes |  |
| `text` | boolean | no |  |
| `highlights` | boolean | no |  |
| `summary` | boolean | no |  |
| `subpages` | integer | no |  |
| `livecrawl` | string | no | always, fallback, never |

## FAQ

### How do I use the Exa Contents API?

Send a POST request to https://api.sandbase.ai/v1/api/exa/contents with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.

### How much does the Exa Contents API cost?

$0.0045 per call, billed from your SandBase balance. You are only charged for calls you make; there is no subscription.

### What parameters does the Exa Contents API accept?

Required: ids (array). Optional: text (boolean), highlights (boolean), summary (boolean), subpages (integer) and livecrawl (one of always, fallback, never). The Parameters table and the Playground on this page list every field.

### What does the Exa Contents API return?

A JSON response returned in the same HTTP request (synchronous). The README on this page includes a sample response.

### Do I need a Exa developer account or API key?

No. Exa Contents runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for Exa API access separately.

## README

### Exa Contents API

Pass one or more URLs and get their contents ready for an LLM: page text, highlights or summaries, with live crawling when the cache is stale.

#### Use cases

- Fetch full text for RAG after a search.
- Summarize a list of web pages.
- Monitor page changes with live crawls.

#### Request

```bash
curl -X POST "https://api.sandbase.ai/v1/api/exa/contents" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ids": ["https://developers.openai.com/codex"], "highlights": true}'
```

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ids` | array | Yes | The URLs (or Exa result ids) to fetch contents for. |
| `text` | boolean | No | Return the full page text. |
| `summary` | boolean | No | Return an AI-generated summary of the page. |
| `subpages` | integer | No | Number of linked subpages to also fetch. |
| `livecrawl` | string | No | Freshness policy: always live-crawl, fall back to live crawl on cache miss, or never live-crawl. |
| `highlights` | boolean | No | Return highlighted relevant snippets. |

#### Example response

Real response for the request above, trimmed to the main fields. User names and long IDs are masked.

```json
{
  "results": [
    {
      "id": "https://developers.openai.com/codex",
      "url": "https://developers.openai.com/codex",
      "title": "ChatGPT | ChatGPT Learn",
      "highlights": [
        "ChatGPT | ChatGPT Learn ... responses createreasoning_effortrealtimeprompt cach…"
      ]
    }
  ]
}
```

#### Notes

- `livecrawl`: always, fallback (on cache miss) or never.
