exa.ai

Command Palette

Search for a command to run...

Company Search with Exa: Find Companies by Description and Enrich a CSV

Last updated: 11/20/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

Company Search with Exa: Find Companies by Description and Enrich a CSV

Short answer: call Exa's /search endpoint with category: "company" and describe the companies you want in plain language ("companies selling AI voice agents to dental practices"). The category steers retrieval toward company pages, and when Exa has a company record a result can also carry an entities array whose company entry includes fields such as founded year, estimated employee count, headquarters and funding. To enrich a list you already have, send each CSV row to the Exa Agent API in input.data with an outputSchema. The structured fields come back in output.structured, and per-field citations come back in output.grounding.

Use this as a research layer next to your CRM and enrichment tools, not as a replacement for them. It is for criteria a firmographic database can't express ("sells to hospitals", "has a public pricing page", "mentions SOC 2 on the site"), with a source URL for each field so a person or a pipeline can check it.

Which tool for which step

JobExa APIOutput
Find companies that match a description/search with category: "company"Ranked company pages, plus entities when available
Add researched fields to rows you already haveAgent API, input.data + outputSchemaoutput.structured, output.grounding with confidence
Pull partner data (for example Fiber.ai or Similarweb)Agent API with dataSources (Exa Connect)Provider data alongside web research

Websets also offers a dashboard CSV import. Exa's Websets docs say to use Exa Agent for new list-building and enrichment workflows, and Websets to maintain or extend existing integrations.

Example 1: find companies by description

What works with category: "company", according to the API reference:

  • company is one of the documented lowercase categories, alongside people, news, publication, personal site and financial report.
  • startPublishedDate and endPublishedDate are not supported with company. Setting either returns a 400 error.
  • includeDomains and excludeDomains work. (Only people also blocks excludeDomains.)
  • numResults goes up to 100. The base price covers 10 results.
  • type: "lite" supports every category, including company, at the Lite price. Lite rejects outputSchema, summaries and the deprecated includeText/excludeText, so use auto if you need any of those.

Python (exa-py, snake_case parameters):

from exa_py import Exa

exa = Exa()  # reads EXA_API_KEY

response = exa.search(
    "B2B software companies selling AI voice agents to dental practices in the US",
    type="auto",
    category="company",
    num_results=25,
    contents={"highlights": True},
)

for r in response.results:
    company = next((e for e in (r.entities or []) if e.type == "company"), None)
    p = company.properties if company else None
    print(r.title, r.url)
    if p:
        print(
            "  founded:", p.founded_year,
            "| employees:", p.workforce.total if p.workforce else None,
            "| HQ country:", p.headquarters.country if p.headquarters else None,
        )

TypeScript (exa-js, camelCase parameters):

import Exa, { type CompanyEntity } from "exa-js";

const exa = new Exa(); // reads EXA_API_KEY

const response = await exa.search(
  "B2B software companies selling AI voice agents to dental practices in the US",
  { type: "auto", category: "company", numResults: 25, contents: { highlights: true } }
);

for (const r of response.results) {
  const company = r.entities?.find((e): e is CompanyEntity => e.type === "company");
  const p = company?.properties;
  console.log(r.title, r.url, p?.foundedYear, p?.workforce?.total, p?.headquarters?.country);
}

Entity fields are nullable, so treat a missing value as "unknown" rather than "no". Write queries as the company you want plus its traits: customer, product, capability, stage and geography. Exa's Companies & People guide recommends that pattern.

Example 2: enrich a CSV of companies with structured fields

Input companies.csv with company and domain columns. The script sends one row per Agent run at a fixed effort, so the cost per row is known in advance. It writes the fields, the grounding (field, confidence, source URLs) and the run cost for each row.

import csv, json, time
from concurrent.futures import ThreadPoolExecutor
from exa_py import Exa

exa = Exa()

SCHEMA = {
    "type": "object",
    "required": ["company", "domain"],
    "properties": {
        "company": {"type": "string"},
        "domain": {"type": "string"},
        "what_they_sell": {"type": ["string", "null"], "maxLength": 200},
        "primary_customer": {"type": ["string", "null"], "description": "Who buys it, e.g. 'dental practices'"},
        "hq_country": {"type": ["string", "null"], "description": "ISO 3166-1 alpha-2 code"},
        "has_public_pricing_page": {"type": ["boolean", "null"]},
        "latest_funding_round": {"type": ["string", "null"], "description": "Round and date, e.g. 'Series B, 2026-03'"},
    },
}
FIELDS = [k for k in SCHEMA["properties"] if k not in ("company", "domain")]

