Examples - Person Enrichment API

Code examples and walkthroughs using the Person Enrichment API

Examples

When using a URL, all query parameters should be separated by an ampersand (&). When using code, all request parameters should be lists.

All examples are provided in cURL, Python, Ruby, Go and JavaScript. If you aren't comfortable working in any of these languages, feel free to use this handy tool to convert from cURL to the language of your choice.

Linkedin URL

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": ["http://linkedin.com/in/seanthorne"],
    "min_likelihood": 6
}

json_response = client.person.enrichment(**params).json()

if json_response["status"] == 200:
  record = json_response['data']

  print(
    record['work_email'],
    record['full_name'],
    record['job_title'],
    record['job_company_name']
  )

  print(f"successfully enriched profile with pdl data")

  # Save enrichment data to json file
  with open("my_pdl_enrichment.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment unsuccessful. See error and try again.")
  print("error:", json_response)
curl -X GET -G \
  'https://api.peopledatalabs.com/v5/person/enrich'\
  -H 'X-Api-Key: xxxx' \
  --data-urlencode 'min_likelihood=6'\
    --data-urlencode 'profile=http://linkedin.com/in/seanthorne'
// See https://github.com/peopledatalabs/peopledatalabs-js
import PDLJS from 'peopledatalabs';

import fs from 'fs';

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

const params = {
  profile: "http://linkedin.com/in/seanthorne",
  min_likelihood: 6
}

PDLJSClient.person.enrichment(params).then((data) => {
    var record = data.data
    
    console.log(
        record["work_email"],
        record["full_name"],
        record["job_title"],
        record["job_company_name"],
        )
        
    console.log("successfully enriched profile with pdl data")
    
    fs.writeFile("my_pdl_enrichment.jsonl", Buffer.from(JSON.stringify(record)), (err) => {
        if (err) throw err;
    });
}).catch((error) => {
    console.log("Enrichment unsuccessful. See error and try again.")
    console.log(error);
});
require 'json'

# See https://github.com/peopledatalabs/peopledatalabs-ruby
require 'peopledatalabs'

Peopledatalabs.api_key = 'YOUR API KEY'

params = {
    "profile": ["http://linkedin.com/in/seanthorne"],
    "min_likelihood": 6
}

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

if json_response['status'] == 200
    record = json_response['data']
    
    puts \
        "#{record['work_email']}\
         #{record['full_name']}\
         #{record['job_title']}\
         #{record['job_company_name']}"
    
    puts "successfully enriched profile with pdl data"
    
    # Save enrichment data to json file
    File.open("my_pdl_enrichment.jsonl", "w") do |out|
        out.write(JSON.dump(record) + "\n")
    end
else
    puts "Enrichment unsuccessful. See error and try again."
    puts "error: #{json_response}"
end
package main

import (
    "fmt"
    "os"
    "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.EnrichPersonParams {
        PersonParams: pdlmodel.PersonParams {
            Profile: []string{"linkedin.com/in/seanthorne"},
        },
        AdditionalParams: pdlmodel.AdditionalParams {
            MinLikelihood: 6,
        },
    }

    response, err := client.Person.Enrich(params)
    
    if err == nil {
        jsonResponse, jsonErr := json.Marshal(response.Data)
        if jsonErr == nil {
            var record map[string]interface{}
            json.Unmarshal(jsonResponse, &record)
            fmt.Println(
                       record["work_email"], 
                       record["full_name"], 
                       record["job_title"], 
                       record["job_company_name"])
        
            fmt.Println("successfully enriched profile with pdl data")
        
            // Save enrichment data to json file
            out, outErr := os.Create("my_pdl_enrichment.jsonl")
            defer out.Close()
            if outErr == nil {
                out.WriteString(string(jsonResponse) + "\n")
            }
            out.Sync()
        }
    } else {
        fmt.Println("Enrichment unsuccessful. See error and try again.")
        fmt.Println("error:", err)
    }
}
import requests, json

API_KEY = # YOUR API KEY

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

params = {
    "api_key": API_KEY,
    "profile": ["http://linkedin.com/in/seanthorne"],
    "min_likelihood": 6
}

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

