Quickstart - Cleaner APIs
Getting Started
In order to use one of our Cleaner APIs, you must have an active API key. You can look up your API key by logging into our self-serve dashboard and going to the API Keys section.
Need an API Key?
If you don't have an API key, you can easily create one by signing up for a self-serve account. For more information, check out our Self-Serve Quickstart Guide, which walks you through the sign-up process as well as shows you how to use the self-serve API dashboard.
Simple Example
As mentioned in the Overview, the Cleaner APIs are a means of cleaning company, school and location data in order to get the best results from your API queries. To use the Cleaner APIs, you will need a set of input parameters for the particular Cleaner API that you are using.
Here's a quick example that demonstrates cleaning a company record with a website
of peopledatalabs.com
:
# See https://github.com/peopledatalabs/peopledatalabs-python
from peopledatalabs import PDLPY
# Create a client, specifying your API key
CLIENT = PDLPY(
api_key="YOUR API KEY",
)
# Create a parameters JSON object
QUERY_STRING = {"website":"peopledatalabs.com"}
# Pass the parameters object to the Company Cleaner API
response = CLIENT.company.cleaner(**QUERY_STRING)
# Print the API response
print(response.text)
// See https://github.com/peopledatalabs/peopledatalabs-js
import PDLJS from 'peopledatalabs';
// Create a client, specifying your API key
const PDLJSClient = new PDLJS({ apiKey: "YOUR API KEY" });
// Create a parameters JSON object
const queryString = {
website: "peopledatalabs.com"
}
// Pass the parameters object to the Company Cleaner API
PDLJSClient.company.cleaner(queryString).then((response) => {
// Print the API response
console.log(response);
}).catch((error) => {
console.log(error);
});
# See https://github.com/peopledatalabs/peopledatalabs-ruby
require 'peopledatalabs'
# Set your API key
Peopledatalabs.api_key = 'YOUR API KEY'
# Pass parameters to the Company Cleaner API
response = Peopledatalabs::Cleaner.company(kind: 'website', value: "peopledatalabs.com")
# Print the API response
puts response
package main
import (
"fmt"
"context"
)
// See https://github.com/peopledatalabs/peopledatalabs-go
import (
pdl "github.com/peopledatalabs/peopledatalabs-go"
pdlmodel "github.com/peopledatalabs/peopledatalabs-go/model"
)
func main() {
// Set your API key
apiKey := "YOUR API KEY"
// Set API key as environmental variable
// apiKey := os.Getenv("API_KEY")
// Create a client, specifying your API key
client := pdl.New(apiKey)
// Create a parameters JSON object
queryString := pdlmodel.CleanCompanyParams{Website: "peopledatalabs.com"}
// Pass the parameters object to the Company Cleaner API
response, err := client.Company.Clean(context.Background(), queryString)
// Check for successful response
if err == nil {
// Print the API response
fmt.Println(response)
}
}
import requests
# Set your API key
API_KEY = "YOUR API KEY"
# Set the Company Cleaner API URL
PDL_URL = "https://api.peopledatalabs.com/v5/company/clean"
# Create a parameters JSON object
QUERY_STRING = {"website":"peopledatalabs.com"}
# Set headers
HEADERS = {
'accept': "application/json",
'content-type': "application/json",
'x-api-key': API_KEY
}
# Pass the parameters object to the Company Cleaner API
response = requests.request("GET", PDL_URL, headers=HEADERS, params=QUERY_STRING)
# Print the API response
print(response.text)
The response that the API returns is a cleaned company profile if the input parameters passed to it matches a record in our company dataset:
{
"status": 200,
"name": "people data labs",
"size": "11-50",
"id": "tnHcNHbCv8MKeLh92946LAkX6PKg",
"founded": 2015,
"industry": "computer software",
"location": {
"name": "san francisco, california, united states",
"locality": "san francisco",
"region": "california",
"metro": "san francisco, california",
"country": "united states",
"continent": "north america",
"street_address": "455 market street",
"address_line_2": "suite 1670",
"postal_code": "94105",
"geo": "37.77,-122.41"
},
"linkedin_url": "linkedin.com/company/peopledatalabs",
"linkedin_id": "18170482",
"facebook_url": "facebook.com/peopledatalabs",
"twitter_url": "twitter.com/peopledatalabs",
"website": "peopledatalabs.com",
"ticker": null,
"type": "private",
"raw": [],
"score": 3.0,
"fuzzy_match": false
}
If you don't get this response, check out our Errors page for more information.
Updated 2 months ago