On Activation
- Confirm
EXA_API_KEY is available for any live API call. SDK examples assume the key is set.
- Default new integrations to
POST /search with type: "auto" and contents.highlights: true. Escalate to Agent API only for multi-step research / list-building.
- Load only the
references/*.md file needed for the current endpoint - do not dump the whole tree into context.
- For agent-native marketing research inside mktg projects, prefer
exa-search, company-research, or lead-generation over inventing a custom integration.
Build with Exa
Scope
Included by default:
- Core retrieval APIs: search endpoint, contents endpoint, answer endpoint, context endpoint
- Long-running research workflows: Agent API (
/agent)
- Async and recurring workflows: Monitors API, Websets API
- SDK guidance: Python
exa-py, TypeScript exa-js
Note on data retention: /search, /answer, and deep research are Zero Data Retention (ZDR). The Agent API (/agent), Websets, and Monitors are not ZDR. If a use case requires ZDR, stay on the ZDR surfaces or contact Exa.
Installation
# Python
pip install exa-py
# TypeScript / JavaScript
npm install exa-js
Authentication
export EXA_API_KEY="your_api_key_here"
Exa accepts either the x-api-key header or Authorization: Bearer <key>.
API Decision Workflow
Before picking an endpoint, decide which workflow shape fits:
- Raw web content for your own LLM or agent: start with
/search using type: "auto" and contents: { highlights: true }
- Synthesized structured output: start with
/search using the search type that fits your latency and reasoning needs, then add outputSchema and systemPrompt
- Long-running multi-step research, list-building, or enrichment with structured output: use the Agent API (
/agent)
Default to the search endpoint. Use the search endpoint (/search) for most new integrations, then move to a more specialized Exa surface only when the task shape clearly calls for it.
- Need general semantic web retrieval, synthesized output, filters, or content extraction from search results: use the search endpoint (
/search)
- Already know the URLs and need clean page extraction or freshness controls: use the contents endpoint (
/contents)
- Need pages related to a known seed URL: use the search endpoint (
/search) with a query derived from the page (for example title, topic, or text from /contents)
- Need a grounded answer with citations from Exa-managed search: use the answer endpoint (
/answer)
- Need code-focused retrieval from repos, docs, and Stack Overflow: use the context endpoint (
/context)
- Need OpenAI SDK drop-in compatibility for chat or responses clients: use the OpenAI-compatible endpoints (
/chat/completions, /responses)
- Need asynchronous multi-step research, list-building, enrichment, or follow-up questions over prior research: use the Agent API (
/agent)
- Need scheduled recurring search with webhook delivery: use the Monitors API (
/monitors)
- Need async verified and enriched entity collection workflows: use the Websets API (
/websets/v0)
Quick Start
For more complete examples, see the relevant reference file in the table below.
Python (/search):
from exa_py import Exa
exa = Exa(api_key="YOUR_EXA_API_KEY")
result = exa.search(
"latest developments in LLMs",
type="auto",
contents={"highlights": True}
)
for item in result.results:
print(item.title, item.url)
TypeScript (/search):
import Exa from "exa-js";
const exa = new Exa();
const result = await exa.search("latest developments in LLMs", {
type: "auto",
contents: { highlights: true }
});
for (const item of result.results) {
console.log(item.title, item.url);
}
Raw HTTP (/search):
curl -X POST "https://api.exa.ai/search" \
-H "Content-Type: application/json" \
-H "x-api-key: $EXA_API_KEY" \
-d '{
"query": "latest developments in LLMs",
"type": "auto",
"contents": {
"highlights": true
}
}'
Anti-Patterns
- On the search endpoint,
text, highlights, and summary belong inside contents, not at the top level.
- On the contents endpoint,
text, highlights, and summary are top-level fields, not nested inside contents.
- Pick one of
highlights, text, or summary by default. Do not stack them unless the use case truly needs multiple views of the same page.
numSentences and highlightsPerUrl are deprecated highlight knobs. Prefer highlights: true, or set maxCharacters only when you have a fixed budget.
- Prefer
maxAgeHours for freshness guidance. Older livecrawl examples still exist, but maxAgeHours is the normative control for new integrations.
- Stick to the documented
category set and do not invent categories like github, documentation, qa, or pdf. Specialized categories such as people and company also restrict which filters are valid; check the search reference before combining categories with domain or date filters.
- OpenAI-compatible endpoints are for compatibility-first use cases. Prefer native Exa endpoints for new integrations when you want clearer request semantics.
- Do not treat
/agent as a drop-in replacement for /search. It is higher-latency and async, so use the dedicated Agent reference when that workflow shape is the real fit. Consider using it over websets or deep where appropriate.
- Treat
/research/v1 as legacy. Do not present it as the default for new work.
- Treat
/findSimilar as deprecated. Prefer /search (optionally after /contents on the seed URL) for related-page discovery.
Reference Files
| File |
Topics |
| references/search.md |
Search endpoint request/response shape, search types, filters, nested contents, structured output |
| references/contents.md |
Contents endpoint extraction, freshness, statuses, top-level content fields |
| references/answer.md |
Grounded answer generation with citations and structured output |
| references/context.md |
Code-focused retrieval with tokensNum |
| references/agent.md |
Agent API for async multi-step research, enrichment, structured output, polling, and events |
| references/openai-compat.md |
OpenAI-compatible endpoints, model routing, extra_body usage |
| references/monitors.md |
Standalone Monitors API for scheduled recurring search |
| references/websets.md |
Websets API for async verified and enriched collection building |
| references/sdks.md |
Python and TypeScript SDK naming, methods, and shape differences |
| references/http-requests.md |
Minimal raw HTTP examples across major Exa surfaces |
| references/models-and-modes.md |
Search type selection, answer/research model routing, latency tradeoffs |
| references/prompting-and-patterns.md |
Durable query, prompting, freshness, and output-schema patterns |
| references/common-mistakes.md |
Parameter-shape corrections |
Canonical Docs
- Docs home:
https://exa.ai/docs
- Documentation index:
https://exa.ai/docs/llms.txt
- Search reference:
https://exa.ai/docs/reference/search
- Agent API guide:
https://exa.ai/docs/reference/agent-api-guide
- Exa Connect overview:
https://exa.ai/docs/reference/agent-api/connect/overview
- Python SDK spec:
https://exa.ai/docs/sdks/python-sdk-specification
- TypeScript SDK spec:
https://exa.ai/docs/sdks/typescript-sdk-specification
Attribution
Ported from exa-labs/agent-skills - adapted for mktg's drop-in contract on 2026-07-18.
Upstream commit: 390ffee2d7e1d0dce2ed8efe4994c2b3c1c0173b
Drift detection: if the upstream skill changes, re-run mktg-steal https://github.com/exa-labs/agent-skills to evaluate the diff.
1---2name: build-with-exa3description: Build applications and agents with Exa's API Platform: search, contents, answer, context, Agent API, monitors, websets, OpenAI-compatible endpoints, and exa-py / exa-js. Use when choosing Exa endpoints, writing Exa API calls, integrating semantic web search or research into products, or debugging Exa request shapes. Load references/ on demand for endpoint details.4license: MIT5---67## On Activation891. Confirm `EXA_API_KEY` is available for any live API call. SDK examples assume the key is set.102. Default new integrations to `POST /search` with `type: "auto"` and `contents.highlights: true`. Escalate to Agent API only for multi-step research / list-building.113. Load only the `references/*.md` file needed for the current endpoint - do not dump the whole tree into context.124. For agent-native marketing research inside mktg projects, prefer `exa-search`, `company-research`, or `lead-generation` over inventing a custom integration.1314# Build with Exa1516## Scope1718Included by default:1920- Core retrieval APIs: search endpoint, contents endpoint, answer endpoint, context endpoint21- Long-running research workflows: Agent API (`/agent`)22- Async and recurring workflows: Monitors API, Websets API23- SDK guidance: Python `exa-py`, TypeScript `exa-js`2425> Note on data retention: `/search`, `/answer`, and deep research are Zero Data Retention (ZDR). The Agent API (`/agent`), Websets, and Monitors are not ZDR. If a use case requires ZDR, stay on the ZDR surfaces or contact Exa.2627## Installation2829```bash30# Python31pip install exa-py3233# TypeScript / JavaScript34npm install exa-js35```3637## Authentication3839```bash40export EXA_API_KEY="your_api_key_here"41```4243Exa accepts either the `x-api-key` header or `Authorization: Bearer <key>`.4445## API Decision Workflow4647Before picking an endpoint, decide which workflow shape fits:4849- Raw web content for your own LLM or agent: start with `/search` using `type: "auto"` and `contents: { highlights: true }`50- Synthesized structured output: start with `/search` using the search type that fits your latency and reasoning needs, then add `outputSchema` and `systemPrompt`51- Long-running multi-step research, list-building, or enrichment with structured output: use the Agent API (`/agent`)5253**Default to the search endpoint.** Use the search endpoint (`/search`) for most new integrations, then move to a more specialized Exa surface only when the task shape clearly calls for it.54551. Need general semantic web retrieval, synthesized output, filters, or content extraction from search results: use the search endpoint (`/search`)562. Already know the URLs and need clean page extraction or freshness controls: use the contents endpoint (`/contents`)573. Need pages related to a known seed URL: use the search endpoint (`/search`) with a query derived from the page (for example title, topic, or text from `/contents`)584. Need a grounded answer with citations from Exa-managed search: use the answer endpoint (`/answer`)595. Need code-focused retrieval from repos, docs, and Stack Overflow: use the context endpoint (`/context`)606. Need OpenAI SDK drop-in compatibility for chat or responses clients: use the OpenAI-compatible endpoints (`/chat/completions`, `/responses`)617. Need asynchronous multi-step research, list-building, enrichment, or follow-up questions over prior research: use the Agent API (`/agent`)628. Need scheduled recurring search with webhook delivery: use the Monitors API (`/monitors`)639. Need async verified and enriched entity collection workflows: use the Websets API (`/websets/v0`)6465## Quick Start6667For more complete examples, see the relevant reference file in the table below.6869**Python** (`/search`):7071```python72from exa_py import Exa7374exa = Exa(api_key="YOUR_EXA_API_KEY")75result = exa.search(76 "latest developments in LLMs",77 type="auto",78 contents={"highlights": True}79)8081for item in result.results:82 print(item.title, item.url)83```8485**TypeScript** (`/search`):8687```typescript88import Exa from "exa-js";8990const exa = new Exa();91const result = await exa.search("latest developments in LLMs", {92 type: "auto",93 contents: { highlights: true }94});9596for (const item of result.results) {97 console.log(item.title, item.url);98}99```100101**Raw HTTP** (`/search`):102103```bash104curl -X POST "https://api.exa.ai/search" \105 -H "Content-Type: application/json" \106 -H "x-api-key: $EXA_API_KEY" \107 -d '{108 "query": "latest developments in LLMs",109 "type": "auto",110 "contents": {111 "highlights": true112 }113 }'114```115116## Anti-Patterns117- On the search endpoint, `text`, `highlights`, and `summary` belong inside `contents`, not at the top level.118- On the contents endpoint, `text`, `highlights`, and `summary` are top-level fields, not nested inside `contents`.119- Pick one of `highlights`, `text`, or `summary` by default. Do not stack them unless the use case truly needs multiple views of the same page.120- `numSentences` and `highlightsPerUrl` are deprecated highlight knobs. Prefer `highlights: true`, or set `maxCharacters` only when you have a fixed budget.121- Prefer `maxAgeHours` for freshness guidance. Older `livecrawl` examples still exist, but `maxAgeHours` is the normative control for new integrations.122- Stick to the documented `category` set and do not invent categories like `github`, `documentation`, `qa`, or `pdf`. Specialized categories such as `people` and `company` also restrict which filters are valid; check the search reference before combining categories with domain or date filters.123- OpenAI-compatible endpoints are for compatibility-first use cases. Prefer native Exa endpoints for new integrations when you want clearer request semantics.124- Do not treat `/agent` as a drop-in replacement for `/search`. It is higher-latency and async, so use the dedicated Agent reference when that workflow shape is the real fit. Consider using it over websets or deep where appropriate. 125- Treat `/research/v1` as legacy. Do not present it as the default for new work.126- Treat `/findSimilar` as deprecated. Prefer `/search` (optionally after `/contents` on the seed URL) for related-page discovery.127128## Reference Files129130| File | Topics |131|------|--------|132| [references/search.md](references/search.md) | Search endpoint request/response shape, search types, filters, nested contents, structured output |133| [references/contents.md](references/contents.md) | Contents endpoint extraction, freshness, statuses, top-level content fields |134| [references/answer.md](references/answer.md) | Grounded answer generation with citations and structured output |135| [references/context.md](references/context.md) | Code-focused retrieval with `tokensNum` |136| [references/agent.md](references/agent.md) | Agent API for async multi-step research, enrichment, structured output, polling, and events |137| [references/openai-compat.md](references/openai-compat.md) | OpenAI-compatible endpoints, model routing, `extra_body` usage |138| [references/monitors.md](references/monitors.md) | Standalone Monitors API for scheduled recurring search |139| [references/websets.md](references/websets.md) | Websets API for async verified and enriched collection building |140| [references/sdks.md](references/sdks.md) | Python and TypeScript SDK naming, methods, and shape differences |141| [references/http-requests.md](references/http-requests.md) | Minimal raw HTTP examples across major Exa surfaces |142| [references/models-and-modes.md](references/models-and-modes.md) | Search type selection, answer/research model routing, latency tradeoffs |143| [references/prompting-and-patterns.md](references/prompting-and-patterns.md) | Durable query, prompting, freshness, and output-schema patterns |144| [references/common-mistakes.md](references/common-mistakes.md) | Parameter-shape corrections |145146## Canonical Docs147148- Docs home: `https://exa.ai/docs`149- Documentation index: `https://exa.ai/docs/llms.txt`150- Search reference: `https://exa.ai/docs/reference/search`151- Agent API guide: `https://exa.ai/docs/reference/agent-api-guide`152- Exa Connect overview: `https://exa.ai/docs/reference/agent-api/connect/overview`153- Python SDK spec: `https://exa.ai/docs/sdks/python-sdk-specification`154- TypeScript SDK spec: `https://exa.ai/docs/sdks/typescript-sdk-specification`155156## Attribution157158Ported from [exa-labs/agent-skills](https://github.com/exa-labs/agent-skills) - adapted for mktg's drop-in contract on 2026-07-18.159160Upstream commit: 390ffee2d7e1d0dce2ed8efe4994c2b3c1c0173b161162Drift detection: if the upstream skill changes, re-run `mktg-steal https://github.com/exa-labs/agent-skills` to evaluate the diff.