if json_response["status"] == 200:
  record = json_response['data']

  print(
    record['work_email'],
    record['full_name'],
    record['job_title'],
    record['job_company_name']
  )

  print(f"successfully enriched profile with pdl data")

  # Save enrichment data to json file
  with open("my_pdl_enrichment.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment unsuccessful. See error and try again.")
  print("error:", json_response)

Email

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 = {
    "email": ["[email protected]"] 
}

json_response = client.person.enrichment(**params).json()

if json_response["status"] == 200:
  record = json_response['data']

  print(
    record['work_email'],
    record['full_name'],
    record['job_title'],
    record['job_company_name']
  )

  print(f"successfully enriched profile with pdl data")

  # Save enrichment data to json file
  with open("my_pdl_enrichment.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment unsuccessful. See error and try again.")
  print("error:", json_response)
curl -X GET -G \
  'https://api.peopledatalabs.com/v5/person/enrich' \
  -H 'X-Api-Key: xxxx' \
  --data-urlencode '[email protected]'
// See https://github.com/peopledatalabs/peopledatalabs-js
import PDLJS from 'peopledatalabs';

import fs from 'fs';

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

const params = {
  email: "[email protected]"
}

PDLJSClient.person.enrichment(params).then((data) => {
    var record = data.data
    
    console.log(
        record["work_email"],
        record["full_name"],
        record["job_title"],
        record["job_company_name"],
        )
        
    console.log("successfully enriched profile with pdl data")
    
    fs.writeFile("my_pdl_enrichment.jsonl", Buffer.from(JSON.stringify(record)), (err) => {
        if (err) throw err;
    });
}).catch((error) => {
    console.log("Enrichment unsuccessful. See error and try again.")
    console.log(error);
});
require 'json'

# See https://github.com/peopledatalabs/peopledatalabs-ruby
require 'peopledatalabs'

Peopledatalabs.api_key = 'YOUR API KEY'

params = {
    "email": ["[email protected]"] 
}

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

if json_response['status'] == 200
    record = json_response['data']
    
    puts \
        "#{record['work_email']}\
        #{record['full_name']}\
        #{record['job_title']}\
        #{record['job_company_name']}"
    
    puts "successfully enriched profile with pdl data"
    
    # Save enrichment data to json file
    File.open("my_pdl_enrichment.jsonl", "w") do |out|
        out.write(JSON.dump(record) + "\n")
    end
else
    puts "Enrichment unsuccessful. See error and try again."
    puts "error: #{json_response}"
end
package main

import (
    "fmt"
    "os"
    "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.EnrichPersonParams {
        PersonParams: pdlmodel.PersonParams {
            Email: []string{"[email protected]"},
        },
    }

    response, err := client.Person.Enrich(params)
    
    if err == nil {
        jsonResponse, jsonErr := json.Marshal(response.Data)
        if jsonErr == nil {
            var record map[string]interface{}
            json.Unmarshal(jsonResponse, &record)
            fmt.Println(
                       record["work_email"], 
                       record["full_name"], 
                       record["job_title"], 
                       record["job_company_name"])
        
            fmt.Println("successfully enriched profile with pdl data")
        
            // Save enrichment data to json file
            out, outErr := os.Create("my_pdl_enrichment.jsonl")
            defer out.Close()
            if outErr == nil {
                out.WriteString(string(jsonResponse) + "\n")
            }
            out.Sync()
        }
    } else {
        fmt.Println("Enrichment unsuccessful. See error and try again.")
        fmt.Println("error:", err)
    }
}
import requests, json

API_KEY = # YOUR API KEY

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

params = {
    "api_key": API_KEY,
    "email": ["[email protected]"]   
}

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

if json_response["status"] == 200:
  record = json_response['data']

  print(
    record['work_email'],
    record['full_name'],
    record['job_title'],
    record['job_company_name']
  )

  print(f"successfully enriched profile with pdl data")

  # Save enrichment data to json file
  with open("my_pdl_enrichment.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment unsuccessful. See error and try again.")
  print("error:", json_response)

Email Hash

Note: you can use MD5 or SHA-256 hashes.

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 = {
    "email_hash": ["e206e6cd7fa5f9499fd6d2d943dcf7d9c1469bad351061483f5ce7181663b8d4"]
}

json_response = client.person.enrichment(**params).json()

