Quickstart - Person Enrichment API
Getting Started
In order to use our Person Enrichment API, you must have an active API key. You can look up your API key by logging into our self-serve dashboard and going to the API Keys section.
Need an API Key?
If you don't have an API key, you can easily create one by signing up for a self-serve account. For more information, check out our Self-Serve Quickstart Guide, which walks you through the sign-up process as well as shows you how to use the self-serve API dashboard.
Simple Example
As mentioned in the Overview, the Person Enrichment API is a means of performing a one-to-one match of an individual with those included in our Person Dataset. In order to use the Person Enrichment API, you will need at least one of the input parameters of the API.
Here's a quick example that demonstrates retrieving a record with a profile
of http://linkedin.com/in/seanthorne
:
import json
# See https://github.com/peopledatalabs/peopledatalabs-python
from peopledatalabs import PDLPY
# Create a client, specifying your API key
CLIENT = PDLPY(
api_key="YOUR API KEY",
)
# Create a parameters JSON object
PARAMS = {
"profile": ["linkedin.com/in/seanthorne"]
}
# Pass the parameters object to the Person Enrichment API
json_response = CLIENT.person.enrichment(**PARAMS).json()
# Print the API response in JSON format
print(json_response)
curl -X GET \
'https://api.peopledatalabs.com/v5/person/enrich?api_key=xxxx&profile=linkedin.com/in/seanthorne'
// See https://github.com/peopledatalabs/peopledatalabs-js
import PDLJS from 'peopledatalabs';
// Create a client, specifying your API key
const PDLJSClient = new PDLJS({ apiKey: "YOUR API KEY" });
// Create a parameters JSON object
const params = {
profile: "http://linkedin.com/in/seanthorne"
}
// Pass the parameters object to the Person Enrichment API
PDLJSClient.person.enrichment(params).then((jsonResponse) => {
// Print the API response in JSON format
console.log(jsonResponse);
}).catch((error) => {
console.log(error);
});
require 'json'
# See https://github.com/peopledatalabs/peopledatalabs-ruby
require 'peopledatalabs'
# Set your API key
Peopledatalabs.api_key = 'YOUR API KEY'
# Create a parameters JSON object
PARAMS = {
profile: ['linkedin.com/in/seanthorne']
}
# Pass the parameters object to the Person Enrichment API
json_response = Peopledatalabs::Enrichment.person(params: PARAMS)
# Print the API response in JSON format
puts JSON.dump(json_response)
package main
import (
"fmt"
"encoding/json"
"context"
)
// See https://github.com/peopledatalabs/peopledatalabs-go
import (
pdl "github.com/peopledatalabs/peopledatalabs-go"
pdlmodel "github.com/peopledatalabs/peopledatalabs-go/model"
)
func main() {
// Set your API key
apiKey := "YOUR API KEY"
// Set API key as environmental variable
// apiKey := os.Getenv("API_KEY")
// Create a client, specifying your API key
client := pdl.New(apiKey)
// Create a parameters JSON object
params := pdlmodel.EnrichPersonParams {
PersonParams: pdlmodel.PersonParams {
Profile: []string{"linkedin.com/in/seanthorne"},
},
}
// Pass the parameters object to the Person Enrichment API
response, err := client.Person.Enrich(context.Background(), params)
// Convert the API response to JSON
jsonResponse, jsonErr := json.Marshal(response.Data)
// Print the API response
if err == nil && jsonErr == nil {
fmt.Println(string(jsonResponse))
}
}
import requests
# Set your API key
API_KEY = "YOUR API KEY"
# Set the Person Enrichment API URL
PDL_URL = "https://api.peopledatalabs.com/v5/person/enrich"
# Create a parameters JSON object
PARAMS = {
"api_key": API_KEY,
"profile": ["linkedin.com/in/seanthorne"]
}
# Pass the parameters object to the Person Enrichment API
json_response = requests.get(PDL_URL, params=PARAMS).json()
# Print the API response in JSON format
print(json_response)
The API will return the matching person record if the LinkedIn URL passed to it exists in our dataset.
The result of running the above code should be the profile for Sean Thorne (the CEO of People Data Labs) from our Person Dataset. To see Sean's full profile that would be returned in the data
object, check out our Example Person Record.
{
"status": 200,
"likelihood": 10,
"data": {
"id": "qEnOZ5Oh0poWnQ1luFBfVw_0000",
"full_name": "sean thorne",
...
}
}
If you don't get this response, check out our Errors page for more information.
Updated 3 months ago