Official Go client for the People Data Labs API.
go get github.com/peopledatalabs/peopledatalabs-go/v3
First, create the PeopleDataLabs client:
package main
import (
pdl "github.com/peopledatalabs/peopledatalabs-go/v3"
pdlmodel "github.com/peopledatalabs/peopledatalabs-go/v3/model"
)
func main() {
apiKey := "YOUR_API_KEY_HERE"
// Set API KEY as env variable
// apiKey := os.Getenv("API_KEY")
client := pdl.New(apiKey)
}
Then, send requests to any PDL API Endpoint.
params := pdlmodel.EnrichPersonParams{
PersonParams: pdlmodel.PersonParams{
Phone: []string{"4155688415"},
},
}
result, err := client.Person.Enrich(ctx, params)
if err == nil {
fmt.Printf("Status: %d, FullName: %s\n", result.Status, result.Data.FullName)
}
params := pdlmodel.BulkEnrichPersonParams{
BaseParams: model.BaseParams{Pretty: true},
AdditionalParams: model.AdditionalParams{MinLikelihood: 6, IncludeIfMatched: true, Required: "full_name"},
Requests: []pdlmodel.BulkEnrichSinglePersonParams{
{
Params: pdlmodel.PersonParams{
Profile: []string{"linkedin.com/in/seanthorne"},
Location: []string{"SF Bay Area"},
Name: []string{"Sean F. Thorne"},
},
},
{
Params: pdlmodel.PersonParams{
Profile: []string{"https://www.linkedin.com/in/haydenconrad/"},
FirstName: []string{"Hayden"},
LastName: []string{"Conrad"},
},
},
},
}
result, err := client.Person.BulkEnrich(ctx, params)
elasticSearchQuery := map[string]interface{}{
"query": map[string]interface{}{
"bool": map[string]interface{}{
"must": []map[string]interface{}{
{"term": map[string]interface{}{"location_country": "mexico"}},
{"term": map[string]interface{}{"job_title_role": "health"}},
},
},
},
}
params := pdlmodel.SearchParams{
BaseParams: pdlmodel.BaseParams{
Size: 10,
},
SearchBaseParams: pdlmodel.SearchBaseParams{
Query: elasticSearchQuery,
Dataset: "phone,mobile_phone",
},
}
result, err := client.Person.Search(ctx, params)
sqlQuery := "SELECT * FROM person" +
" WHERE location_country='mexico'" +
" AND job_title_role='health'" +
" AND phone_numbers IS NOT NULL;"
params := pdlmodel.SearchParams{
BaseParams: pdlmodel.BaseParams{
Size: 10,
},
SearchBaseParams: pdlmodel.SearchBaseParams{
SQL: sqlQuery,
Dataset: "phone,mobile_phone",
},
}
result, err := client.Person.Search(ctx, params)
PDL_ID
(Retrieve API)params := pdlmodel.RetrievePersonParams{PersonID: "qEnOZ5Oh0poWnQ1luFBfVw_0000"}
result, err := client.Person.Retrieve(ctx, params)
params := pdlmodel.BulkRetrievePersonParams{
Requests: []pdlmodel.BulkRetrieveSinglePersonParams{
{ID: "qEnOZ5Oh0poWnQ1luFBfVw_0000"},
{ID: "PzFD15NINdBWNULBBkwlig_0000"},
}
}
result, err := client.Person.BulkRetrieve(ctx, params)
params := pdlmodel.IdentifyPersonParams{PersonParams: pdlmodel.PersonParams{Name: []string{"sean thorne"}}}
result, err := client.Person.Identify(ctx, params)
params := pdlmodel.EnrichCompanyParams{
CompanyParams: pdlmodel.CompanyParams{Website: "peopledatalabs.com"},
}
result, err := client.Company.Enrich(ctx, params)
params := pdlmodel.BulkEnrichCompanyParams{
BaseParams: model.BaseParams{Pretty: true},
Requests: []pdlmodel.BulkEnrichSingleCompanyParams{
{
Params: pdlmodel.CompanyParams{
Profile: "linkedin.com/company/peopledatalabs",
},
},
{
Params: pdlmodel.CompanyParams{
Profile: "https://www.linkedin.com/company/apple/",
},
},
},
}
result, err := client.Company.BulkEnrich(ctx, params)
elasticSearchQuery := map[string]interface{}{
"query": map[string]interface{}{
"bool": map[string]interface{}{
"must": []map[string]interface{}{
{"term": map[string]interface{}{"tags": "bigdata"}},
{"term": map[string]interface{}{"industry": "financial services"}},
{"term": map[string]interface{}{"location.country": "united states"}},
},
},
},
}
params := pdlmodel.SearchParams{
BaseParams: pdlmodel.BaseParams{Size: 10},
SearchBaseParams: pdlmodel.SearchBaseParams{Query: elasticSearchQuery},
}
result, err := client.Company.Search(ctx, params)
sqlQuery := "SELECT * FROM company" +
" WHERE tags='big data'" +
" AND industry='financial services'" +
" AND location.country='united states';"
params := pdlmodel.SearchParams{
BaseParams: pdlmodel.BaseParams{Size: 10},
SearchBaseParams: pdlmodel.SearchBaseParams{SQL: sqlQuery},
}
result, err := client.Company.Search(ctx, params)
params := pdlmodel.AutocompleteParams{
BaseParams: pdlmodel.BaseParams{Size: 10},
AutocompleteBaseParams: pdlmodel.AutocompleteBaseParams{Field: "title", Text: "full"},
}
result, err := client.Autocomplete(ctx, params)
params := pdlmodel.CleanCompanyParams{Name: "peOple DaTa LabS"}
result, err := client.Company.Clean(ctx, params)
params := pdlmodel.CleanLocationParams{
LocationParams: pdlmodel.LocationParams{
Location: "455 Market Street, San Francisco, California 94105, US",
},
}
result, err := client.Location.Clean(ctx, params)
params := pdlmodel.CleanSchoolParams{
SchoolParams: pdlmodel.SchoolParams{Name: "university of oregon"},
}
result, err := client.School.Clean(ctx, params)
params := model.JobTitleParams{
BaseParams: model.BaseParams{Pretty: true},
JobTitleBaseParams: model.JobTitleBaseParams{JobTitle: "data scientist"},
}
result, err := client.JobTitle(ctx, params)
params := model.SkillParams{
BaseParams: model.BaseParams{Pretty: true},
SkillBaseParams: model.SkillBaseParams{Skill: "c++"},
}
result, err := client.Skill(ctx, params)
params := model.IPParams{
BaseParams: model.BaseParams{Pretty: true},
IPBaseParams: model.IPBaseParams{IP: "72.212.42.169"},
}
result, err := client.IP(ctx, params)
# To enable sandbox usage, use the following
import (
pdl "github.com/peopledatalabs/peopledatalabs-go/v3"
"github.com/peopledatalabs/peopledatalabs-go/v3/api"
pdlmodel "github.com/peopledatalabs/peopledatalabs-go/v3/model"
)
client := pdl.New(apiKey, api.ClientOptions(func(c *api.Client) {
c.Sandbox = true
}))
Person Endpoints
API Endpoint | SDK Function |
---|---|
Person Enrichment API | client.Person.Enrich(params) |
Person Bulk Enrichment API | client.Person.BulkEnrich(params) |
Person Search API | client.Person.Search(params) |
Person Retrieve API | client.Person.Retrieve(params) |
Person Bulk Retrieve API | client.Person.BulkRetrieve(params) |
Person Identify API | client.Person.Identify(params) |
Company Endpoints
API Endpoint | SDK Function |
---|---|
Company Enrichment API | client.Company.Enrich(params) |
Company Bulk Enrichment API | client.Company.BulkEnrich(params) |
Company Search API | client.Company.Search(params) |
Supporting Endpoints
API Endpoint | SDK Function |
---|---|
Autocomplete API | client.Autocomplete(params) |
Company Cleaner API | client.Company.Clean(params) |
Location Cleaner API | client.Location.Clean(params) |
School Cleaner API | client.School.Clean(params) |
Job Title Enrichment API | client.JobTitle(params) |
Skill Enrichment API | client.Skill(params) |
IP Enrichment API | client.IP(params) |
All of our API endpoints are documented at: https://docs.peopledatalabs.com/
These docs describe the supported input parameters, output responses and also provide additional technical context.
As illustrated in the Endpoints section above, each of our API endpoints is mapped to a specific method in the API Client. For each of these class methods, all function inputs are mapped as input parameters to the respective API endpoint, meaning that you can use the API documentation linked above to determine the input parameters for each endpoint.