if json_response["status"] == 200:
  record = json_response['data']

  print(
    record['work_email'],
    record['full_name'],
    record['job_title'],
    record['job_company_name']
  )

  print(f"successfully enriched profile with pdl data")

  # Save enrichment data to json file
  with open("my_pdl_enrichment.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment unsuccessful. See error and try again.")
  print("error:", json_response)
curl -X GET -G \
  'https://api.peopledatalabs.com/v5/person/enrich' \
  -H 'X-Api-Key: xxxx' \
  --data-urlencode 'email_hash=e206e6cd7fa5f9499fd6d2d943dcf7d9c1469bad351061483f5ce7181663b8d4'
// See https://github.com/peopledatalabs/peopledatalabs-js
import PDLJS from 'peopledatalabs';

import fs from 'fs';

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

const params = {
  email_hash: "e206e6cd7fa5f9499fd6d2d943dcf7d9c1469bad351061483f5ce7181663b8d4"
}

PDLJSClient.person.enrichment(params).then((data) => {
    var record = data.data
    
    console.log(
        record["work_email"],
        record["full_name"],
        record["job_title"],
        record["job_company_name"],
        )
        
    console.log("successfully enriched profile with pdl data")
    
    fs.writeFile("my_pdl_enrichment.jsonl", Buffer.from(JSON.stringify(record)), (err) => {
        if (err) throw err;
    });
}).catch((error) => {
    console.log("Enrichment unsuccessful. See error and try again.")
    console.log(error);
});
require 'json'

# See https://github.com/peopledatalabs/peopledatalabs-ruby
require 'peopledatalabs'

Peopledatalabs.api_key = 'YOUR API KEY'

params = {
    "email_hash": ["e206e6cd7fa5f9499fd6d2d943dcf7d9c1469bad351061483f5ce7181663b8d4"]
}

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

if json_response['status'] == 200
    record = json_response['data']
    
    puts \
        "#{record['work_email']}\
        #{record['full_name']}\
        #{record['job_title']}\
        #{record['job_company_name']}"
    
    puts "successfully enriched profile with pdl data"
    
    # Save enrichment data to json file
    File.open("my_pdl_enrichment.jsonl", "w") do |out|
        out.write(JSON.dump(record) + "\n")
    end
else
    puts "Enrichment unsuccessful. See error and try again."
    puts "error: #{json_response}"
end
package main

import (
    "fmt"
    "os"
    "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.EnrichPersonParams {
        PersonParams: pdlmodel.PersonParams {
            EmailHash: []string{"e206e6cd7fa5f9499fd6d2d943dcf7d9c1469bad351061483f5ce7181663b8d4"},
        },
    }

    response, err := client.Person.Enrich(params)
    
    if err == nil {
        jsonResponse, jsonErr := json.Marshal(response.Data)
        if jsonErr == nil {
            var record map[string]interface{}
            json.Unmarshal(jsonResponse, &record)
            fmt.Println(
                       record["work_email"], 
                       record["full_name"], 
                       record["job_title"], 
                       record["job_company_name"])
        
            fmt.Println("successfully enriched profile with pdl data")
        
            // Save enrichment data to json file
            out, outErr := os.Create("my_pdl_enrichment.jsonl")
            defer out.Close()
            if outErr == nil {
                out.WriteString(string(jsonResponse) + "\n")
            }
            out.Sync()
        }
    } else {
        fmt.Println("Enrichment unsuccessful. See error and try again.")
        fmt.Println("error:", err)
    }
}
import requests, json

API_KEY = # YOUR API KEY

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

params = {
    "api_key": API_KEY,
    "email_hash": ["e206e6cd7fa5f9499fd6d2d943dcf7d9c1469bad351061483f5ce7181663b8d4"]   
}

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

if json_response["status"] == 200:
  record = json_response['data']

  print(
    record['work_email'],
    record['full_name'],
    record['job_title'],
    record['job_company_name']
  )

  print(f"successfully enriched profile with pdl data")

  # Save enrichment data to json file
  with open("my_pdl_enrichment.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment unsuccessful. See error and try again.")
  print("error:", json_response)

Email and Company

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

json_response = client.person.enrichment(**params).json()

