Examples - Identify API

Code examples and walkthroughs using the Person Identify API

On this page you'll find a collection of functional code examples that illustrate various aspects of the functionality of the Identify API.

Code examples here are shown using Python3, JavaScript, Ruby, Go and cURL.

📘

See a bug? Want to see a specific example?

Feel free to use the Suggest Edits button in the top right-hand corner of this page to point out any bugs or request any specific code examples for this API endpoint you'd like to see here!

Basic Usage

I would like to find the most strongly associated profiles for the name "Sean Thorne"

import json

# See https://github.com/peopledatalabs/peopledatalabs-python
from peopledatalabs import PDLPY

# Create a client, specifying an API key
client = PDLPY(
    api_key="YOUR API KEY",
)

PARAMS = {
 "first_name": "sean", 
 "last_name": "thorne", 
 "company": "people data labs",
 "pretty": True
}

response_data = client.person.identify(**PARAMS).json()

identities = response_data['matches']

print(identities)
print(f"Found {len(identities)} identities!")
API_KEY="ENTER YOUR API KEY HERE"
curl -X GET -G \
  "https://api.peopledatalabs.com/v5/person/identify"\
  -H "X-Api-Key: ${API_KEY}" \
  --data-urlencode 'profile=linkedin.com/in/seanthorne'\
  --data-urlencode 'pretty=True'
// See https://github.com/peopledatalabs/peopledatalabs-js
import PDLJS from 'peopledatalabs';

const PDLJSClient = new PDLJS({ apiKey: "YOUR API KEY" });

const params = {
  name: "sean thorne",
  pretty: true,
}

PDLJSClient.person.identify(params).then((data) => {
  console.log(data);
}).catch((error) => {
  console.log(error);
});
# See https://github.com/peopledatalabs/peopledatalabs-ruby
require 'peopledatalabs'

Peopledatalabs.api_key = 'YOUR API KEY'

PARAMS = {
 "first_name": "sean", 
 "last_name": "thorne", 
 "company": "people data labs",
 "pretty": true
}

response = Peopledatalabs::Identify.person(params: PARAMS)

identities = response['matches']

puts identities
puts "Found #{identities.length()} identities!"
package main

import (
    "fmt"
    "encoding/json"
)

import (
    pdl "github.com/peopledatalabs/peopledatalabs-go"
    pdlmodel "github.com/peopledatalabs/peopledatalabs-go/model"
)

func main() {
    apiKey := "YOUR API KEY"
    // Set API KEY as env variable
    // apiKey := os.Getenv("API_KEY")

    client := pdl.New(apiKey)
    
    params := pdlmodel.IdentifyPersonParams {
        BaseParams: pdlmodel.BaseParams {
            Pretty: true,
        },
        PersonParams: pdlmodel.PersonParams {
            FirstName: []string{"sean"},
            LastName: []string{"thorne"},
            Company: []string{"people data labs"},
        },
    }
    
    response, err := client.Person.Identify(params)
    if err == nil {
        identities := response.Matches
        jsonResponse, jsonErr := json.Marshal(identities)
        if (jsonErr == nil) {
            fmt.Println(string(jsonResponse))
        }
        
        fmt.Printf("Found %d identities!\n", len(identities))
    }
}
import requests

API_KEY = "ENTER YOUR API KEY"

PDL_URL = "https://api.peopledatalabs.com/v5/person/identify"

PARAMS = {
  "name": "sean thorne",
  "pretty": True,
  "api_key": API_KEY
}

response = requests.request("GET", PDL_URL, params=PARAMS)

print(response.text)

response_data = response.json()
matches = response_data['matches']

print(f"Found {len(matches)} matches")

Associated LinkedIn Profiles

I would like to find the most strongly associated profiles for a particular linkedin account

import json

# See https://github.com/peopledatalabs/peopledatalabs-python
from peopledatalabs import PDLPY

# Create a client, specifying an API key
client = PDLPY(
    api_key="YOUR API KEY",
)

PARAMS = {
  "profile": "linkedin.com/in/seanthorne",
  "pretty": True
}

response_data = client.person.identify(**PARAMS).json()

matches = response_data['matches']

print(matches)
print(f"Found {len(matches)} matches!")
API_KEY="ENTER YOUR API KEY HERE"
curl -X GET -G \
  "https://api.peopledatalabs.com/v5/person/identify"\
  -H "X-Api-Key: ${API_KEY}" \
  --data-urlencode 'profile=linkedin.com/in/seanthorne'\
  --data-urlencode 'pretty=True'
// See https://github.com/peopledatalabs/peopledatalabs-js
import PDLJS from 'peopledatalabs';

const PDLJSClient = new PDLJS({ apiKey: "YOUR API KEY" });

const params = {
  profile: "linkedin.com/in/seanthorne",
  pretty: true,
}

PDLJSClient.person.identify(params).then((data) => {
  console.log(data);
}).catch((error) => {
  console.log(error);
});
# See https://github.com/peopledatalabs/peopledatalabs-ruby
require 'peopledatalabs'

Peopledatalabs.api_key = 'YOUR API KEY'

PARAMS = {
 "profile": "linkedin.com/in/seanthorne",
 "pretty": true
}

response = Peopledatalabs::Identify.person(params: PARAMS)

matches = response['matches']

puts matches
puts "Found #{matches.length()} matches!"
package main

import (
    "fmt"
    "encoding/json"
)

import (
    pdl "github.com/peopledatalabs/peopledatalabs-go"
    pdlmodel "github.com/peopledatalabs/peopledatalabs-go/model"
)

func main() {
    apiKey := "YOUR API KEY"
    // Set API KEY as env variable
    // apiKey := os.Getenv("API_KEY")

    client := pdl.New(apiKey)
    
    params := pdlmodel.IdentifyPersonParams {
        BaseParams: pdlmodel.BaseParams {
            Pretty: true,
        },
        PersonParams: pdlmodel.PersonParams {
            Profile: []string{"linkedin.com/in/seanthorne"},
        },
    }
    
    response, err := client.Person.Identify(params)
    if err == nil {
        matches := response.Matches
        jsonResponse, jsonErr := json.Marshal(matches)
        if (jsonErr == nil) {
            fmt.Println(string(jsonResponse))
        }
        
        fmt.Printf("Found %d matches!\n", len(matches))
    }
}
import requests

API_KEY = "ENTER YOUR API KEY"

PDL_URL = "https://api.peopledatalabs.com/v5/person/identify"

PARAMS = {
  "profile": "linkedin.com/in/seanthorne",
  "pretty": True,
  "api_key": API_KEY
}

response = requests.request("GET", PDL_URL, params=PARAMS)

print(response.text)

response_data = response.json()
matches = response_data['matches']

print(f"Found {len(matches)} matches")

Did this page help you?