Make your first request
Start with aquery in natural language. Optional fields control how Exa searches and what each result includes; the rest of this page covers the ones you will actually use.
numResults to request up to 100 results; fewer may be returned when fewer relevant pages are available. Search does not support pagination.
Example response
Example response
Highlights and the list below are shortened.
contents.
Writing queries
Thequery field is the only required field when using the Search API.
Write queries in natural language. Include the subject and, when useful, the kind of source and time period you want.
Queries can be broad and exploratory. "Latest news on EU battery policy" gives Exa enough intent to discover relevant pages; "news" does not. When the source type matters, name it in the query:
Choose a search type
type selects a search mode, each tuned for a different balance of speed, search depth, and synthesis. auto is the default and works for most searches.
Deep modes run a research process rather than a single retrieval pass. See Deep Search for how that process works and how to use its additional controls.
Output shapes
Every result includes metadata such as its title, URL, and publication date. Usecontents to add highlights, full text, or a summary from the page.
- Highlights
- Full text
Highlights return the excerpts most relevant to your query. They give models and agents the
evidence they need without filling the context window with unrelated parts of each page.This is the recommended output shape for most tasks.Start with bare See Highlights for Dynamic Highlights and guidance on when to enable it.
highlights: true. Exa uses the query to select an appropriate amount of
content from each result.summary is a third option, but it adds a language model call for every result.
Output schema
AddoutputSchema when you want Exa to synthesize the search results. It works with every search type and adds an output object to the response.
The ranked pages remain in results. The generated value is returned in output.content, with field-level sources and confidence in output.grounding.
- Freeform Text
- Structured JSON
Use
type: "text" for generated prose. Add a description to specify its format or length.systemPrompt for instructions such as source preferences or emphasis; use outputSchema for the response shape. Python uses system_prompt and output_schema.
Keep object schemas small: they support up to 2 levels of nesting and 10 properties. Do not add
citation or confidence fields to the schema; Exa returns them automatically in
output.grounding.Filter results
Filters are hard constraints: add one when a result outside it would be unusable to you, and keep softer source preferences in the query text instead. The API reference has the full set.Include domains or paths
includeDomains restricts results to sources you trust. It accepts full domains, path prefixes such as anthropic.com/news, and subdomain wildcards such as *.substack.com.
site: operator in the query.
Exclude domains or paths
excludeDomains removes results from specific domains or paths. It supports the same path prefixes and subdomain wildcards as includeDomains. Use it when those sources would make a result unusable, not to express a preference.
Content freshness
contents.maxAgeHours controls how fresh the content extracted from each result must be. It does not filter results by publication date.
Most searches should omit this field. Set it when stale page content would be unusable, such as for prices, availability, or a page that changes frequently.
Next steps
Best practices
Token budgets, content freshness, structured output, and system prompts.
API reference
Every request parameter and response field, with a live playground.
Contents
You already have the URLs and want clean text, highlights, or summaries.
Exa Agent
You need long-running research, list building, or enrichment.