---
source_url: "https://exa.ai/docs/sdks/python-sdk"
title: Python SDK - Exa
mirrored_at: 2026-09-03T01:03:09.508Z
host: exa.ai
cited_in_42a: true
mirror_canonical: "https://index.42a.ai/exa.ai/docs/sdks/python-sdk"
---

> **Original source:** https://exa.ai/docs/sdks/python-sdk

The official Python SDK for Exa. Search the web, get page contents, and get answers with citations.

## Install

Requires Python 3.9+

## Authentication

Set your API key as an environment variable:

-   macOS/Linux
    
-   Windows
    

## Quick Start

## 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_hours` for freshness control.

## Search

Search the web and get page contents in one call.

Reasoning-focused search variants:

-   `deep-lite`: lowest-latency deep-search mode
-   `deep`: light mode
-   `deep-reasoning`: base reasoning mode

## 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

-   [**GitHub**](https://github.com/exa-labs/exa-py) - View source code
-   [**PyPI**](https://pypi.org/project/exa-py/) - View package