Skip to main content
New to Exa? Try the Coding Agent Quickstart to get started in under a minute.
The official Python SDK for Exa. Search the web, get page contents, and get answers with citations.

Get API Key

Get your API key from the dashboard

Install

Requires Python 3.9+

Authentication

Set your API key as an environment variable:

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").
  • 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_hours for freshness control.
On /search, text, highlights, and summary belong inside contents. On /contents, those same fields are top-level arguments.
Search the web and get page contents in one call.
highlights is a strong default for retrieval workflows because it preserves the most relevant evidence without pulling full page text into every response.
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.
Reasoning-focused search variants:
  • deep-lite: lowest-latency deep-search mode
  • deep: light mode
  • deep-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

Use AsyncExa for async operations.

Deep reasoning

Resources

Last modified on July 20, 2026