> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crustdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Company Search

> Learn how to search for companies using structured filters, from simple domain lookups to multi-filter queries.

**Use this when** you want to explore a market, build a target account list, or segment companies by criteria like geography, industry, funding, or headcount.

The Company Search API lets you find companies by domain, country, industry, funding, headcount, and more. This page walks you through the basics: your first search, the response shape, and combining filters. For deeper topics, follow the links to the sub-pages.

Every request goes to the same endpoint:

```
POST https://api.crustdata.com/company/search
```

<Note>
  Replace `YOUR_API_KEY` in each example with your actual API key. All
  requests require the `x-api-version: 2025-11-01` header.
</Note>

### Request body

| Parameter | Type      | Required | Default    | Description                                                                          |
| --------- | --------- | -------- | ---------- | ------------------------------------------------------------------------------------ |
| `filters` | object    | No       | —          | A single filter condition or a nested `and`/`or` group. Omit to match all companies. |
| `fields`  | string\[] | No       | all fields | Dot-path fields to include in each company object. Always specify in production.     |
| `sorts`   | object\[] | No       | —          | Sort rules. Each has `field` (dot-path) and `order` (`asc` or `desc`).               |
| `limit`   | integer   | No       | `20`       | Companies per page. Max: `1000`.                                                     |
| `cursor`  | string    | No       | —          | Pagination cursor from a previous response.                                          |

