POST
/
v2
/
profiles
/
search

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

    {
      "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:

    curl \
    --location 'https://bee.theswarm.com/profiles/search' \
    --header 'Content-Type: application/json' \
    --header 'x-api-key: $API_KEY' \
    --data \
    `{
      "query": {
        "exists": {
          "field": "profile_info.emails"
        }
      },
      "limit": 5,
      "paginationToken": "eyJzZWFyY2hfYWZ0ZXIiOlt7ImZpZWxkIjoiX3Njb3JlIiwidmFsdWUiOjF9LHsiZmllbGQiOiJwcm9maWxlX2luZm8uaWQiLCJ2YWx1ZSI6IjAwMDE2MTU4LWYyY2EtNDYzZC05YWEzLTIyOWZkMzk0ZWQ0MSJ9XX0="
    }`