if json_response["status"] == 200:
  record = json_response['data']

  print(
    record['work_email'],
    record['full_name'],
    record['job_title'],
    record['job_company_name']
  )

  print(f"successfully enriched profile with pdl data")

  # Save enrichment data to json file
  with open("my_pdl_enrichment.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment unsuccessful. See error and try again.")
  print("error:", json_response)
curl -X GET -G \
  'https://api.peopledatalabs.com/v5/person/enrich'\
  -H 'X-Api-Key: xxxx' \
  --data-urlencode 'company=People Data Labs'\
    --data-urlencode 'company=Hallspot'\
  --data-urlencode '[email protected]'
// See https://github.com/peopledatalabs/peopledatalabs-js
import PDLJS from 'peopledatalabs';

import fs from 'fs';

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) => {
    var record = data.data
    
    console.log(
        record["work_email"],
        record["full_name"],
        record["job_title"],
        record["job_company_name"],
        )
        
    console.log("successfully enriched profile with pdl data")
    
    fs.writeFile("my_pdl_enrichment.jsonl", Buffer.from(JSON.stringify(record)), (err) => {
        if (err) throw err;
    });
}).catch((error) => {
    console.log("Enrichment unsuccessful. See error and try again.")
    console.log(error);
});
require 'json'

# See https://github.com/peopledatalabs/peopledatalabs-ruby
require 'peopledatalabs'

Peopledatalabs.api_key = 'YOUR API KEY'

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

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

if json_response['status'] == 200
    record = json_response['data']
    
    puts \
        "#{record['work_email']}\
        #{record['full_name']}\
        #{record['job_title']}\
        #{record['job_company_name']}"
    
    puts "successfully enriched profile with pdl data"
    
    # Save enrichment data to json file
    File.open("my_pdl_enrichment.jsonl", "w") do |out|
        out.write(JSON.dump(record) + "\n")
    end
else
    puts "Enrichment unsuccessful. See error and try again."
    puts "error: #{json_response}"
end
package main

import (
    "fmt"
    "os"
    "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.EnrichPersonParams {
        PersonParams: pdlmodel.PersonParams {
            Company: []string{"Hallspot", "People Data Labs"},
            Email: []string{"[email protected]"},
        },
    }

    response, err := client.Person.Enrich(params)
    
    if err == nil {
        jsonResponse, jsonErr := json.Marshal(response.Data)
        if jsonErr == nil {
            var record map[string]interface{}
            json.Unmarshal(jsonResponse, &record)
            fmt.Println(
                       record["work_email"], 
                       record["full_name"], 
                       record["job_title"], 
                       record["job_company_name"])
        
            fmt.Println("successfully enriched profile with pdl data")
        
            // Save enrichment data to json file
            out, outErr := os.Create("my_pdl_enrichment.jsonl")
            defer out.Close()
            if outErr == nil {
                out.WriteString(string(jsonResponse) + "\n")
            }
            out.Sync()
        }
    } else {
        fmt.Println("Enrichment unsuccessful. See error and try again.")
        fmt.Println("error:", err)
    }
}
import requests, json

API_KEY = # YOUR API KEY

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

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

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

if json_response["status"] == 200:
  record = json_response['data']

  print(
    record['work_email'],
    record['full_name'],
    record['job_title'],
    record['job_company_name']
  )

  print(f"successfully enriched profile with pdl data")

  # Save enrichment data to json file
  with open("my_pdl_enrichment.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment unsuccessful. See error and try again.")
  print("error:", json_response)

Name and Company and School

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 = {
    "company": ["TalentIQ Technologies"],   
    "first_name": ["Sean"],
    "last_name": ["Thorne"],
    "school": ["University of Oregon"]
}

json_response = client.person.enrichment(**params).json()

if json_response["status"] == 200:
  record = json_response['data']

  print(
    record['work_email'],
    record['full_name'],
    record['job_title'],
    record['job_company_name']
  )

  print(f"successfully enriched profile with pdl data")

  # Save enrichment data to json file
  with open("my_pdl_enrichment.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment unsuccessful. See error and try again.")
  print("error:", json_response)
curl -X GET -G \
  'https://api.peopledatalabs.com/v5/person/enrich' \
  -H 'X-Api-Key: xxxx' \
  --data-urlencode 'company=TalentIQ Technologies' \
  --data-urlencode 'first_name=Sean' \
  --data-urlencode 'last_name=Thorne' \
  --data-urlencode 'school=University of Oregon'