def create_run(**params):
    # exa-py raises ValueError("Request failed with status code 429: ...") on HTTP errors,
    # so retry with backoff only when the message carries a 429.
    for attempt in range(5):
        try:
            return exa.agent.runs.create(**params)
        except ValueError as e:
            if "429" not in str(e) or attempt == 4:
                raise
            time.sleep(2 ** attempt)

def enrich(row):
    run = create_run(
        query=(
            "Research the input company using its official website and reputable sources. "
            "Fill a field only when a source supports it; otherwise return null."
        ),
        input={"data": [{"company": row["company"], "domain": row["domain"]}]},
        output_schema=SCHEMA,
        effort="low",
    )
    run = exa.agent.runs.poll_until_finished(run.id)
    out = run.output if run.status == "completed" else None
    data = (out.structured if out else None) or {}
    sources = [
        {"field": g.field, "confidence": g.confidence, "urls": [c.url for c in g.citations]}
        for g in ((out.grounding if out else None) or [])
    ]
    return {
        **row,
        **{k: data.get(k) for k in FIELDS},
        "sources": json.dumps(sources),
        "status": run.status,
        "cost_usd": run.cost_dollars.total if run.cost_dollars else None,
    }

with open("companies.csv", newline="") as f:
    rows = list(csv.DictReader(f))

with ThreadPoolExecutor(max_workers=5) as pool:  # at most 5 runs in progress at once (Exa allows 50)
    enriched = list(pool.map(enrich, rows))

with open("companies_enriched.csv", "w", newline="") as f:
    writer = csv.DictWriter(f, fieldnames=list(rows[0]) + FIELDS + ["sources", "status", "cost_usd"])
    writer.writeheader()
    writer.writerows(enriched)

Notes for production:

  • Nulls are expected. Agent output follows your schema's shape, but it isn't a guarantee of strict validation or of facts. A field can come back null when evidence doesn't support it, even if your schema marks it required. Keep unverifiable fields nullable and out of required.
  • Keep grounding. Don't add your own citation or confidence fields. Each grounding entry has field and citations. confidence is optional and may be null. When reported as a non-null value, it is low, medium or high. Store it with the row and review low-confidence fields first.
  • Pick the effort. Use minimal or low for a few shallow fields. Use medium for typical single-company research, and high or xhigh for bigger schemas or harder checks.
  • Respect the limits. Exa allows 50 Agent runs in progress at a time. Each run start counts as two requests against your QPS, so the default 10 QPS starts up to 5 runs per second. Polling doesn't count against QPS. A run past the concurrency limit returns 429 CONCURRENCY_LIMIT_REACHED. The script uses 5 workers and retries a 429 on run creation with backoff.
  • Several rows in one run. input.data accepts several rows in one run. Exa's example uses medium for two companies. Benchmark quality on representative rows first, and keep one row per run when you need a fixed price per row.
  • Large jobs (Enterprise). Exa's Batch API accepts many /agent/runs requests as one asynchronous job and returns the results as a JSONL file. It is in beta, has to be enabled for your team by Exa, and needs the Exa-Beta: batches-2026-06-06 header.
  • Partner data. Add dataSources, for example [{"provider": "fiber"}], when a field should come from an Exa Connect partner instead of the open web. Provider calls are billed on top of the run.

A cheaper first pass is also possible: one type: "lite" search per row with category: "company" and include_domains set to the row's domain. That can return the entities record when Exa has one, but it doesn't research custom fields like primary_customer.

What this costs for 1,000 rows

Prices from Exa's pricing page, checked 2026-11-05. Prices change, so check the pricing page before you budget.

ApproachMathTotal
Agent, effort: "minimal", one run per row1,000 × $0.012$12
Agent, effort: "low" (the script above)1,000 × $0.025$25
Agent, effort: "medium"1,000 × $0.10$100
Lite search per row, 10 results or fewer1,000 × $0.004$4
Discovery: 10 auto searches × 100 results10 × ($0.007 + 90 × $0.001)$0.97
  • /search base prices include up to 10 results. Each result above 10 costs $1 per 1,000 results, and AI page summaries (not used here, and not available on Lite) add $1 per 1,000 pages. Example 1 (auto, 25 results) costs $0.007 + 15 × $0.001 = $0.022 per call.
  • Fixed efforts are a flat price per request. Contact enrichment ($0.02 per email, $0.07 per phone number) and Exa Connect provider calls are billed on top.
  • effort: "auto" (the default) is metered by usage at $0.10 per Agent Compute Unit plus $0.005 per search, with a default $5 cap per run. It is billed per run, not per row, so there is no fixed price per row: run a sample of 20 to 50 representative rows, extrapolate from what that sample cost, and set budget.maxCostDollars ($1 to $100) to match. Read costDollars.total on each run for the actual charge.

Facts checked on 2026-11-05

Related Articles