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

# Crustdata: Companydb Search

> Search CrustData CompanyDB with structured filters. Includes SDK V2 guidance, input constraints, response fields, and Deepline credit cost.

Search CrustData CompanyDB with structured filters.

> [!NOTE]
>
> Tool ID: `crustdata_companydb_search`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'crustdata_companydb_search',
  {
    "filters": [
      {
        "filter_type": "hq_country",
        "type": "=",
        "value": "USA"
      }
    ]
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute crustdata_companydb_search --input '{
  "filters": [
    {
      "filter_type": "hq_country",
      "type": "=",
      "value": "USA"
    }
  ]
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "status": "example",
  "result": {
    "data": {
      "companies": [
        {
          "company_name": "Example Corp",
          "company_domain": "example.com",
          "industry": "example",
          "employee_count": 123
        }
      ],
      "meta": {
        "totalCount": 123,
        "nextCursor": "cursor_123",
        "limit": 123,
        "hasMore": true
      }
    }
  }
}
```

Use `deepline describe crustdata_companydb_search --json` for the latest machine-readable contract.

## Input reference

Searches CompanyDB using /screener/companydb/search with filters.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.filters` | `object \| array` | Yes | — | Array of filter conditions (AND-combined). Each: \{filter\_type, type, value} or \{filter\_name, type, value}. filter\_name is syntactic sugar for filter\_type (e.g. company\_investors → crunchbase\_investors, company\_funding\_stage → last\_funding\_round\_type). Single object is accepted. Nested \{op,conditions} groups supported for OR logic. Current Crust CompanyDB dot-path field names are accepted and passed through. |
| `payload.fields` | `string \| array` | No | — | Optional field selection (array or comma-separated). Passed through to Crust when provided. |
| `payload.limit` | `integer` | No | `20` | Max results to return (1-1000, default 20). Minimum: 1. Maximum: 1000. |
| `payload.cursor` | `string` | No | — | Pagination cursor. Minimum length: 1. |
| `payload.sorts` | `array` | No | — | Sort criteria array. Minimum items: 1. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Searches CompanyDB using /screener/companydb/search with filters.",
    "properties": {
      "filters": {
        "description": "Array of filter conditions (AND-combined). Each: {filter_type, type, value} or {filter_name, type, value}. filter_name is syntactic sugar for filter_type (e.g. company_investors → crunchbase_investors, company_funding_stage → last_funding_round_type). Single object is accepted. Nested {op,conditions} groups supported for OR logic. Current Crust CompanyDB dot-path field names are accepted and passed through.",
        "anyOf": [
          {
            "$ref": "T0"
          },
          {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "T0"
            }
          }
        ]
      },
      "fields": {
        "description": "Optional field selection (array or comma-separated). Passed through to Crust when provided.",
        "anyOf": [
          {
            "type": "string",
            "minLength": 1
          },
          {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        ]
      },
      "limit": {
        "type": "integer",
        "description": "Max results to return (1-1000, default 20).",
        "default": 20,
        "minimum": 1,
        "maximum": 1000
      },
      "cursor": {
        "type": "string",
        "description": "Pagination cursor.",
        "minLength": 1
      },
      "sorts": {
        "type": "array",
        "description": "Sort criteria array.",
        "minItems": 1,
        "items": {
          "type": "object",
          "properties": {
            "column": {
              "type": "string",
              "description": "Field to sort by. Supports current Crust CompanyDB sort fields plus Deepline aliases like funding_date/last_funding_round_date -> last_funding_date, funding_stage/funding_round -> last_funding_round_type, headcount/size -> employee_metrics.latest_count, industry -> linkedin_industries, location -> hq_country, domain -> company_website_domain.",
              "minLength": 1
            },
            "order": {
              "type": "string",
              "description": "Sort order: asc or desc.",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          "required": [
            "column",
            "order"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "filters"
    ],
    "additionalProperties": false,
    "$defs": {
      "T0": {
        "$id": "T0",
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "filter_type": {
                "type": "string",
                "description": "Field to filter on. Accepts current Crust CompanyDB field paths plus Deepline aliases via filter_name. Key mappings: company_investors → crunchbase_investors, company_funding_stage → last_funding_round_type, funding stage/round → last_funding_round_type, headcount/size → employee_metrics.latest_count, industry → linkedin_industries, location → hq_country (ISO alpha-3) or hq_location or region, funding amount → crunchbase_total_investment_usd, domain → company_website_domain. New upstream dot-path fields are passed through instead of being rejected locally.",
                "minLength": 1
              },
              "type": {
                "type": "string",
                "description": "Operator: =, !=, in, not_in, >, <, =>, =<, (.) fuzzy contains, [.] substring.",
                "enum": [
                  "=",
                  "!=",
                  "in",
                  "not_in",
                  ">",
                  "<",
                  "=>",
                  "=<",
                  "(.)",
                  "[.]"
                ]
              },
              "value": {
                "description": "Filter value. When unsure of exact values for a field, call crustdata_companydb_autocomplete first (free, no credits): e.g. deepline tools execute crustdata_companydb_autocomplete --payload '{\"field\":\"last_funding_round_type\",\"query\":\"series\",\"limit\":10}'. hq_country uses ISO 3166-1 alpha-3 codes (USA, GBR, CAN).",
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        }
                      ]
                    }
                  }
                ]
              }
            },
            "required": [
              "filter_type",
              "type",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "op": {
                "type": "string",
                "description": "Logical operator for conditions.",
                "enum": [
                  "and",
                  "or"
                ]
              },
              "conditions": {
                "type": "array",
                "description": "Nested filter conditions.",
                "minItems": 1,
                "items": {
                  "$ref": "T0"
                }
              }
            },
            "required": [
              "op",
              "conditions"
            ],
            "additionalProperties": false
          }
        ]
      }
    }
  }
  ```
</details>

## Output reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.status` | `string` | Yes | — | — |
| `result.result` | `object` | Yes | — | — |
| `result.result.data` | `object` | Yes | — | — |
| `result.result.data.companies` | `array` | Yes | — | — |
| `result.result.data.companies[].company_name` | `string` | Yes | — | — |
| `result.result.data.companies[].company_domain` | `string` | Yes | — | — |
| `result.result.data.companies[].industry` | `string` | Yes | — | — |
| `result.result.data.companies[].employee_count` | `integer` | Yes | — | — |
| `result.result.data.meta` | `object` | Yes | — | — |
| `result.result.data.meta.totalCount` | `integer` | Yes | — | — |
| `result.result.data.meta.nextCursor` | `string` | Yes | — | — |
| `result.result.data.meta.limit` | `integer` | Yes | — | — |
| `result.result.data.meta.hasMore` | `boolean` | Yes | — | — |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "properties": {
      "status": {
        "type": "string"
      },
      "result": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "companies": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "company_name": {
                      "type": "string"
                    },
                    "company_domain": {
                      "type": "string"
                    },
                    "industry": {
                      "type": "string"
                    },
                    "employee_count": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "company_name",
                    "company_domain",
                    "industry",
                    "employee_count"
                  ],
                  "additionalProperties": true
                }
              },
              "meta": {
                "type": "object",
                "properties": {
                  "totalCount": {
                    "type": "integer"
                  },
                  "nextCursor": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "integer"
                  },
                  "hasMore": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "totalCount",
                  "nextCursor",
                  "limit",
                  "hasMore"
                ],
                "additionalProperties": true
              }
            },
            "required": [
              "companies",
              "meta"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": true
      }
    },
    "required": [
      "status",
      "result"
    ],
    "additionalProperties": true
  }
  ```
</details>

## Deepline cost

* Pricing model: `per_result` (per result).
* Estimated Deepline credits: `0.4` per pricing unit.

## Related documentation

* [Crustdata provider guide](https://deepline.com/docs/providers/crustdata/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.