// See https://github.com/peopledatalabs/peopledatalabs-js
import PDLJS from 'peopledatalabs';

import fs from 'fs';

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

const params = {
  company: "TalentIQ Technologies",
  first_name: "Sean",
  last_name: "Thorne",
  school: "University of Oregon"
}

PDLJSClient.person.enrichment(params).then((data) => {
    var record = data.data
    
    console.log(
        record["work_email"],
        record["full_name"],
        record["job_title"],
        record["job_company_name"],
        )
        
    console.log("successfully enriched profile with pdl data")
    
    fs.writeFile("my_pdl_enrichment.jsonl", Buffer.from(JSON.stringify(record)), (err) => {
        if (err) throw err;
    });
}).catch((error) => {
    console.log("Enrichment unsuccessful. See error and try again.")
    console.log(error);
});
require 'json'

# See https://github.com/peopledatalabs/peopledatalabs-ruby
require 'peopledatalabs'

Peopledatalabs.api_key = 'YOUR API KEY'

params = {
    "company": ["TalentIQ Technologies"],   
    "first_name": ["Sean"],
    "last_name": ["Thorne"],
    "school": ["University of Oregon"]
}

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

if json_response['status'] == 200
    record = json_response['data']
    
    puts \
        "#{record['work_email']}\
        #{record['full_name']}\
        #{record['job_title']}\
        #{record['job_company_name']}"
    
    puts "successfully enriched profile with pdl data"
    
    # Save enrichment data to json file
    File.open("my_pdl_enrichment.jsonl", "w") do |out|
        out.write(JSON.dump(record) + "\n")
    end
else
    puts "Enrichment unsuccessful. See error and try again."
    puts "error: #{json_response}"
end
package main

import (
    "fmt"
    "os"
    "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.EnrichPersonParams {
        PersonParams: pdlmodel.PersonParams {
            Company: []string{"TalentIQ Technologies"},
            FirstName: []string{"Sean"},
            LastName: []string{"Thorne"},
            School: []string{"University of Oregon"},
        },
    }

    response, err := client.Person.Enrich(params)
    
    if err == nil {
        jsonResponse, jsonErr := json.Marshal(response.Data)
        if jsonErr == nil {
            var record map[string]interface{}
            json.Unmarshal(jsonResponse, &record)
            fmt.Println(
                       record["work_email"], 
                       record["full_name"], 
                       record["job_title"], 
                       record["job_company_name"])
        
            fmt.Println("successfully enriched profile with pdl data")
        
            // Save enrichment data to json file
            out, outErr := os.Create("my_pdl_enrichment.jsonl")
            defer out.Close()
            if outErr == nil {
                out.WriteString(string(jsonResponse) + "\n")
            }
            out.Sync()
        }
    } else {
        fmt.Println("Enrichment unsuccessful. See error and try again.")
        fmt.Println("error:", err)
    }
}
import requests, json

API_KEY = # YOUR API KEY

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

params = {
    "api_key": API_KEY,
    "company": ["TalentIQ Technologies"],   
    "first_name": ["Sean"],
    "last_name": ["Thorne"],
    "school": ["University of Oregon"]
}

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

if json_response["status"] == 200:
  record = json_response['data']

  print(
    record['work_email'],
    record['full_name'],
    record['job_title'],
    record['job_company_name']
  )

  print(f"successfully enriched profile with pdl data")

  # Save enrichment data to json file
  with open("my_pdl_enrichment.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment unsuccessful. See error and try again.")
  print("error:", json_response)

Name and Location and Twitter and Phone

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 = {
    "name": ["Sean Thorne"],   
    "location": ["SF Bay Area"],
    "profile": ["www.twitter.com/seanthorne5"],
    "phone": ["+15555091234"]
}

json_response = client.person.enrichment(**params).json()

if json_response["status"] == 200:
  record = json_response['data']

  print(
    record['work_email'],
    record['full_name'],
    record['job_title'],
    record['job_company_name']
  )

  print(f"successfully enriched profile with pdl data")

  # Save enrichment data to json file
  with open("my_pdl_enrichment.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment unsuccessful. See error and try again.")
  print("error:", json_response)
