# Search — Exa

> Search the web with Exa. auto is the recommended search type, and Highlights is the recommended default content mode. See the documentation

- Key: `exa-search`
- 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/search
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/exa/actions/search/search.mjs

## Description

Search the web with Exa. `auto` is the recommended search type, and Highlights is the recommended default content mode. [See the documentation](https://docs.exa.ai/reference/search)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `query` | `string` | Yes | The search query string |
| `type` | `string` | No | The type of search to perform. auto is recommended for most workflows. |
| `category` | `string` | No | A data category to focus on |
| `numResults` | `integer` | No | Number of search results to return. Exa currently supports up to 100 results for supported search types. |
| `includeDomains` | `string[]` | No | List of domains to include in the search results |
| `excludeDomains` | `string[]` | No | List of domains to exclude from the search results |
| `startCrawlDate` | `string` | No | Results will only include links crawled after this date (ISO 8601 format). Example: 2025-01-01T00:00:00Z |
| `endCrawlDate` | `string` | No | Results will only include links crawled before this date (ISO 8601 format). Example: 2025-01-01T00:00:00Z |
| `startPublishedDate` | `string` | No | Results will only include links published after this date (ISO 8601 format). Example: 2025-01-01T00:00:00Z |
| `endPublishedDate` | `string` | No | Results will only include links published before this date (ISO 8601 format). Example: 2025-01-01T00:00:00Z |
| `includeText` | `string[]` | No | List of strings that must be present in the webpage text (max 5 words per string) |
| `excludeText` | `string[]` | No | List of strings that must not be present in the webpage text |
| `moderation` | `boolean` | No | Whether to filter unsafe content from results |
| `systemPrompt` | `string` | No | Instructions that guide Exa's synthesized output and, for deep search types, search planning. |
| `outputSchema` | `object` | No | JSON schema for structured output from Exa. Use this to shape synthesized search or answer output. |
| `additionalQueries` | `string[]` | No | Extra query variations for deep-lite, deep, or deep-reasoning search. |
| `userLocation` | `string` | No | Two-letter ISO country code used to bias results toward a region, for example US. |
| `contentsHighlights` | `boolean` | No | Return token-efficient highlights from each result. This is the recommended default for most Search workflows. |
| `contentsHighlightQuery` | `string` | No | Optional query to guide which highlights Exa should return. |
| `contentsHighlightMaxCharacters` | `integer` | No | Optional cap on highlight characters per URL. Leave unset for Exa's highest-quality default. |
| `contentsText` | `boolean` | No | Return full page text. Prefer Highlights when you want a smaller, more targeted context window. |
| `contentsTextMaxCharacters` | `integer` | No | Optional cap on returned text length. |
| `contentsTextIncludeHtmlTags` | `boolean` | No | Whether to preserve HTML tags in extracted text. |
| `contentsTextVerbosity` | `string` | No | Level of detail for extracted text. Exa recommends using Max Age Hours of 0 when you need filtered live text. |
| `contentsTextIncludeSections` | `string[]` | No | Only include these page sections. Most reliable with Max Age Hours set to 0. |
| `contentsTextExcludeSections` | `string[]` | No | Exclude these page sections. Most reliable with Max Age Hours set to 0. |
| `contentsSummary` | `boolean` | No | Return Exa-generated summaries. Prefer Highlights unless you explicitly need Exa-side synthesis. |
| `contentsSummaryQuery` | `string` | No | Optional instructions that guide Exa's generated summary |
| `contentsSummarySchema` | `object` | No | JSON schema for structured Exa summary output. See JSON Schema documentation for details. Example: { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Title", "type": "object", "properties": { "Property 1": { "type": "string", "description": "Description" }, "Property 2": { "type": "string", "enum": ["option 1", "option 2", "option 3"], "description": "Description" } }, "required": ["Property 1"] } |
| `contentsMaxAgeHours` | `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. |
| `contentsLivecrawlTimeout` | `integer` | No | Timeout in milliseconds for live crawling (default: 10000) |
| `contentsSubpages` | `integer` | No | Number of subpages to crawl per result |
| `contentsSubpageTarget` | `string` | No | Keyword or phrase Exa should prioritize when choosing which subpages to crawl |
| `contentsExtrasLinks` | `integer` | No | Number of URLs to return from each webpage. |
| `contentsExtrasImageLinks` | `integer` | No | Number of images to return for each result. |
| `context` | `boolean` | No | Hidden legacy prop preserved for saved workflows. When set, Search preserves Exa's deprecated top-level context output and also keeps the legacy highlights fallback. |

## 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-search",
  arguments: {
    query: "Query",
    type: "Search Type",
  },
})
```

**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-search",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    exa: { authProvisionId: "apn_xxxxxxx" },
    query: "Query",
    type: "Search Type",
  },
})

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-search",
    "configured_props": {
      "exa": { "authProvisionId": "apn_xxxxxxx" },
      "query": "Query",
      "type": "Search Type"
    }
  }'
```

---

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