Examples - Person Retrieve API

Code examples and walkthroughs using the Person Retrieve API

On this page you'll find a collection of full-running code examples that illustrate various aspects of the functionality of the Person Retrieve API.

Code examples here are shown using both Python3 and cURL.

Basic Usage

"I want to look up the record for a PDL Person ID that I have"

import requests, json

API_KEY = # YOUR API KEY

pdl_base_url = "https://api.peopledatalabs.com/v5/person/retrieve"

person_id = "qEnOZ5Oh0poWnQ1luFBfVw_0000" # The ID for the record we want

params = {
    "api_key": API_KEY,
    "pretty": True
}

url_path = f"{pdl_base_url}/{person_id}"

json_response = requests.get(url_path,  params=params).json()
print(json_response)
curl -X GET -G \
  'https://api.peopledatalabs.com/v5/person/retrieve/qEnOZ5Oh0poWnQ1luFBfVw_0000'\
  -H 'X-Api-Key: xxxx' \
  --data-urlencode 'pretty=True'

Record Updating

"I have a PDL record and I want to update it"

import requests, json

API_KEY = # YOUR API KEY

pdl_base_url = "https://api.peopledatalabs.com/v5/person/retrieve"

stale_person_record = {} # Replace this with your stale person record


person_id = stale_person_record['id'] # The ID for the record we want to update

params = {
    "api_key": API_KEY
}

url_path = f"{pdl_base_url}/{person_id}"

json_response = requests.get(url_path,  params=params).json()

new_person_record = {
    json_response['data']['key'] for key in json_response['data'].keys() if key in stale_person_record
}

Did this page help you?