Discover / Marketing

Exa Python SDK

by exa-labsPython

Python SDK for the Exa neural search engine built for AI applications

Toolstable

Maturity: stable because 3y old, v2.16.2 released 7d ago. Derived from release and commit history, not a rating.

Stars
224
Forks
53
Downloads / mo
9.3M
Last commit
2026-07-27
License
MIT
Open issues
40

Market and trust evidence

Edition not yet matched

No exact skills.sh identity match is available for this repository. Repository adoption and freshness remain visible above; install momentum is not inferred.

Trust analysis is a screening signal, not a security warranty. Read the ranking and trust methodology.

In practice

Written by AI from this repository’s README · high confidence

Giving an LLM current web knowledge with structured results instead of scraping search engines yourself.

Use it when

Use it when Python code needs neural web search, page contents or a cited answer with structured output.

Not the right pick when

Wrong pick offline or without an Exa API key, and structured search output is capped at depth 2 and 10 properties.

Capabilities

  • search with highlights, date filters and domain includes
  • output_schema for plain text or structured JSON results
  • stream_search yielding OpenAI style completion chunks
  • get_contents for specific URLs
  • answer and stream_answer for direct questions
  • Agent API runs with poll_until_finished, plus AsyncExa

Requirements

  • Python 3.9+
  • An Exa API key

Cost: Needs a paid API or account

Install

Derived from the published package name in the repository, not from a model.

Video walkthroughs

Third-party YouTube uploads matched to this tool by title, channel and repository name on 2026-08-03. Not made, reviewed or endorsed by SkillPilot. View counts and publish months are as of the match date and the month is approximate. Nothing loads from YouTube until you press play.

What the repository ships

Ships CLAUDE.mdHas testsHas docsHas examplesCI configured

Detected from the actual files in the repository root.

Latest release v2.16.2

Published 2026-07-27

2.16.2 (2026-07-27)

Bug Fixes

  • update Category values and accept str at runtime (#237) (6677724)

Tags

README

Exa Python SDK

PyPI version

The official Python SDK for Exa, the web search API for AI.

Documentation | Dashboard

Install


pip install exa-py

Requires Python 3.9+

Quick Start


from exa_py import Exa

exa = Exa(api_key="your-api-key")

# Search the web
results = exa.search(
    "blog post about artificial intelligence",
    type="auto",
    contents={"highlights": True}
)

# Ask a question
response = exa.answer("What is the capital of France?")

Search


results = exa.search(
    "machine learning startups",
    contents={"highlights": True}
)

results = exa.search(
    "climate tech news",
    num_results=20,
    start_published_date="2024-01-01",
    include_domains=["techcrunch.com", "wired.com"],
    contents={"highlights": True}
)

results = exa.search(
    "What are the latest battery breakthroughs?",
    type="auto",
    system_prompt="Prefer official sources and avoid duplicate results",
    output_schema={
        "type": "object",
        "properties": {
            "summary": {"type": "string"},
            "key_companies": {"type": "array", "items": {"type": "string"}},
        },
        "required": ["summary", "key_companies"],
    },
)
print(results.output.content if results.output else None)

for chunk in exa.stream_search(
    "What are the latest battery breakthroughs?",
    type="auto",
):
    if chunk.content:
        print(chunk.content, end="", flush=True)

Search output_schema modes:

  • {"type": "text", "description": "..."}: return plain text in output.content
  • {"type": "object", ...}: return structured JSON in output.content

system_prompt and output_schema are supported on every search type.

Search streaming is available via stream_search(...), which yields OpenAI-style chat completion chunks.

For type: "object", search currently enforces:

  • max nesting depth: 2
  • max total properties: 10

Deep search variants that also support additional_queries:

  • deep-lite
  • deep
  • deep-reasoning

Contents


results = exa.get_contents(
    ["https://docs.exa.ai"],
    text=True
)

results = exa.get_contents(
    ["https://arxiv.org/abs/2303.08774"],
    highlights=True
)

Answer


response = exa.answer("What caused the 2008 financial crisis?")
print(response.answer)

for chunk in exa.stream_answer("Explain quantum computing"):
    print(chunk, end="", flush=True)

Agent API

The Agent API is available without a beta header.


run = exa.agent.runs.create(
    query="Find engineering leaders at AI infrastructure companies that raised a Series A or B in the last 6 months.",
    output_schema={
        "type": "object",
        "properties": {
            "people": {
                "type": "array",
                "maxItems": 10,
                "items": {
                    "type": "object",
                    "properties": {
                        "name": {"type": "string"},
                        "contact_email": {"type": "string", "format": "email"},
                        "linkedin_url": {"type": "string", "format": "uri"},
                    },
                    "required": ["name", "linkedin_url"],
                },
            }
        },
        "required": ["people"],
    },
    effort="auto",
)

run = exa.agent.runs.poll_until_finished(run.id)
print(run.output.structured if run.output else None)

Async


from exa_py import AsyncExa

exa = AsyncExa(api_key="your-api-key")

results = await exa.search("async search example", contents={"highlights": True})

More

See the full documentation for all features including websets, filters, and advanced options.

Related tools