# Get Contents — Exa

> Retrieve clean text, highlights, summaries, and metadata for specific URLs or Exa document IDs. Highlights are the recommended default extraction mode for most workflows. See the documentation

- Key: `exa-get-contents`
- Type: Action (Read-only)
- Version: 0.1.1
- App: Exa (`exa`) — https://pipedream.com/apps/exa.md
- This page (HTML): https://pipedream.com/apps/exa/actions/get-contents
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/exa/actions/get-contents/get-contents.mjs

## Description

Retrieve clean text, highlights, summaries, and metadata for specific URLs or Exa document IDs. Highlights are the recommended default extraction mode for most workflows. [See the documentation](https://docs.exa.ai/reference/get-contents)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `urls` | `string[]` | No | List of URLs to retrieve contents for |
| `ids` | `string[]` | No | List of Exa document IDs from previous Exa responses |
| `text` | `boolean` | No | Return full page text. Prefer Highlights when you only need targeted excerpts. |
| `textMaxCharacters` | `integer` | No | Optional cap on returned text length. |
| `textIncludeHtmlTags` | `boolean` | No | Whether to preserve HTML tags in extracted text. |
| `textVerbosity` | `string` | No | Level of detail for extracted text. Exa recommends using Max Age Hours of 0 when you need filtered live text. |
| `textIncludeSections` | `string[]` | No | Only include these page sections. Most reliable with Max Age Hours set to 0. |
| `textExcludeSections` | `string[]` | No | Exclude these page sections. Most reliable with Max Age Hours set to 0. |
| `highlights` | `boolean` | No | Return token-efficient highlights. This is the recommended default extraction mode for most Exa workflows. |
| `highlightsQuery` | `string` | No | Optional query to guide which highlights Exa should return. |
| `highlightsMaxCharacters` | `integer` | No | Optional cap on highlight characters per URL. Leave unset for Exa's highest-quality default. |
| `summary` | `boolean` | No | Return Exa-generated summaries. Prefer Highlights unless you explicitly need Exa-side synthesis. |
| `summaryQuery` | `string` | No | Optional instructions that guide Exa's generated summary. Prefer Highlights unless you explicitly need Exa-side synthesis. |
| `summarySchema` | `object` | No | Optional JSON schema for structured Exa-side summaries. Example: {"type":"object","properties":{"summary_title":{"type":"string"},"summary_text":{"type":"string"},"metadata":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"}}}}},"required":["summary_title","summary_text"]}. |
| `maxAgeHours` | `integer` | No | Maximum acceptable age for cached content in hours. Use 0 to always live crawl, -1 for cache only, or leave unset for Exa's default behavior. |
| `livecrawlTimeout` | `integer` | No | Timeout in milliseconds for live crawling (default: 10000) |
| `subpages` | `integer` | No | Number of subpages to crawl per result |
| `subpageTarget` | `string` | No | Keyword or phrase Exa should prioritize when choosing which subpages to crawl |
| `extrasLinks` | `integer` | No | Number of URLs to return from each webpage. |
| `extrasImageLinks` | `integer` | No | Number of images to return for each result. |
| `context` | `boolean` | No | Hidden legacy prop preserved for saved workflows. It is forwarded verbatim so saved workflows can keep using Exa's deprecated combined context string. |
| `highlightsNumSentences` | `integer` | No | Hidden legacy prop preserved for saved workflows. Enables modern highlights mode without forwarding deprecated fields. |
| `highlightsPerUrl` | `integer` | No | Hidden legacy prop preserved for saved workflows. Enables modern highlights mode without forwarding deprecated fields. |
| `livecrawl` | `string` | No | Hidden legacy prop preserved for saved workflows. Translates to modern freshness settings where possible. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "exa",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "exa-get-contents",
  arguments: {
    urls: ["URLs"],
    ids: ["IDs"],
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "exa-get-contents",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    exa: { authProvisionId: "apn_xxxxxxx" },
    urls: ["URLs"],
    ids: ["IDs"],
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "exa-get-contents",
    "configured_props": {
      "exa": { "authProvisionId": "apn_xxxxxxx" },
      "urls": ["URLs"],
      "ids": ["IDs"]
    }
  }'
```

---

- App: https://pipedream.com/apps/exa.md · All apps: https://pipedream.com/apps
