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.
pip install exa-pyVerified import paths — ran on the pinned version, not inferred.
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.
Uninstall `metaphor-python` and install `exa-py`. Update import statements from `from metaphor_python import Metaphor` to `from exa_py import Exa`.
Structure `output_schema` to focus only on the desired content fields. Access citation information via `results.output.grounding`.
Set `contents=False` to opt-out of content retrieval, or pass a dictionary with `ContentsOptions` (e.g., `contents={'highlights': {'max_characters': 4000}}`) to customize.Design `output_schema` to adhere to these depth and property count limits when requesting structured output.
Install the package using pip: `pip install exa-py`
Ensure you provide a valid Exa API key when initializing the Exa client: `exa = Exa(api_key="your-api-key")`
Consult the official `exa-py` documentation to verify the correct method and attribute names. Use `dir(exa)` to inspect available methods and attributes on an `Exa` instance.
Review the specific error message for details on the invalid parameter. Refer to the `exa-py` documentation for the method being called to ensure all parameters are correctly formatted and have valid values.