from exa_py import Exa
exa = Exa()
run = exa.agent.runs.create(
query="Find 10 fast-growing B2B SaaS companies and their estimated web traffic.",
data_sources=[{"provider": "similarweb"}],
output_schema={
"type": "object",
"required": ["companies"],
"properties": {
"companies": {
"type": "array",
"maxItems": 10,
"items": {
"type": "object",
"required": ["name", "domain", "monthlyVisits"],
"properties": {
"name": {"type": "string"},
"domain": {"type": "string"},
"monthlyVisits": {"type": "number", "description": "from Similarweb"},
},
},
}
},
},
)
run = exa.agent.runs.poll_until_finished(run.id)