Registry / http-networking / exa-py

exa-py

JSON →
library2.11.0pypypi✓ verified 35d ago

The official Python SDK for Exa, the web search API for AI. It enables developers to semantically search the web, retrieve page contents, find similar pages, and generate answers with citations. The library is currently at version 2.11.0 and is actively maintained with regular updates.

http-networkingllm-agents
Install & Compatibility
Where this runs
tested against v2.13.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.925 runs
installs and imports cleanly · install 0.0s · import 3.256s · 53.1MB
glibc
py 3.103.925 runs
installs and imports cleanly · install 5.6s · import 2.866s · 52MB
52MB installed
● package 52MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from exa_py import Exa

Use for asynchronous operations.

from exa_py import AsyncExa

Instantiate the Exa client with your API key, then perform a web search and get an answer to a question. Ensure the 'EXA_API_KEY' environment variable is set.

import os from exa_py import Exa exa = Exa(api_key=os.environ.get('EXA_API_KEY', '')) if exa.api_key: # Search the web results = exa.search( "blog post about artificial intelligence", type="auto", contents={"highlights": True} ) print("Search results:", results.results) # Ask a question response = exa.answer("What is the capital of France?") print("Answer:", response.answer) else: print("EXA_API_KEY environment variable not set. Please set it to run the quickstart example.")
Debug
Known footguns
breakingThe library was formerly known as `metaphor-python`. While the API is largely compatible, existing `metaphor-python` installations should be migrated to `exa-py`.
gotchaWhen using the `search` method with `output_schema`, avoid including citation or confidence fields directly in the schema. Grounding is returned automatically in the `output.grounding` field.
gotchaBy default, content retrieval (e.g., via `search` or `get_contents`) returns text with a maximum of 10,000 characters. To disable content retrieval or specify different options (like highlights or summary), use the `contents` parameter.
gotchaFor searches of `type: "object"` with `output_schema`, there are current limitations on the complexity of the output schema: a maximum nesting depth of 2 and a maximum of 10 total properties are enforced.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
14 hits · last 30 days
gptbot
4
ahrefsbot
3
googlebot
2
oai-searchbot
2
amazonbot
1
chatgpt-user
1
Resources