Relationships
curl --request POST \
--url https://bee.theswarm.com/v3/relationships \
--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>"
}
'import requests
url = "https://bee.theswarm.com/v3/relationships"
payload = {
"query": { "match": { "profile_info.job_title": { "query": "Data Scientist" } } },
"limit": 100,
"pagination_token": "<string>"
}
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>'
})
};
fetch('https://bee.theswarm.com/v3/relationships', 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/relationships",
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>'
]),
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/relationships"
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}")
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/relationships")
.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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://bee.theswarm.com/v3/relationships")
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}"
response = http.request(request)
puts response.read_body{
"items": [
{
"profile": {
"full_name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"current_title": "<string>",
"linkedin_url": "<string>",
"work_email": "<string>",
"current_company_name": "<string>",
"current_company_website": "<string>"
},
"connections": [
{
"connector_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"connector_name": "<string>",
"connector_linkedin_url": "<string>",
"connector_current_title": "<string>",
"connector_current_company_name": "<string>",
"connection_strength_normalized": 123,
"connection_strength": 123,
"manual_strength": 123,
"sources": [
{
"shared_company": "<string>",
"shared_company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"shared_company_website": "<string>",
"shared_company_linkedin_slug": "<string>",
"overlap_start_date": "<string>",
"overlap_end_date": "<string>",
"overlap_duration_months": 123,
"shared_school": "<string>",
"shared_major": "<string>",
"graduation_year": "<string>",
"investor": "<string>",
"portfolio_company": "<string>"
}
]
}
]
}
],
"count": 123,
"total_count": 123,
"pagination_token": "<string>"
}{
"code": 123,
"errors": [
"<string>"
]
}Endpoints (v3)
Relationships
Find connected profiles with their connection details. Renamed from Network Mapper in v3.
POST
/
v3
/
relationships
Relationships
curl --request POST \
--url https://bee.theswarm.com/v3/relationships \
--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>"
}
'import requests
url = "https://bee.theswarm.com/v3/relationships"
payload = {
"query": { "match": { "profile_info.job_title": { "query": "Data Scientist" } } },
"limit": 100,
"pagination_token": "<string>"
}
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>'
})
};
fetch('https://bee.theswarm.com/v3/relationships', 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/relationships",
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>'
]),
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/relationships"
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}")
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/relationships")
.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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://bee.theswarm.com/v3/relationships")
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}"
response = http.request(request)
puts response.read_body{
"items": [
{
"profile": {
"full_name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"current_title": "<string>",
"linkedin_url": "<string>",
"work_email": "<string>",
"current_company_name": "<string>",
"current_company_website": "<string>"
},
"connections": [
{
"connector_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"connector_name": "<string>",
"connector_linkedin_url": "<string>",
"connector_current_title": "<string>",
"connector_current_company_name": "<string>",
"connection_strength_normalized": 123,
"connection_strength": 123,
"manual_strength": 123,
"sources": [
{
"shared_company": "<string>",
"shared_company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"shared_company_website": "<string>",
"shared_company_linkedin_slug": "<string>",
"overlap_start_date": "<string>",
"overlap_end_date": "<string>",
"overlap_duration_months": 123,
"shared_school": "<string>",
"shared_major": "<string>",
"graduation_year": "<string>",
"investor": "<string>",
"portfolio_company": "<string>"
}
]
}
]
}
],
"count": 123,
"total_count": 123,
"pagination_token": "<string>"
}{
"code": 123,
"errors": [
"<string>"
]
}Relationships requests do not consume API credits. See Credits & Usage.
x-authenticate-team header โ the response then reflects the connectors and connections of that child teamโs network instead. See Partner teams below.
The request body accepts a standard OpenSearch DSL query plus optional limit and pagination_token top-level parameters.
For request and response examples, see Relationships endpoint examples.
For the response schema, see Models > Network Mapper.
Filtering by indexed fields
The OpenSearch DSLquery body lets you filter on any indexed field on the profile document. The most common patterns are:
- Filter by a specific team member (connector) โ query the top-level
connected_usersfield (keyword) with atermclause. - Filter by how the connection was synced โ query the nested
team_connections.originsfield (keyword) with anestedquery, typically scoped to yourteam_connections.team_id. - Filter by profile attributes โ query any indexed profile field (title, company, location, seniority, etc.) the same way you would in Search Profiles.
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 query runs against the child teamโs network (its connectors and their connections).
- Without the header โ the query runs against the network of the team that owns the API key (default).
child_team_id is returned when you create a child team.
Example request
curl -X POST https://bee.theswarm.com/v3/relationships \
-H "x-api-key: YOUR_API_KEY" \
-H "x-authenticate-team: child-team-id-123" \
-H "Content-Type: application/json" \
-d '{
"query": {
"term": {
"profile_info.current_company_website": {
"value": "theswarm.com"
}
}
},
"limit": 10
}'
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
application/json
Search query in the ElasticSearch Query DSL format. Find mapping here
Example:
{
"match": {
"profile_info.job_title": { "query": "Data Scientist" }
}
}
Limit the number of results
Required range:
0 <= x <= 1000Pagination token received in the previous response
Was this page helpful?
โI

