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

# Search for companies ids

`POST /companies/search`

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

## 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/mappings/company-v2)
  - `limit` integer — Limit the number of results. If you want to use stable_pagination this parameter must be set to 1000
  - `paginationToken` 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 profile ids matching provided query

- object
  - `ids` string[], required — List of company ids
  - `totalCount` integer, required — Total number of profiles matching the query
  - `paginationToken` string — Pagination token for the next request

## Other responses

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

---

[API](https://skmtc.dev/theswarm/apis/swarm-api.md) · [All operations](https://skmtc.dev/theswarm/apis/swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/theswarm/swarm-api/revisions/130f0025ff6c/schema)
