curl --request POST \
--url https://bee.theswarm.com/v3/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,
"pagination_token": "<string>",
"stable_pagination": false,
"in_network_only": false
}
'import requests
url = "https://bee.theswarm.com/v3/profiles/search"
payload = {
"query": { "match": { "profile_info.job_title": { "query": "Data Scientist" } } },
"limit": 100,
"pagination_token": "<string>",
"stable_pagination": False,
"in_network_only": False
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: {match: {'profile_info.job_title': {query: 'Data Scientist'}}},
limit: 100,
pagination_token: '<string>',
stable_pagination: false,
in_network_only: false
})
};
fetch('https://bee.theswarm.com/v3/profiles/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://bee.theswarm.com/v3/profiles/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => [
'match' => [
'profile_info.job_title' => [
'query' => 'Data Scientist'
]
]
],
'limit' => 100,
'pagination_token' => '<string>',
'stable_pagination' => false,
'in_network_only' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://bee.theswarm.com/v3/profiles/search"
payload := strings.NewReader("{\n \"query\": {\n \"match\": {\n \"profile_info.job_title\": {\n \"query\": \"Data Scientist\"\n }\n }\n },\n \"limit\": 100,\n \"pagination_token\": \"<string>\",\n \"stable_pagination\": false,\n \"in_network_only\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://bee.theswarm.com/v3/profiles/search")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": {\n \"match\": {\n \"profile_info.job_title\": {\n \"query\": \"Data Scientist\"\n }\n }\n },\n \"limit\": 100,\n \"pagination_token\": \"<string>\",\n \"stable_pagination\": false,\n \"in_network_only\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://bee.theswarm.com/v3/profiles/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": {\n \"match\": {\n \"profile_info.job_title\": {\n \"query\": \"Data Scientist\"\n }\n }\n },\n \"limit\": 100,\n \"pagination_token\": \"<string>\",\n \"stable_pagination\": false,\n \"in_network_only\": false\n}"
response = http.request(request)
puts response.read_body{
"ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"total_count": 123,
"pagination_token": "<string>"
}{
"code": 123,
"errors": [
"<string>"
]
}Search Profiles
Search for profiles using OpenSearch DSL queries. Returns a list of profile IDs that can be passed to the Fetch Profile endpoint.
curl --request POST \
--url https://bee.theswarm.com/v3/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,
"pagination_token": "<string>",
"stable_pagination": false,
"in_network_only": false
}
'import requests
url = "https://bee.theswarm.com/v3/profiles/search"
payload = {
"query": { "match": { "profile_info.job_title": { "query": "Data Scientist" } } },
"limit": 100,
"pagination_token": "<string>",
"stable_pagination": False,
"in_network_only": False
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: {match: {'profile_info.job_title': {query: 'Data Scientist'}}},
limit: 100,
pagination_token: '<string>',
stable_pagination: false,
in_network_only: false
})
};
fetch('https://bee.theswarm.com/v3/profiles/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://bee.theswarm.com/v3/profiles/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => [
'match' => [
'profile_info.job_title' => [
'query' => 'Data Scientist'
]
]
],
'limit' => 100,
'pagination_token' => '<string>',
'stable_pagination' => false,
'in_network_only' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://bee.theswarm.com/v3/profiles/search"
payload := strings.NewReader("{\n \"query\": {\n \"match\": {\n \"profile_info.job_title\": {\n \"query\": \"Data Scientist\"\n }\n }\n },\n \"limit\": 100,\n \"pagination_token\": \"<string>\",\n \"stable_pagination\": false,\n \"in_network_only\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://bee.theswarm.com/v3/profiles/search")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": {\n \"match\": {\n \"profile_info.job_title\": {\n \"query\": \"Data Scientist\"\n }\n }\n },\n \"limit\": 100,\n \"pagination_token\": \"<string>\",\n \"stable_pagination\": false,\n \"in_network_only\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://bee.theswarm.com/v3/profiles/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": {\n \"match\": {\n \"profile_info.job_title\": {\n \"query\": \"Data Scientist\"\n }\n }\n },\n \"limit\": 100,\n \"pagination_token\": \"<string>\",\n \"stable_pagination\": false,\n \"in_network_only\": false\n}"
response = http.request(request)
puts response.read_body{
"ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"total_count": 123,
"pagination_token": "<string>"
}{
"code": 123,
"errors": [
"<string>"
]
}"query" with your OpenSearch DSL query. The response contains a list of profile IDs that can be used in the Fetch Profile endpoint.{
"ids": [
"00007d1c-a048-480a-8c14-1f33a161a3db",
"0000ad61-2eda-4061-a20e-793d41016f03"
],
"total_count": 125867,
"pagination_token": "eyJzZWFyY2hfYWZ0ZXIiOlt7ImZpZWxkIjoiX3Njb3JlIiwidmFsdWUiOjF9LHsiZmllbGQiOiJwcm9maWxlX2luZm8uaWQiLCJ2YWx1ZSI6IjAwMDE2MTU4LWYyY2EtNDYzZC05YWEzLTIyOWZkMzk0ZWQ0MSJ9XX0="
}
Partner teams
Partners can execute a request in the context of a child team by passing the child teamβs ID in thex-authenticate-team header:
x-authenticate-team: <child_team_id>
- With the header β the search is scoped to the child teamβs context.
- Without the header β the search runs in the context of the team that owns the API key (default).
child_team_id is returned when you create a child team.
curl -X POST https://bee.theswarm.com/v3/profiles/search \
-H "x-api-key: YOUR_API_KEY" \
-H "x-authenticate-team: child-team-id-123" \
-H "Content-Type: application/json" \
-d '{
"query": {
"match": {
"profile_info.job_title": { "query": "Data Scientist" }
}
},
"limit": 10
}'
Pagination
The response includes apagination_token to fetch the next page. See Pagination for full details. The from parameter must be >= 0.
paginationToken, totalCount, and inNetworkOnly. See the Migrating to v3 guide.Authorizations
Headers
Partner accounts only. When present, the request is executed in the context of the specified child team (use the team_id returned by Create Team). When omitted, the request runs as the team that owns the API key.
Body
Search query in the ElasticSearch Query DSL format. Find mapping here
{
"match": {
"profile_info.job_title": { "query": "Data Scientist" }
}
}
Limit the number of results. If you want to use stable_pagination this parameter must be set to 1000
0 <= x <= 1000Pagination token received in the previous response
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
When set to true, restricts search results to profiles that are connected to your team's network. This parameter filters the query to only return profiles that have established connections with connectors of your organization.
Was this page helpful?

