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

See OpenSearch Mapping for the Search endpoint.

Search returns 1000 results per page.

Note: Replace "query" with your OpenSearch DSL query defining the search criteria. The response will contain a list of profile IDs matching the search criteria, that can be later used in the Fetch endpoint

{
  query {
    ids: [
      "00007d1c-a048-480a-8c14-1f33a161a3db",
      "0000ad61-2eda-4061-a20e-793d41016f03",
      "0000fdfd-98f8-4bf3-adf8-b8a18a3c64f9",
      "000103f7-79eb-412e-9839-40a4d04858c3",
      "00016158-f2ca-463d-9aa3-229fd394ed41"
    ],
    totalCount: 125867,
    paginationToken: "eyJzZWFyY2hfYWZ0ZXIiOlt7ImZpZWxkIjoiX3Njb3JlIiwidmFsdWUiOjF9LHsiZmllbGQiOiJwcm9maWxlX2luZm8uaWQiLCJ2YWx1ZSI6IjAwMDE2MTU4LWYyY2EtNDYzZC05YWEzLTIyOWZkMzk0ZWQ0MSJ9XX0="
  }
}

For more examples, refer to Examples.

Pagination

When making requests to the Search endpoint, pagination can be utilized to retrieve large sets of search results efficiently. As shown in the above API response, it will contain a pagination token that should be used in subsequent requests to fetch the next page of results.

Below is an example query that will query the next 5 records using the pagination token:

{
  "query": {
    "exists": {
      "field": "profile_info.emails"
    }
  },
  "limit": 5,
  "paginationToken": "eyJzZWFyY2hfYWZ0ZXIiOlt7ImZpZWxkIjoiX3Njb3JlIiwidmFsdWUiOjF9LHsiZmllbGQiOiJwcm9maWxlX2luZm8uaWQiLCJ2YWx1ZSI6IjAwMDE2MTU4LWYyY2EtNDYzZC05YWEzLTIyOWZkMzk0ZWQ0MSJ9XX0="
}

Authorizations

x-api-key
string
header
required

Body

application/json

Response

200
application/json
A list of profile ids matching provided query

The response is of type object.