<Tip>
  **Looking for the list of fields you can filter on?** See [Searchable
  fields](/company-docs/search/reference#searchable-fields) in the search
  reference for the full table of `filters.field` values (with sortable
  flags). Use [Autocomplete](/company-docs/autocomplete/introduction) to
  discover valid *values* for fields like `basic_info.industries`,
  `taxonomy.professional_network_industry`, or `locations.country`.
</Tip>

### Response body

| Field         | Type            | Description                                                 |
| ------------- | --------------- | ----------------------------------------------------------- |
| `companies`   | array           | Matching company records with requested `fields`.           |
| `next_cursor` | string or null  | Cursor for the next page. `null` when no more pages.        |
| `total_count` | integer or null | Total matching companies (may be `null` for broad queries). |

### Rate limits and credits

<Callout icon="coins" color="#5345e4">
  <strong>Pricing:</strong> <code>0.03 credits per result returned</code>. A
  request with no results does not consume credits.
</Callout>

* **Rate limit:** 30 requests per minute.

<Info>
  Search results are intentionally lightweight so you can explore and segment
  companies at a low credit cost. When you need the full company profile, use
  [Company Enrich](/company-docs/enrichment/introduction).
</Info>

<CardGroup cols={3}>
  <Card title="Examples" icon="list-filter" href="/company-docs/search/examples">
    `or`/nested logic, well-funded-by-country, recently founded.
  </Card>

  <Card title="Pagination & sorting" icon="list-ordered" href="/company-docs/search/reference#paginate-through-results">
    Cursor-based pagination and sort rules for stable ordering.
  </Card>

  <Card title="Reference" icon="book" href="/company-docs/search/reference">
    Operators, searchable fields, response fields, validation, errors.
  </Card>
</CardGroup>

***

## Your first search: find a company by domain

The simplest search finds a company by its exact primary domain. You pass a single filter with the `=` operator.

<CodeGroup>
  ```bash Request theme={"theme":"vitesse-black"}
  curl --request POST \
    --url https://api.crustdata.com/company/search \
    --header 'authorization: Bearer YOUR_API_KEY' \
    --header 'content-type: application/json' \
    --header 'x-api-version: 2025-11-01' \
    --data '{
      "filters": {
        "field": "basic_info.primary_domain",
        "type": "=",
        "value": "retool.com"
      },
      "limit": 1,
      "fields": [
        "crustdata_company_id",
        "basic_info.name",
        "basic_info.primary_domain",
        "basic_info.year_founded",
        "headcount.total",
        "locations.country",
        "funding.total_investment_usd"
      ]
    }'
  ```

  ```json Response theme={"theme":"vitesse-black"}
  {
      "companies": [
          {
              "crustdata_company_id": 633593,
              "basic_info": {
                  "name": "Retool",
                  "primary_domain": "retool.com",
                  "year_founded": 2017
              },
              "headcount": {
                  "total": 443
              },
              "locations": {
                  "country": "USA"
              },
              "funding": {
                  "total_investment_usd": 141000000.0
              }
          }
      ],
      "next_cursor": "H4sIAMWlBWoC_xXMMQ7DIAxA0atEzB2MDYb0KlUVgTHKUBU1IUMV5e6l6_vSP83n0O27rGlfzX0yORcIzqGr3iolmIWkAGCiEH0pGB2j44pBVLmCEFPNA0AtxiRgbpPZ29bH68FEfqbnkN56ei3Sjvc_2OsHdWUiVXYAAAA=",
      "total_count": 1
  }
  ```
</CodeGroup>

### Understanding the response

Every search response has three fields:

* **`companies`** — an array of matching company records. Each record contains the fields you requested in `fields`.
* **`next_cursor`** — a pagination token. Pass it in the next request to get the next page. `null` means there are no more pages.
* **`total_count`** — how many companies match your filters across the full database (may be `null` for very broad queries).

### How to interpret results

* **`next_cursor` is `null`:** You have reached the last page. No more results.
* **`total_count` is `null`:** The exact count is too expensive to compute for this query. Use `next_cursor` to determine if more pages exist.
* **Empty `companies` array:** No companies matched your filters. Broaden your filters or check values with [Autocomplete](/company-docs/autocomplete/introduction).

### Controlling which fields come back

The `fields` parameter lets you pick exactly which fields to include. This keeps your responses small and focused. If you omit `fields`, the API returns all available fields for each company.

***

## Combine filters with `and`

Real searches need more than one criterion. Wrap multiple conditions inside an `op: "and"` group to require all of them.

This search finds software development companies headquartered in the USA, sorted by headcount (largest first).

<CodeGroup>
  ```bash Request theme={"theme":"vitesse-black"}
  curl --request POST \
    --url https://api.crustdata.com/company/search \
    --header 'authorization: Bearer YOUR_API_KEY' \
    --header 'content-type: application/json' \
    --header 'x-api-version: 2025-11-01' \
    --data '{
      "filters": {
        "op": "and",
        "conditions": [
          {
            "field": "taxonomy.professional_network_industry",
            "type": "=",
            "value": "Software Development"
          },
          {
            "field": "locations.country",
            "type": "in",
            "value": ["USA"]
          }
        ]
      },
      "sorts": [{"field": "headcount.total", "order": "desc"}],
      "limit": 2,
      "fields": [
        "crustdata_company_id",
        "basic_info.name",
        "basic_info.primary_domain",
        "headcount.total",
        "locations.country"
      ]
    }'
  ```

  ```json Response theme={"theme":"vitesse-black"}
  {
      "companies": [
          {
              "crustdata_company_id": 6034577,
              "basic_info": {
                  "name": "Amazon",
                  "primary_domain": "aboutamazon.com"
              },
              "headcount": {
                  "total": 763362
              },
              "locations": {
                  "country": "USA"
              }
          },
          {
              "crustdata_company_id": 4926893,
              "basic_info": {
                  "name": "Google",
                  "primary_domain": "goo.gle"
              },
              "headcount": {
                  "total": 335569
              },
              "locations": {
                  "country": "USA"
              }
          }
      ],
      "next_cursor": "H4sIADxxqGkC_w3MMQ7CMAwF0KtEnjsksZ...",
      "total_count": null
  }
  ```
</CodeGroup>

<Note>Response trimmed for clarity.</Note>

The key difference from the first example: instead of a single `filters` object, you now have a group with `op: "and"` and a `conditions` array. Every condition must match for a company to be included.

For `or` and nested logic, or for finding well-funded or recently founded
companies, see [Examples](/company-docs/search/examples). To walk through
large result sets, see
[Pagination and sorting](/company-docs/search/reference#paginate-through-results).

***

## What to do next

* **Try more filter patterns** — see [Examples](/company-docs/search/examples) for `or`/nested logic and funding/year-founded filters.
* **Paginate and sort** — see [Pagination and sorting](/company-docs/search/reference#paginate-through-results).
* **Look up operators and fields** — see [Search reference](/company-docs/search/reference).
* **Enrich a company** — use [Company Enrich](/company-docs/enrichment/introduction) to get a detailed profile for a known company.
* **Discover filter values** — use [Autocomplete](/company-docs/autocomplete/introduction) to find valid values before building search filters.
