Use our Python or JavaScript SDKs, or call the API directly with cURL.
Install the latest version of the python SDK with pip. If you want to store your API key in a .env file, make sure to install the dotenv library.
Copy
Ask AI
pip install exa-pypip install python-dotenv
Create a file called webset.py and add the code below:
python
Copy
Ask AI
from exa_py import Exafrom dotenv import load_dotenvfrom exa_py.websets.types import CreateWebsetParameters, CreateEnrichmentParametersimport osload_dotenv()exa = Exa(os.getenv('EXA_API_KEY'))# Create a Webset with search and enrichmentswebset = exa.websets.create( params=CreateWebsetParameters( search={ "query": "Top AI research labs focusing on large language models", "count": 5 }, enrichments=[ CreateEnrichmentParameters( description="LinkedIn profile of VP of Engineering or related role", format="text", ), ], ))print(f"Webset created with ID: {webset.id}")# Wait until Webset completes processingwebset = exa.websets.wait_until_idle(webset.id)# Retrieve Webset Itemsitems = exa.websets.items.list(webset_id=webset.id)for item in items.data: print(f"Item: {item.model_dump_json(indent=2)}")