# The Companies API · Company search

Find companies, people and contact details with The Companies API · Company search from Alexandria through one Spiral API key. Find companies by industry, size, location, technology, or any other attribute condition. An empty page costs nothing. Use companies/enrich for one known domain. It runs in the background and returns structured JSON. Pay as you go, with no subscription.

- Provider: Alexandria
- Category: Lead Gen
- Runs: In the background
- Returns: json
- Tool id: `alexandria` / `thecompaniesapi/companies/search`
- Page: https://spiral.ai/tools/alexandria/thecompaniesapi/companies/search

## Pricing

Up to $0.34918 per run.

## Limits

- Longest queue wait: 1 hour
- Run deadline: 5 minutes
- Longest run, end to end: 225 minutes
- Largest inline input: 1 MB
- Largest input file: 2 GB
- Largest output: 5 GB

## Input

| Field | Kind | Allowed | Default | Description |
| --- | --- | --- | --- | --- |
| `query` (required) | text |  | — | Stringified JSON array of conditions, each {attribute, operator, sign, values}, such as [{"attribute":"about.industries","operator":"or","sign":"equals","values":["fintech"]}]. |
| `page` | number | 1 to … | — | 1-based page number. Default 1. |
| `size` | number | 1 to 100 | 10 | Companies per page, 1 to 100. Default 10. Each company returned costs 5 credits. |
| `search` | text |  | — | Extra free-text match on company name or domain. |
| `sortKey` | text |  | — | Field to sort by, such as meta.score or about.name. |
| `sortOrder` | one of | asc, desc | — | asc or desc. |
| `domainsToExclude` | text |  | — | Comma-separated domains to drop, such as amazon.com,pearson.com. |
| `linkedinToExclude` | text |  | — | Comma-separated LinkedIn company URLs to drop. |

## Example

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "alexandria",
    "model": "thecompaniesapi/companies/search",
    "input": {
      "query": "<query>"
    }
  }'
```

Try it in the Playground: https://spiral.ai/start?provider=alexandria&model=thecompaniesapi%2Fcompanies%2Fsearch

## Common questions

### The Companies API · Company search

**How much does The Companies API · Company search cost?**

Up to $0.34918 per run. You pay as you go from one Spiral balance, with no subscription, and a failed run is not charged.

**How do I use The Companies API · Company search through an API?**

Send `POST /v1/runs` with `"provider": "alexandria"`, `"model": "thecompaniesapi/companies/search"` and the input fields on this page, using one Spiral API key. It runs in the background: poll the run, or name a webhook to be told when it finishes.

**Do I need an account with Alexandria to use The Companies API · Company search?**

No. Spiral runs it on its own Alexandria account and charges your Spiral balance.

**Can my AI agent use The Companies API · Company search?**

Yes. Agents find and run it through Spiral's MCP server, CLI or agent skill, with the same API key.

