Search Persons
Endpoint Overview
This endpoint facilitates the retrieval of individual profiles from the profileAPI database, incorporating advanced querying capabilities to enable specific, filtered searches.
Endpoint Details
- URL:
https://api.profileapi.com/2024-03-01/persons
- HTTP Method:
GET
Request Parameters
Refine your search using the following parameters to retrieve customized results:
Parameter | Type | Description | Example |
---|---|---|---|
expression | object | Implements complex filtering with conditions that may all need to be satisfied, any one or more can be satisfied, or specific ones excluded. | Refer to Expression Structure |
limit | integer | Sets the maximum number of results to return. The default is 10, with a maximum limit of 1000. | 100 |
fields | Array of string | Specifies which fields to extract from the person object model. Defaults to all fields if unspecified. | ["department", "role"] |
Expression Structure
Utilize the expression
parameter for advanced filtering:
all
: Requires all listed conditions to be fulfilled. Conditions can also be specifically excluded.any
: Requires at least one of the listed conditions to be met.
Example Expression:
{
"all": [
{
"categoryKey": "countryCode",
"name": "US"
},
{
"categoryKey": "unitedStatesStateCode",
"name": "CA",
"exclude": true
}
],
"any": [
{"categoryKey": "seniority", "name": "C-Level+"},
{"categoryKey": "seniority", "name": "Vice President"}
]
}
Response Structure
Responses are structured to include metadata and a data array with details of the persons matching the query. They are sorted by relevance, with the most relevant results displayed first.
Example Data Response:
{
"data": {
"items": [
{
"id": "9e6a55b258ef11edb8780242ac120002",
"name": "Jon Doe",
"linkedinUrl": "<https://linkedin.com/in/jondoe>",
"title": "Software Engineer"
}
],
"pagination": {
"nextStart": [{"id": "9e6a55b258ef11edb8780242ac121233", "score": 0.92}]
}
}
}
Example Usage
cURL:
curl '<https://api.profileapi.com/2024-03-01/persons?limit=50&fields=name,title,linkedinUrl>'
Node.js (Using Axios):
const axios = require('axios');
axios.get('<https://api.profileapi.com/2024-03-01/persons>', {
params: {
limit: 50,
fields: ['name', 'title', 'linkedinUrl']
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error fetching data:', error);
});
Python (Using requests):
import requests
params = {
'limit': 50,
'fields': ['name', 'title', 'linkedinUrl']
}
response = requests.get('<https://api.profileapi.com/2024-03-01/persons>', params=params)
if response.status_code == 200:
print(response.json())
else:
print('Failed to fetch data:', response.status_code)