curl -X GET -G \
  'https://api.peopledatalabs.com/v5/person/enrich' \
  -H 'X-Api-Key: xxxx' \
  --data-urlencode 'name=Sean Thorne' \
  --data-urlencode 'location=SF Bay Area' \
  --data-urlencode 'profile=www.twitter.com/seanthorne5' \
  --data-urlencode 'phone=+15555091234'
// See https://github.com/peopledatalabs/peopledatalabs-js
import PDLJS from 'peopledatalabs';

import fs from 'fs';

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

const params = {
  name: "Sean Thorne",
  location: "SF Bay Area",
  profile: "www.twitter.com/seanthorne5",
  phone: "+15555091234"
}

PDLJSClient.person.enrichment(params).then((data) => {
    var record = data.data
    
    console.log(
        record["work_email"],
        record["full_name"],
        record["job_title"],
        record["job_company_name"],
        )
        
    console.log("successfully enriched profile with pdl data")
    
    fs.writeFile("my_pdl_enrichment.jsonl", Buffer.from(JSON.stringify(record)), (err) => {
        if (err) throw err;
    });
}).catch((error) => {
    console.log("Enrichment unsuccessful. See error and try again.")
    console.log(error);
});
require 'json'

# See https://github.com/peopledatalabs/peopledatalabs-ruby
require 'peopledatalabs'

Peopledatalabs.api_key = 'YOUR API KEY'

params = {
    "name": ["Sean Thorne"],   
    "location": ["SF Bay Area"],
    "profile": ["www.twitter.com/seanthorne5"],
    "phone": ["+15555091234"]
}

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

if json_response['status'] == 200
    record = json_response['data']
    
    puts \
        "#{record['work_email']}\
        #{record['full_name']}\
        #{record['job_title']}\
        #{record['job_company_name']}"
    
    puts "successfully enriched profile with pdl data"
    
    # Save enrichment data to json file
    File.open("my_pdl_enrichment.jsonl", "w") do |out|
        out.write(JSON.dump(record) + "\n")
    end
else
    puts "Enrichment unsuccessful. See error and try again."
    puts "error: #{json_response}"
end
package main

import (
    "fmt"
    "os"
    "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.EnrichPersonParams {
        PersonParams: pdlmodel.PersonParams {
            Name: []string{"Sean Thorne"},
            Location: []string{"SF Bay Area"},
            Profile: []string{"www.twitter.com/seanthorne5"},
            Phone: []string{"+15555091234"},
        },
    }

    response, err := client.Person.Enrich(params)
    
    if err == nil {
        jsonResponse, jsonErr := json.Marshal(response.Data)
        if jsonErr == nil {
            var record map[string]interface{}
            json.Unmarshal(jsonResponse, &record)
            fmt.Println(
                       record["work_email"], 
                       record["full_name"], 
                       record["job_title"], 
                       record["job_company_name"])
        
            fmt.Println("successfully enriched profile with pdl data")
        
            // Save enrichment data to json file
            out, outErr := os.Create("my_pdl_enrichment.jsonl")
            defer out.Close()
            if outErr == nil {
                out.WriteString(string(jsonResponse) + "\n")
            }
            out.Sync()
        }
    } else {
        fmt.Println("Enrichment unsuccessful. See error and try again.")
        fmt.Println("error:", err)
    }
}
import requests, json

API_KEY = # YOUR API KEY

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

params = {
    "api_key": API_KEY,
    "name": ["Sean Thorne"],   
    "location": ["SF Bay Area"],
    "profile": ["www.twitter.com/seanthorne5"],
    "phone": ["+15555091234"]
}

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

if json_response["status"] == 200:
  record = json_response['data']

  print(
    record['work_email'],
    record['full_name'],
    record['job_title'],
    record['job_company_name']
  )

  print(f"successfully enriched profile with pdl data")

  # Save enrichment data to json file
  with open("my_pdl_enrichment.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment unsuccessful. See error and try again.")
  print("error:", json_response)

Multiple Values for the Same Parameter

Most parameters can take multiple values. To do so, append the parameter with values as many times as needed. The only parameters that cannot exist multiple times are locality, region, country and street_address, as these are linearly related and multiple inputs would make it impossible to match. To match multiple locations, use the location parameter.

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 = {
    "name": ["Sean Thorne"],    
    "profile": ["www.twitter.com/seanthorne5", "linkedin.com/in/seanthorne"]
}

