Search Endpoint Reference
Primary semantic retrieval surface for new Exa integrations viaPOST /search.
Canonical Docs Links
- Base docs URL:
https://exa.ai/docs - Search reference:
/reference/search - Search coding-agent reference:
/reference/search-api-guide-for-coding-agents - Search best practices:
/reference/search-best-practices - Content freshness:
/reference/livecrawling-contents
Contents
- Overview
- Recommended request
- Other request parameters
- Search types
- Nested contents options
- Structured output
- Category
- Streaming and response shape
- Critical pitfalls
Overview
Use the search endpoint when you need:- general semantic web retrieval
- synthesized output controlled by
systemPromptandoutputSchema - content extraction attached to search results through the nested
contentsobject
/agent), not this endpoint.
Recommended Request
A bare query returns only result metadata (title, URL, author, published date) with no page content. Most integrations need content, so the recommended request adds token-efficient highlights — and nothing else:
Encode intent in the query itself: subject, constraints, time window, and source preferences all belong in natural language before they belong in request parameters.
Other Request Parameters
Every parameter below changes behavior away from the server defaults. Add one only when the task requires it.Search Types
Use Exa’s primary search types as latency/quality presets:auto is the server default. Stay on it unless the use case clearly prioritizes real-time speed, deeper reasoning, or configuration control.
outputSchema works across search types, so do not pick a deep variant only because you want structured output.
Nested Contents Options
On the search endpoint, all content-extraction controls live insidecontents. The preferred default is bare highlights:
contents Parameters
contents.highlights: true is the recommended extraction mode; the server returns no content at all unless contents is sent. Every other option below needs an explicit task requirement.
Text vs Highlights vs Summary
Pick exactly one:highlightsis the recommended mode for agent workflows and multi-step chainstextonly when downstream logic truly needs broad page contextsummaryonly when the user explicitly requests Exa-side per-result synthesis
text, highlights, and summary in one request. summary adds a per-result LLM call, so N results means N extra synthesis steps. Bare highlights: true auto-selects an appropriate excerpt length per page, so there is nothing to tune in the recommended case.
Structured Output
systemPrompt and outputSchema do different jobs:
systemPromptcontrols behavior, emphasis, and source preferencesoutputSchemacontrols the shape ofoutput.content
Category
Do not setcategory unless the user explicitly requests category-constrained retrieval. Mapping task nouns to categories — news tasks to news, people tasks to people, paper tasks to publication — is a mistake: the default index already handles those queries, and the query text itself is the right place to express the topic.
When a user does explicitly request it, documented values include company, people, publication, news, personal site, and financial report. Never invent categories such as github, documentation, qa, or pdf. For coding queries, prefer the /context endpoint or plain /search.
People and Company Routing
List-building and enrichment workflows do not belong here. Finding stakeholders, sourcing candidates, mapping companies, or enriching entity rows are Agent API workflows: use/agent (see agent.md). category: "people" and category: "company" are only for retrieving raw people or company documents as search results.
When those categories are legitimately in use, they restrict which filters are valid:
peopledoes not support date or crawl-date filters, and does not supportexcludeDomains- for
people,includeDomainsonly accepts LinkedIn domains companydoes not support date or crawl-date filterscompanysupportsexcludeDomains- unsupported category/filter combinations return a 400 error
people search in particular, push the filtering logic into the natural-language query.
Streaming and Response Shape
Streaming is currently used only for synthesized output. Whenstream: true is paired with outputSchema, the search endpoint returns text/event-stream instead of a single JSON payload. Without outputSchema, it returns the normal JSON search response even when stream is true. Robust streaming consumers should branch on the chunk type. Current public chunk types are text-delta, grounding, results, stream-reset, done, and error.
Non-streaming responses typically include:
requestIdresults- optional
output costDollarssearchTime
output.grounding when using structured or synthesized output.
Critical Pitfalls
- Do not decorate the recommended request without reason. Send
query,type: "auto", andcontents.highlights: true; add anything else only when the task explicitly requires it. - Do not send a boilerplate
numResults; the server default is 10, and a different count is a product decision. - Do not set
categoryor domain filters without an explicit user request. Source preferences belong in query phrasing orsystemPrompt. - Do not place
text,highlights, orsummaryat the top level on/search. - Do not stack
text,highlights, andsummaryon the same call. Pick one.summaryfires a per-result LLM call and requires an explicit user request. - Do not use
category: "people"orcategory: "company"for list-building or enrichment; those workflows use/agent(see agent.md). - Do not use
tokensNumon/search; text sizing belongs undercontents.text.maxCharacterswhen the task requires a cap. - Treat
useAutoprompt,numSentences, andhighlightsPerUrlas deprecated; do not add them to new examples. - Use
contents.maxAgeHoursinstead oflivecrawl. - Never invent
categoryvalues such asgithub,documentation,qa, orpdf.