Skip to main content
1

Set up your API key

Get your API key from the Exa Dashboard and set it as an environment variable.For the Python or JavaScript SDK, create a file called .env in the root of your project and add the following line:
.env
EXA_API_KEY=your api key without quotes
For cURL, set it as an environment variable in your terminal instead:
export EXA_API_KEY="your-api-key"
2

Install the SDK

Install the SDK for your language. If you want to store your API key in a .env file, also install the dotenv library. cURL needs no installation, skip to the next step.
pip install exa-py
pip install openai
pip install python-dotenv
3

Make your first request

Create a file (exa.py or exa.ts) with the code below, or run the cURL command directly. Pick a use case:
Get a list of results and their full text content.
from exa_py import Exa
from dotenv import load_dotenv

import os

# Use .env to store your API key or paste it directly into the code
load_dotenv()
exa = Exa(api_key=os.getenv('EXA_API_KEY'))

result = exa.search(
  "An article about the state of AGI",
  type="auto",
  contents={"highlights": True}
)

print(result)