json_response = client.person.enrichment(**params).json()

if json_response["status"] == 200:
  record = json_response['data']

  print(
    record['work_email'],
    record['full_name'],
    record['job_title'],
    record['job_company_name']
  )

  print(f"successfully enriched profile with pdl data")

  # Save enrichment data to json file
  with open("my_pdl_enrichment.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment unsuccessful. See error and try again.")
  print("error:", json_response)
curl -X GET -G \
  'https://api.peopledatalabs.com/v5/person/enrich' \
  -H 'X-Api-Key: xxxx' \
  --data-urlencode 'name=Sean Thorne' \
  --data-urlencode 'profile=www.twitter.com/seanthorne5' \
  --data-urlencode 'profile=linkedin.com/in/seanthorne'
// See https://github.com/peopledatalabs/peopledatalabs-js
import PDLJS from 'peopledatalabs';

import fs from 'fs';

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

const params = {
  name: "Sean Thorne",
  profile: "www.twitter.com/seanthorne5",
  profile: "linkedin.com/in/seanthorne"
}

PDLJSClient.person.enrichment(params).then((data) => {
    var record = data.data
    
    console.log(
        record["work_email"],
        record["full_name"],
        record["job_title"],
        record["job_company_name"],
        )
        
    console.log("successfully enriched profile with pdl data")
    
    fs.writeFile("my_pdl_enrichment.jsonl", Buffer.from(JSON.stringify(record)), (err) => {
        if (err) throw err;
    });
}).catch((error) => {
    console.log("Enrichment unsuccessful. See error and try again.")
    console.log(error);
});
require 'json'

# See https://github.com/peopledatalabs/peopledatalabs-ruby
require 'peopledatalabs'

Peopledatalabs.api_key = 'YOUR API KEY'

params = {
    "name": ["Sean Thorne"],    
    "profile": ["www.twitter.com/seanthorne5", "linkedin.com/in/seanthorne"]
}

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

if json_response['status'] == 200
    record = json_response['data']
    
    puts \
        "#{record['work_email']}\
        #{record['full_name']}\
        #{record['job_title']}\
        #{record['job_company_name']}"
    
    puts "successfully enriched profile with pdl data"
    
    # Save enrichment data to json file
    File.open("my_pdl_enrichment.jsonl", "w") do |out|
        out.write(JSON.dump(record) + "\n")
    end
else
    puts "Enrichment unsuccessful. See error and try again."
    puts "error: #{json_response}"
end
package main

import (
    "fmt"
    "os"
    "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.EnrichPersonParams {
        PersonParams: pdlmodel.PersonParams {
            Name: []string{"Sean Thorne"},
            Profile: []string{"www.twitter.com/seanthorne5", "linkedin.com/in/seanthorne"},
        },
    }

    response, err := client.Person.Enrich(params)
    
    if err == nil {
        jsonResponse, jsonErr := json.Marshal(response.Data)
        if jsonErr == nil {
            var record map[string]interface{}
            json.Unmarshal(jsonResponse, &record)
            fmt.Println(
                       record["work_email"], 
                       record["full_name"], 
                       record["job_title"], 
                       record["job_company_name"])
        
            fmt.Println("successfully enriched profile with pdl data")
        
            // Save enrichment data to json file
            out, outErr := os.Create("my_pdl_enrichment.jsonl")
            defer out.Close()
            if outErr == nil {
                out.WriteString(string(jsonResponse) + "\n")
            }
            out.Sync()
        }
    } else {
        fmt.Println("Enrichment unsuccessful. See error and try again.")
        fmt.Println("error:", err)
    }
}
import requests, json

API_KEY = # YOUR API KEY

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

params = {
    "api_key": API_KEY,
    "name": ["Sean Thorne"],    
    "profile": ["www.twitter.com/seanthorne5", "linkedin.com/in/seanthorne"]
}

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

if json_response["status"] == 200:
  record = json_response['data']

  print(
    record['work_email'],
    record['full_name'],
    record['job_title'],
    record['job_company_name']
  )

  print(f"successfully enriched profile with pdl data")

  # Save enrichment data to json file
  with open("my_pdl_enrichment.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment unsuccessful. See error and try again.")
  print("error:", json_response)

Did this page help you?