[Integrations](https://spiral.ai/integrations) › [opencode](https://spiral.ai/integrations/opencode) › [The Companies API company search](https://spiral.ai/integrations/opencode/the-companies-api-company-search)

# How to Use The Companies API company search in opencode

Returns companies matching conditions such as industry, country, and technology use. Use it to discover businesses that meet your criteria before researching individual domains.

|  |  |
| --- | --- |
| Model | The Companies API company search |
| Available through | Alexandria |
| Category | Lead Gen |
| Price | Up to $0.34918 per run. |
| Returns | json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with The Companies API company search in opencode

- Use The Companies API company search to find retail companies in France using Shopify, then create an internal table of the returned businesses in this project.
- Use The Companies API company search to look this up and give me the result as a table. Save the result in ./assets.
- Pull the latest numbers from The Companies API company search and tell me what changed since last week.
- Check The Companies API company search and summarize what you find in three bullet points.
- Pull the newest data from The Companies API company search and give me the result as a table.

## How to set up The Companies API company search in opencode

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the server**: Leave out `--global` to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

```bash
opencode mcp add spiral --global --url https://api.spiral.ai/mcp
```

2. **Sign in**: Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, `/mcps` starts the same sign-in.

```bash
opencode mcp auth spiral
```

3. **Check it**: Spiral shows as connected.

```bash
opencode mcp list
```

### Use the Spiral skill

1. **Send opencode this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run The Companies API company search**: One request; the result comes back by polling or a webhook.

```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>"
    }
  }'
```

Then paste one of the prompts above: opencode finds The Companies API company search on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/opencode

## The Companies API company search tools and prices

- [The Companies API · Company search](https://spiral.ai/tools/alexandria/thecompaniesapi/companies/search) (Alexandria): Up to $0.34918 per run.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| page | 1 to … | — | 1-based page number. Default 1. |
| size | 1 to 100 | 10 | Companies per page, 1 to 100. Default 10. Each company returned costs 5 credits. |
| search |  | — | Extra free-text match on company name or domain. |
| sortKey |  | — | Field to sort by, such as meta.score or about.name. |
| sortOrder | asc, desc | — | asc or desc. |
| domainsToExclude |  | — | Comma-separated domains to drop, such as amazon.com,pearson.com. |

## What can you do with The Companies API company search in opencode?

Build an internal company research view that combines business profiles and domain email conventions. A coding agent can map The Companies API results into your project's account records and comparison tables.

### Prepare internal account briefs

Find businesses matching a target market, add company profiles from domains or existing business emails, and attach domain email conventions for the account team.

### Review CRM account records

Compare stored company details with returned profiles, search for ambiguous business names, and review stored domain email conventions against returned patterns.

### Plan business email verification

Select target companies, establish their business context from a domain or existing business email, and rank returned email formats by usage percentage before separate verification.

### Maintain an internal company directory

Discover companies within the directory's scope, populate business profiles from domains or business inboxes, and maintain a reference of email naming conventions by domain.

### Compare technology adoption

Find companies using a technology and compare their industry, size, and headquarters. Add known businesses to the comparison using their domains or business emails.

### Build internal territory research

Search companies by country and industry, then add profile details for known accounts to help teams assess the businesses in each territory.

## Overview

- [Alexandria](https://spiral.ai/providers/alexandria)
- [All opencode guides](https://spiral.ai/integrations/opencode)

## The Companies API company search in other agents

- [Amp](https://spiral.ai/integrations/amp/the-companies-api-company-search)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/the-companies-api-company-search)
- [Claude](https://spiral.ai/integrations/claude-desktop/the-companies-api-company-search)
- [Claude Code](https://spiral.ai/integrations/claude-code/the-companies-api-company-search)
- [Cline](https://spiral.ai/integrations/cline/the-companies-api-company-search)
- [Codex](https://spiral.ai/integrations/codex/the-companies-api-company-search)
- [Cursor](https://spiral.ai/integrations/cursor/the-companies-api-company-search)
- [Devin](https://spiral.ai/integrations/devin/the-companies-api-company-search)
- [dots](https://spiral.ai/integrations/dots/the-companies-api-company-search)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/the-companies-api-company-search)
- [Gemini](https://spiral.ai/integrations/gemini/the-companies-api-company-search)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/the-companies-api-company-search)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/the-companies-api-company-search)
- [goose](https://spiral.ai/integrations/goose/the-companies-api-company-search)
- [Grok](https://spiral.ai/integrations/grok/the-companies-api-company-search)
- [Grok Build](https://spiral.ai/integrations/grok-build/the-companies-api-company-search)
- [Hermes](https://spiral.ai/integrations/hermes/the-companies-api-company-search)
- [Instinct](https://spiral.ai/integrations/instinct/the-companies-api-company-search)
- [Manus](https://spiral.ai/integrations/manus/the-companies-api-company-search)
- [Muse](https://spiral.ai/integrations/muse/the-companies-api-company-search)
- [Muse Code](https://spiral.ai/integrations/muse-code/the-companies-api-company-search)
- [n8n](https://spiral.ai/integrations/n8n/the-companies-api-company-search)
- [Notion](https://spiral.ai/integrations/notion/the-companies-api-company-search)
- [OpenClaw](https://spiral.ai/integrations/openclaw/the-companies-api-company-search)
- [Perplexity](https://spiral.ai/integrations/perplexity/the-companies-api-company-search)
- [Raycast](https://spiral.ai/integrations/raycast/the-companies-api-company-search)
- [VS Code](https://spiral.ai/integrations/vscode/the-companies-api-company-search)
- [Windsurf](https://spiral.ai/integrations/windsurf/the-companies-api-company-search)
- [Zapier](https://spiral.ai/integrations/zapier/the-companies-api-company-search)

## More opencode guides

- [The Companies API company profile from email](https://spiral.ai/integrations/opencode/the-companies-api-company-profile-from-email)
- [TheirStack company buying signals](https://spiral.ai/integrations/opencode/theirstack-company-buying-signals)
- [The Companies API company profile from domain](https://spiral.ai/integrations/opencode/the-companies-api-company-profile-from-domain)
- [TheirStack company search](https://spiral.ai/integrations/opencode/theirstack-company-search)
- [The Companies API company email patterns](https://spiral.ai/integrations/opencode/the-companies-api-company-email-patterns)
- [TheirStack company tech stack](https://spiral.ai/integrations/opencode/theirstack-company-tech-stack)

## Questions about The Companies API company search in opencode

**Can opencode use The Companies API company search?**

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run The Companies API company search like any built-in tool.

**How much does The Companies API company search cost in opencode?**

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

**Do I need an Alexandria account to use The Companies API company search in opencode?**

No. Spiral runs The Companies API company search on its own Alexandria account. You sign in to Spiral once and never paste a key.

**How long does it take to set up The Companies API company search in opencode?**

About two minutes: add the server, then sign in, then check it.

**Does opencode wait while The Companies API company search runs?**

The Companies API company search runs in the background. opencode starts the run, checks on it and gives you the json when it's ready.

**Where does The Companies API get its company information?**

It uses company websites, social networks, search engines, and other public sources to refresh company data.

**How broad is the company database?**

The Companies API advertises more than 50 million companies across industries and regions. That database figure does not establish email-pattern availability for every domain.

**How does the database change over time?**

The Companies API says it continuously adds companies and removes businesses that no longer exist.

**Is the underlying information public?**

The Companies API states that its data is public and visible on the internet.

**Does The Companies API guarantee complete and accurate data?**

No. Section 6.2 of its Terms of Use disclaims warranties that the data remains accurate, complete, or up to date.

