Create and setup your API key

  1. Go to the Exa Dashboard
  2. Click on “API Keys” in the left sidebar
  3. Click “Create API Key”
  4. Give your key a name and click “Create”
  5. Copy your API key and store it securely - you won’t be able to see it again!

Get your Exa API key


Create a .env file

Create a file called .env in the root of your project and add the following line.

EXA_API_KEY=your api key without quotes

Make an API request

Use our Python or JavaScript SDKs, or call the API directly with cURL.

Install the python SDK with pip. If you want to store your API key in a .env file, make sure to install the dotenv library.

pip install exa-py
pip install python-dotenv

Create a file called webset.py and add the code below:

python
from exa_py import Exa
from dotenv import load_dotenv
from exa_py.websets.core.types import CreateWebsetParameters, CreateEnrichmentParameters

import os

load_dotenv()
exa = Exa(os.getenv('EXA_API_KEY'))

# Create a Webset
webset = exa.websets.create(
    params=CreateWebsetParameters(
        search={
            "query": "Tech companies in San Francisco with more than 20 and less than 100 employees",
            "count": 10,
        },
        enrichments=[
            CreateEnrichmentParameters(
                description="LinkedIn profile of VP of Engineering or related role",
                format="text",
            ),
        ],
    )
)

# Wait until Webset completes processing
webset = exa.websets.waitUntilIdle(webset.id)

# Retrieve Webset Items
items = exa.websets.items.list(id=webset.id)
for item in items.data:
    print(f"Item: {item}")

What’s next?

  • Learn how Websets work and understand the event-driven process
  • Configure webhooks to receive real-time updates as items are added into your Websets
  • Learn about Enrichments to extract specific data points
  • See how to Manage Items in your Webset