---
title: "Search for companies ids"
method: POST
path: "/v3/companies/search"
tags: ["companies"]
---

# Search for companies ids

`POST /v3/companies/search`

## Request

- Base URL: `https://bee.theswarm.com`
- URL: `https://bee.theswarm.com/v3/companies/search`
- Auth: API key in header `x-api-key`

Search for companies ids using the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html) format

## Headers

- `x-authenticate-team` string

## Request body

- object
  - `query` object, required: Search query in the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html) format. [Find mapping here](https://docs.theswarm.com/docs/enrichment-data/company/mappings-v3)
  - `limit` integer: Limit the number of results. If you want to use stable_pagination this parameter must be set to 1000
  - `pagination_token` string: Pagination token received in the previous response
  - `stable_pagination` boolean: When set to true, ensures that pagination results remain consistent, even if the underlying data changes during retrieval. This is useful for retrieving large result sets reliably across multiple requests

## Response `200`

A list of company ids matching provided query

- object
  - `ids` string[], required: List of company ids
  - `total_count` integer, required: Total number of companies matching the query
  - `pagination_token` string: Pagination token for the next request

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `5XX`: Unexpected error

## Changes

- **2026-07-26** `55bbdd2aa713`: 1 info
  - added the new optional `header` request parameter `x-authenticate-team`

[Operation history](https://skmtc.dev/theswarm/apis/swarm-api/changes/v3/companies/search/post.md)

---

[API](https://skmtc.dev/theswarm/apis/swarm-api.md) - [All operations](https://skmtc.dev/theswarm/apis/swarm-api/llms.txt) - [OpenAPI document](https://skmtc.dev/theswarm/apis/swarm-api/revisions/606ef079d65a?raw)
