POST
/
companies
/
search
curl --request POST \
  --url https://bee.theswarm.com/companies/search \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "query": {
    "match": {
      "company_info.industry": {
        "query": "Financial Services"
      }
    }
  },
  "limit": 100,
  "paginationToken": "<string>",
  "stable_pagination": false
}'
{
  "ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "totalCount": 123,
  "paginationToken": "<string>"
}

Replace "query" with your OpenSearch DSL query defining the search criteria and set the proper x-api-key. The response will contain a list of company IDs matching the search criteria, that can be later used in the Company Fetch endpoint.

See OpenSearch mapping for Search Company endpoint: OpenSearch Mapping.

Search returns up to 1000 results per page. The pagination works exactly as in the Profile Search endpoint.

Response example:

    {
      "ids": [
        "09d9c510-c9f6-4c6e-9e62-fe5fedbeda87",
      ],
      "totalCount": 1,
    }

Authorizations

x-api-key
string
header
required

Body

application/json
query
object
required

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

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: x <= 1000
paginationToken
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

200
application/json
A list of profile ids matching provided query
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