New to Exa? Try the Coding Agent Quickstart
to get started in under a minute.
Get API Key
Get your API key from the dashboard
Install
Authentication
Set your API key as an environment variable:- macOS/Linux
- Windows
Quick Start
Exa() reads your key from the EXA_API_KEY environment variable. To set it explicitly instead, pass it inline: Exa(api_key="your-api-key").Recommended defaults
- Start with
exa.search(...). - Use
type="auto"unless you have a clear latency or synthesis reason to change it. - Prefer
contents={"highlights": True}for first integrations. - Switch to
exa.get_contents(...)only when you already know the URLs. - Use
max_age_hoursfor freshness control.
Search
Search the web and get page contents in one call.output_schema and system_prompt work across all search types. Keep output_schema focused on
the fields you want in output.content, and use system_prompt to guide the final returned
result. For more demanding synthesis, prefer reasoning-focused search types like deep-lite,
deep, or deep-reasoning. Do not add citations/confidence fields there;
grounding is returned automatically in output.grounding. Adding citation/confidence fields to
output_schema creates duplicate data, weaker structure, and less reliable attribution.deep-lite: lowest-latency deep-search modedeep: light modedeep-reasoning: base reasoning mode
Need streaming structured synthesis? The raw
/search endpoint supports stream: true together
with outputSchema and returns OpenAI-compatible SSE chunks. See the Search API
guide.Get Contents
Get text, summaries, or highlights from URLs.Answer
Get answers to questions with citations.Async
UseAsyncExa for async operations.