Skip to main content
POST
/
v3
/
companies
/
search
Search for companies ids
curl --request POST \
  --url https://bee.theswarm.com/v3/companies/search \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "query": {
    "match": {
      "company_info.industry": {
        "query": "Financial Services"
      }
    }
  },
  "limit": 100,
  "pagination_token": "<string>",
  "stable_pagination": false
}
'
{
  "ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "total_count": 123,
  "pagination_token": "<string>"
}
The Search Companies endpoint searches the internal database of Companies using OpenSearch DSL. See OpenSearch Mapping for available fields. Replace "query" with your OpenSearch DSL query and set the x-api-key header. Search returns up to 1000 results per page. Pagination works the same as the Search Profiles endpoint.
Response example
{
  "ids": [
    "09d9c510-c9f6-4c6e-9e62-fe5fedbeda87"
  ],
  "total_count": 1,
  "pagination_token": "eyJzZWFyY2hfYWZ0ZXIiOlt7ImZpZWxkIjoiX3Njb3JlIiwidmFsdWUiOjF9LHsiZmllbGQiOiJwcm9maWxlX2luZm8uaWQiLCJ2YWx1ZSI6IjAwMDE2MTU4LWYyY2EtNDYzZC05YWEzLTIyOWZkMzk0ZWQ0MSJ9XX0="
}
For query examples, see Search endpoint examples.
Migrating from v2? v3 uses snake_case for all field names. The v2 equivalents were paginationToken and totalCount. See the Migrating to v3 guide.

Authorizations

x-api-key
string
header
required

Body

application/json
query
object
required

Search query in the ElasticSearch Query DSL format. Find mapping here

Example:
{
"match": {
"company_info.industry": { "query": "Financial Services" }
}
}
limit
integer
default:100

Limit the number of results. If you want to use stable_pagination this parameter must be set to 1000

Required range: 0 <= x <= 1000
pagination_token
string

Pagination token received in the previous response

stable_pagination
boolean
default:false

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

A list of company ids matching provided query

ids
string<uuid>[]
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