Authentication

Authentication

There are three ways to authenticate requests to v5 of the APIs:

In URL

import requests

API_KEY = # YOUR API KEY

pdl_url = "https://api.peopledatalabs.com/v5/person/enrich?api_key={}".format(API_KEY)

json_response = requests.get(pdl_url).json()
curl -X GET \
  'https://api.peopledatalabs.com/v5/person/enrich?api_key=xxxx'

In Header

import requests

API_KEY = # YOUR API KEY

pdl_url = "https://api.peopledatalabs.com/v5/person/enrich"

headers = {
    "X-Api-Key": API_KEY
}

json_response = requests.get(pdl_url,  headers=headers).json()
curl -X GET \
  'https://api.peopledatalabs.com/v5/person/enrich' \ 
  -H 'X-Api-Key: xxxx'

In SDKs

# 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 = {
    "company": ["Hallspot", "People Data Labs"],
    "email": ["[email protected]"]
}

response = client.person.enrichment(**params)

print(response.text)
// See https://github.com/peopledatalabs/peopledatalabs-js
import PDLJS from 'peopledatalabs';

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

const params = {
    company: "Hallspot",
    company: "People Data Labs",
    email: "[email protected]"
}

PDLJSClient.person.enrichment(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 = {
    "company": ["Hallspot", "People Data Labs"],
    "email": ["[email protected]"]
}

response = Peopledatalabs::Enrichment.person(params: params)

puts response

Requests made with an invalid API Key will return a 401 error. If you need any assistance relating to this, or if you would like to either request a new API key or delete your existing key, please contact your account manager or reach out to us at [email protected]


Did this page help you?