> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peopledatalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples - Cleaner APIs

We've provided code samples 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](https://curlconverter.com/) to convert code from cURL to the language of your choice.

<Tip>
  **We want your feedback!**

  Do you see a bug? Is there an example you'd like to see that's not listed here?

  Head over to the public roadmap and submit a [bug ticket](https://peopledatalabs.canny.io/bugs) or a [feature request](https://peopledatalabs.canny.io/feature-requests) and receive automatic notifications as your bug is resolved or your request is implemented.
</Tip>

## Company Cleaner API Example

*"Show me how this company is stored in PDL based on the website."*

<CodeGroup>
  ```python Python3 SDK theme={null}
  # 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)
  ```

  ```bash cURL theme={null}
  curl -X GET -G \
    'https://api.peopledatalabs.com/v5/company/clean' \
    -H 'X-Api-Key: xxxx' \
    --data-urlencode 'website=peopledatalabs.com'
  ```

  ```javascript JavaScript theme={null}
  // 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 params = {
    website: "peopledatalabs.com"
  }

  // Pass the parameters object to the Company Cleaner API
  PDLJSClient.company.cleaner(params).then((data) => {
    // Print the API response
    console.log(data);
  }).catch((error) => {
    console.log(error);
  });
  ```

  ```ruby Ruby theme={null}
  # 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
  ```

  ```go Go theme={null}
  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
      params := pdlmodel.CleanCompanyParams {
          Website: "peopledatalabs.com",
      }
      
      // Pass the parameters object to the Company Cleaner API
      response, err := client.Company.Clean(context.Background(), params)
      // Check for successful response
      if err == nil {
          // Print the API response
          fmt.Println(response)
      }  
  }
  ```

  ```python Python3 theme={null}
  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)
  ```
</CodeGroup>

## Location Cleaner API Example

*"Show me information about this specific location."*

<CodeGroup>
  ```python Python3 SDK theme={null}
  # 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 = {"location":"239 NW 13th Ave, Portland, Oregon 97209, US"}

  # Pass the parameters object to the Location Cleaner API
  response = CLIENT.location.cleaner(**QUERY_STRING)

  # Print the API response
  print(response.text)
  ```

  ```bash cURL theme={null}
  curl -X GET -G \
    'https://api.peopledatalabs.com/v5/location/clean' \
    -H 'X-Api-Key: xxxx' \
    --data-urlencode 'location=239 NW 13th Ave, Portland, Oregon 97209, US'
  ```

  ```javascript JavaScript theme={null}
  // 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 params = {
    location:"239 NW 13th Ave, Portland, Oregon 97209, US"
  }

  // Pass the parameters object to the Location Cleaner API
  PDLJSClient.location.cleaner(params).then((data) => {
    // Print the API response
    console.log(data);
  }).catch((error) => {
    console.log(error);
  });
  ```

  ```ruby Ruby theme={null}
  # See https://github.com/peopledatalabs/peopledatalabs-ruby
  require 'peopledatalabs'

  # Set your API key
  Peopledatalabs.api_key = 'YOUR API KEY'

  # Pass parameters to the Location Cleaner API
  response = Peopledatalabs::Cleaner.location(value: "239 NW 13th Ave, Portland, Oregon 97209, US")

  # Print the API response
  puts response
  ```

  ```go Go expandable theme={null}
  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.LocationParams{Location: "239 NW 13th Ave, Portland, Oregon 97209, US"}
      
      // Pass the parameters object to the Location Cleaner API
      params := pdlmodel.CleanLocationParams {
          LocationParams: querystring,
      }
      
      // Check for successful response
      response, err := client.Location.Clean(context.Background(), params)
      if err == nil {
          // Print the API response
          fmt.Println(response)
      }  
  }
  ```

  ```python Python3 theme={null}
  import requests

  # Set your API key
  API_KEY = "YOUR API KEY"

  # Set the Location Cleaner API URL
  PDL_URL = "https://api.peopledatalabs.com/v5/location/clean"

  # Create a parameters JSON object
  QUERY_STRING = {"location":"239 NW 13th Ave, Portland, Oregon 97209, US"}

  # Set headers
  HEADERS = {
      'accept': "application/json",
      'content-type': "application/json",
      'x-api-key': API_KEY
  }

  # Pass the parameters object to the Location Cleaner API
  response = requests.request("GET", PDL_URL, headers=HEADERS, params=QUERY_STRING)

  # Print the API response
  print(response.text)
  ```
</CodeGroup>

## School Cleaner API Example

*"Show me how this school is stored in PDL based on the LinkedIn URL."*

<CodeGroup>
  ```python Python3 SDK theme={null}
  # 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 = {"profile":"linkedin.com/school/ucla"}

  # Pass the parameters object to the School Cleaner API
  response = CLIENT.school.cleaner(**QUERY_STRING)

  # Print the API response
  print(response.text)
  ```

  ```bash cURL theme={null}
  curl -X GET -G \
    'https://api.peopledatalabs.com/v5/school/clean' \
    -H 'X-Api-Key: xxxx' \
    --data-urlencode 'profile=linkedin.com/school/ucla'
  ```

  ```javascript JavaScript theme={null}
  // 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 params = {
    profile:"linkedin.com/school/ucla"
  }

  // Pass the parameters object to the School Cleaner API
  PDLJSClient.school.cleaner(params).then((data) => {
    // Print the API response
    console.log(data);
  }).catch((error) => {
    console.log(error);
  });
  ```

  ```ruby Ruby theme={null}
  # See https://github.com/peopledatalabs/peopledatalabs-ruby
  require 'peopledatalabs'

  # Set your API key
  Peopledatalabs.api_key = 'YOUR API KEY'

  # Pass parameters to the School Cleaner API
  response = Peopledatalabs::Cleaner.school(kind: "profile", value: "linkedin.com/school/ucla")

  # Print the API response
  puts response
  ```

  ```go Go expandable theme={null}
  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.SchoolParams{Profile: "linkedin.com/school/ucla"}
      
      // Pass the parameters object to the School Cleaner API
      params := pdlmodel.CleanSchoolParams {
          SchoolParams: querystring,
      }
      
      // Check for successful response
      response, err := client.School.Clean(context.Background(), params)
      if err == nil {
          // Print the API response
          fmt.Println(response)
      }  
  }
  ```

  ```python Python3 theme={null}
  import requests

  # Set your API key
  API_KEY = "YOUR API KEY"

  # Set the School Cleaner API URL
  PDL_URL = "https://api.peopledatalabs.com/v5/school/clean"

  # Create a parameters JSON object
  QUERY_STRING = {"profile":"linkedin.com/school/ucla"}

  # Set headers
  HEADERS = {
      'accept': "application/json",
      'content-type': "application/json",
      'x-api-key': API_KEY
  }

  # Pass the parameters object to the School Cleaner API
  response = requests.request("GET", PDL_URL, headers=HEADERS, params=QUERY_STRING)

  # Print the API response
  print(response.text)
  ```
</CodeGroup>

## Company Cleaner API Example Using POST

*"Show me how this company is stored in PDL based on the name using a POST request."*

<Info>
  **Difference Between GET and POST Requests**

  See this article for a comparison of the [differences between GET and POST requests](https://www.w3schools.com/tags/ref_httpmethods.asp). The biggest difference is that POST requests don't have any limit on the amount of data that you can pass in a request.
</Info>

<CodeGroup>
  ```python Python3 theme={null}
  import requests

  # Set your API key
  API_KEY = "YOUR API KEY"

  # Set the School Cleaner API URL
  PDL_URL = "https://api.peopledatalabs.com/v5/company/clean"

  # Create a parameters JSON object
  QUERY_STRING = {"name":"peopledatalabs"}

  # Set headers
  HEADERS = {
      'accept': "application/json",
      'content-type': "application/json",
      'x-api-key': API_KEY
  }

  # Pass the parameters object to the Company Cleaner API using POST method
  response = requests.post(
    PDL_URL,
    headers=HEADERS,
    json=QUERY_STRING # Passing the data directly as a JSON object
  ).json()

  # Print the API response
  print(response)
  ```

  ```bash cURL theme={null}
  curl -X POST \
    'https://api.peopledatalabs.com/v5/company/clean' \
    -H 'X-Api-Key: your-api-key' \
    -H 'Content-Type: application/json' \
    -d '{
      "name": "peopledatalabs",
      "pretty": true
  }'
  ```
</CodeGroup>

## Advanced Example

"*I want to find employees at a particular company but don't have the PDL identifier for the company.*"

<CodeGroup>
  ```python Python3 SDK (Elasticsearch) expandable theme={null}
  import json

  # 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",
  )

  # Set the website of the company you want to search
  COMPANY_WEBSITE = "peopledatalabs.com"

  # Create a parameters JSON object for the Company Cleaner API
  QUERY_STRING = { "website": COMPANY_WEBSITE }

  # Pass the parameters object to the Company Cleaner API
  response = CLIENT.company.cleaner(**QUERY_STRING)

  # Check for successful response
  if response.status_code == 200:
      # Store the cleaned company from the API response
      cleaned_company = response.json()
  else:
      cleaned_company = {}
      print(f"Company Cleaner API Error for [{COMPANY_WEBSITE}]: {response.text}")

  # Employees at the cleaned company
  company_employee_matches = {}

  # Check for cleaned company
  if cleaned_company:
      # Create an Elasticsearch query
      ES_QUERY = {
          "query": {
              "bool": {
                  "must": [
                      {"term": {"job_company_id": cleaned_company['id']}}
                  ]
              }
          }
      }

      # Create a parameters JSON object for the Person Search API
      PARAMS = {
          'query': ES_QUERY,
          'size': 100
      }

      # Pass the parameters object to the Person Search API
      response = CLIENT.person.search(**PARAMS)

      # Check for successful response
      if response.status_code == 200:
          # Store the employees of the cleaned company from the API response
          company_employee_matches = response.json()['data']
      else:
          company_employee_matches = {}
          print(f"Person Search Error for [{COMPANY_WEBSITE}]: {response.text}")

  print(f"Found {len(company_employee_matches)} employee profiles at {COMPANY_WEBSITE}.")
  ```

  ```python Python3 SDK (SQL) expandable theme={null}
  import json

  # 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",
  )

  # Set the website of the company you want to search
  COMPANY_WEBSITE = "peopledatalabs.com"

  # Create a parameters JSON object for the Company Cleaner API
  QUERY_STRING = { "website": COMPANY_WEBSITE }

  # Pass the parameters object to the Company Cleaner API
  response = CLIENT.company.cleaner(**QUERY_STRING)

  # Check for successful response
  if response.status_code == 200:
      # Store the cleaned company from the API response
      cleaned_company = response.json()
  else:
      cleaned_company = {}
      print(f"Company Cleaner API Error for [{COMPANY_WEBSITE}]: {response.text}")

  # Employees at the cleaned company
  company_employee_matches = {}

  # Check for cleaned company
  if cleaned_company:
      # Create an SQL query
      SQL_QUERY = f"""
      SELECT * FROM person
      WHERE job_company_id = '{cleaned_company['id']}'
      """

      # Create a parameters JSON object for the Person Search API
      PARAMS = {
          'sql': SQL_QUERY,
          'size': 100
      }

      # Pass the parameters object to the Person Search API
      response = CLIENT.person.search(**PARAMS)

      # Check for successful response
      if response.status_code == 200:
          # Store the employees of the cleaned company from the API response
          company_employee_matches = response.json()['data']
      else:
          company_employee_matches = {}
          print(f"Person Search Error for [{COMPANY_WEBSITE}]: {response.text}")

  print(f"Found {len(company_employee_matches)} employee profiles at {COMPANY_WEBSITE}.")
  ```

  ```javascript JavaScript (Elasticsearch) expandable theme={null}
  // 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" });

  // Set the website of the company you want to search
  const companyWebsite = "peopledatalabs.com";

  // Create a parameters JSON object for the Company Cleaner API
  const queryString = { "website": companyWebsite };

  // The cleaned company
  var cleanedCompany;

  // Pass the parameters object to the Company Cleaner API
  PDLJSClient.company.cleaner(queryString).then((data) => {

      // Store the cleaned company from the API response
      cleanedCompany = data;
      
      // Employees at the cleaned company
      var companyEmployeeMatches = {};
      
      // Create an Elasticsearch query
      const esQuery = {
        query: {
           bool: {
              must:[
                 {"term": {"job_company_id": cleanedCompany["id"]}}
              ]
           }
        }
      }
      
      // Create a parameters JSON object for the Person Search API
      const params = {
          searchQuery: esQuery, 
          size: 100,
      }
      
      // Pass the parameters object to the Person Search API
      PDLJSClient.person.search.elastic(params).then((data) => {
          // Store the employees of the cleaned company from the API response
          companyEmployeeMatches = data.data;
          console.log(`Found ${companyEmployeeMatches.length} employee profiles at ${companyWebsite}.`);
      }).catch((error) => {
          companyEmployeeMatches = {};
          console.log(`Person Search Error for [${companyWebsite}]: ${error}`);
      });
      
  }).catch((error) => {
      console.log(error);
  });
  ```

  ```javascript JavaScript (SQL) expandable theme={null}
  // 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" });

  // Set the website of the company you want to search
  const companyWebsite = "peopledatalabs.com";

  // Create a parameters JSON object for the Company Cleaner API
  const queryString = { "website": companyWebsite };

  // The cleaned company
  var cleanedCompany;

  // Pass the parameters object to the Company Cleaner API
  PDLJSClient.company.cleaner(queryString).then((data) => {

      // Store the cleaned company from the API response
      cleanedCompany = data;
      
      // Employees at the cleaned company
      var companyEmployeeMatches = {};
      
      // Create an SQL query
      const sqlQuery = `SELECT * FROM person
                          WHERE job_company_id = '` + cleanedCompany["id"] + `';`;
      
      // Create a parameters JSON object for the Person Search API
      const params = {
          searchQuery: sqlQuery, 
          size: 100,
      }
      
      // Pass the parameters object to the Person Search API
      PDLJSClient.person.search.sql(params).then((data) => {
          // Store the employees of the cleaned company from the API response
          companyEmployeeMatches = data.data;
          console.log(`Found ${companyEmployeeMatches.length} employee profiles at ${companyWebsite}.`);
      }).catch((error) => {
          companyEmployeeMatches = {};
          console.log(`Person Search Error for [${companyWebsite}]: ${error}`);
      });
      
  }).catch((error) => {
      console.log(error);
  });
  ```

  ```ruby Ruby (Elasticsearch) expandable theme={null}
  require 'json'

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

  # Set your API key
  Peopledatalabs.api_key = 'YOUR API KEY'

  # Set the website of the company you want to search
  COMPANY_WEBSITE = "peopledatalabs.com"

  # Pass parameters to the Company Cleaner API
  response = Peopledatalabs::Cleaner.company(kind: "website", value: COMPANY_WEBSITE)

  # Check for successful response
  if response['status'] == 200
      # Store the cleaned company from the API response
      cleaned_company = response
  else
      cleaned_company = {}
      puts "Company Cleaner API Error for #{COMPANY_WEBSITE}: #{response}"
  end

  # Employees at the cleaned company
  company_employee_matches = {}

  # Check for cleaned company
  if cleaned_company
      # Create an Elasticsearch query
      ES_QUERY = {
          "query": {
              "bool": {
                  "must": [
                      {"term": {"job_company_id": cleaned_company['id']}}
                  ]
              }
          }
      }

      # Pass parameters to the Person Search API
      response = Peopledatalabs::Search.people(searchType: 'elastic', query: ES_QUERY, size: 100)

      # Check for successful response
      if response['status'] == 200
          # Store the employees of the cleaned company from the API response
          company_employee_matches = response['data']
      else
          company_employee_matches = []
          puts "Person Search Error for [#{COMPANY_WEBSITE}]: #{response}"
      end
  end
  puts "Found #{company_employee_matches.length()} employee profiles at #{COMPANY_WEBSITE}."
  ```

  ```ruby Ruby (SQL) expandable theme={null}
  require 'json'

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

  # Set your API key
  Peopledatalabs.api_key = 'YOUR API KEY'

  # Set the website of the company you want to search
  COMPANY_WEBSITE = "peopledatalabs.com"

  # Pass parameters to the Company Cleaner API
  response = Peopledatalabs::Cleaner.company(kind: "website", value: COMPANY_WEBSITE)

  # Check for successful response
  if response['status'] == 200
      # Store the cleaned company from the API response
      cleaned_company = response
  else
      cleaned_company = {}
      puts "Company Cleaner API Error for #{COMPANY_WEBSITE}: #{response}"
  end

  # Employees at the cleaned company
  company_employee_matches = {}

  # Check for cleaned company
  if cleaned_company
      # Create an SQL query
      SQL_QUERY = """
      SELECT * FROM person
      WHERE job_company_id = '#{cleaned_company['id']}'
      """

      # Pass parameters to the Person Search API
      response = Peopledatalabs::Search.people(searchType: 'sql', query: SQL_QUERY, size: 10)

      # Check for successful response
      if response['status'] == 200
          # Store the employees of the cleaned company from the API response
          company_employee_matches = response['data']
      else
          company_employee_matches = []
          puts "Person Search Error for [#{COMPANY_WEBSITE}]: #{response}"
      end
  end
  puts "Found #{company_employee_matches.length()} employee profiles at #{COMPANY_WEBSITE}."
  ```

  ```go Go (Elasticsearch) expandable theme={null}
  package main

  import (
      "fmt"
      "encoding/json"
      "reflect"
      "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)
      
      // Set the website of the company you want to search
      companyWebsite := "peopledatalabs.com"

      // Create a parameters JSON object for the Company Cleaner API
      cleanParams := pdlmodel.CleanCompanyParams {
          Website: "peopledatalabs.com",
      }
      
      // The cleaned company
      var cleanedCompany pdlmodel.CleanCompanyResponse
      
      // Pass the parameters object to the Company Cleaner API
      cleanResponse, cleanErr := client.Company.Clean(context.Background(), cleanParams)
      // Check for successful response
      if cleanErr == nil {
          // Store the cleaned company from the API response
          cleanedCompany = cleanResponse
      } else {
          fmt.Printf("Company Cleaner API Error for [%s]: %s", companyWebsite, cleanResponse)
      }
      
      // Check for cleaned company
      if !reflect.ValueOf(cleanedCompany).IsZero() {
          // Create an Elasticsearch query
          elasticSearchQuery := map[string]interface{} {
              "query": map[string]interface{} {
                  "bool": map[string]interface{} {
                      "must": []map[string]interface{} {
                          {"term": map[string]interface{}{"job_company_id": cleanedCompany.Id}},
                      },
                  },
              },
          }

          // Create a parameters JSON object for the Person Search API
          searchParams := pdlmodel.SearchParams {
              BaseParams: pdlmodel.BaseParams {
                  Size: 100,
              },
              SearchBaseParams: pdlmodel.SearchBaseParams {
                  Query: elasticSearchQuery,
              },
          }
          
          // Pass the parameters object to the Person Search API
          SearchResponse, SearchErr := client.Person.Search(context.Background(), searchParams)
          // Check for successful response
          if SearchErr == nil {
              data := SearchResponse.Data
              // Store the employees of the cleaned company from the API response in JSON format
              companyEmployeeMatches, jsonErr := json.Marshal(data)
       
              if jsonErr == nil && !reflect.ValueOf(companyEmployeeMatches).IsZero() {
                  fmt.Printf("Found %d employee profiles at %s.\n", len(data), companyWebsite)
              }
          } else {
              fmt.Printf("Company Cleaner API Error for [%s]: %s\n", companyWebsite, SearchResponse)
          }
      }
  }
  ```

  ```go Go (SQL) expandable theme={null}
  package main

  import (
      "fmt"
      "encoding/json"
      "reflect"
      "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)
      
      // Set the website of the company you want to search
      companyWebsite := "peopledatalabs.com"

      // Create a parameters JSON object for the Company Cleaner API
      cleanParams := pdlmodel.CleanCompanyParams {
          Website: "peopledatalabs.com",
      }
      
      // The cleaned company
      var cleanedCompany pdlmodel.CleanCompanyResponse
      
      // Pass the parameters object to the Company Cleaner API
      cleanResponse, cleanErr := client.Company.Clean(context.Background(), cleanParams)
      // Check for successful response
      if cleanErr == nil {
          // Store the cleaned company from the API response
          cleanedCompany = cleanResponse
      } else {
          fmt.Printf("Company Cleaner API Error for [%s]: %s", companyWebsite, cleanResponse)
      }
      
      // Check for cleaned company
      if !reflect.ValueOf(cleanedCompany).IsZero() {
          // Create an SQL query
          sqlQuery := "SELECT * FROM person" +
              " WHERE job_company_id='" + cleanedCompany.Id + "';"

          // Create a parameters JSON object for the Person Search API
          searchParams := pdlmodel.SearchParams {
              BaseParams: pdlmodel.BaseParams {
                  Size: 100,
              },
              SearchBaseParams: pdlmodel.SearchBaseParams {
                  SQL: sqlQuery,
              },
          }
          
          // Pass the parameters object to the Person Search API
          SearchResponse, SearchErr := client.Person.Search(context.Background(), searchParams)
          // Check for successful response
          if SearchErr == nil {
              data := SearchResponse.Data
              // Store the employees of the cleaned company from the API response in JSON format
              companyEmployeeMatches, jsonErr := json.Marshal(data)
       
              if jsonErr == nil && !reflect.ValueOf(companyEmployeeMatches).IsZero() {
                  fmt.Printf("Found %d employee profiles at %s.\n", len(data), companyWebsite)
              }
          } else {
              fmt.Printf("Company Cleaner API Error for [%s]: %s\n", companyWebsite, SearchResponse)
          }
      }
  }
  ```

  ```python Python3 (Elasticsearch) expandable theme={null}
  import json
  import requests

  # Set your API key
  API_KEY = "YOUR API KEY"

  # Set the Company Cleaner API URL
  PDL_COMPANY_CLEANER_URL = "https://api.peopledatalabs.com/v5/company/clean"
  # Set the Person Search API URL
  PDL_PERSON_SEARCH_URL = "https://api.peopledatalabs.com/v5/person/search"

  # Set the website of the company you want to search
  COMPANY_WEBSITE = "peopledatalabs.com"

  # Create a parameters JSON object for the Company Cleaner API
  QUERY_STRING = { "website": COMPANY_WEBSITE }

  # 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_COMPANY_CLEANER_URL, headers=HEADERS, params=QUERY_STRING)

  # Check for successful response
  if response.status_code == 200:
      # Store the cleaned company from the API response
      cleaned_company = response.json()
  else:
      cleaned_company = {}
      print(f"Company Cleaner API Error for [{COMPANY_WEBSITE}]: {response.text}")

  # Employees at the cleaned company
  company_employee_matches = {}

  # Check for cleaned company
  if cleaned_company:
      # Set headers
      HEADERS = {
          'Content-Type': "application/json",
          'X-api-key': API_KEY
      }

      # Create an Elasticsearch query
      ES_QUERY = {
          "query": {
              "bool": {
                  "must": [
                      {"term": {"job_company_id": cleaned_company['id']}}
                  ]
              }
          }
      }

      # Create a parameters JSON object for the Person Search API
      PARAMS = {
          'query': json.dumps(ES_QUERY),
          'size': 100
      }

      # Pass the parameters object to the Person Search API
      response = requests.get(PDL_PERSON_SEARCH_URL, headers=HEADERS, params=PARAMS)

      # Check for successful response
      if response.status_code == 200:
          # Store the employees of the cleaned company from the API response
          company_employee_matches = response.json()['data']
      else:
          company_employee_matches = {}
          print(f"Person Search Error for [{COMPANY_WEBSITE}]: {response.text}")

  print(f"Found {len(company_employee_matches)} employee profiles at {COMPANY_WEBSITE}.")
  ```

  ```python Python3 (SQL) expandable theme={null}
  import json
  import requests

  # Set your API key
  API_KEY = "YOUR API KEY"

  # Set the Company Cleaner API URL
  PDL_COMPANY_CLEANER_URL = "https://api.peopledatalabs.com/v5/company/clean"
  # Set the Person Search API URL
  PDL_PERSON_SEARCH_URL = "https://api.peopledatalabs.com/v5/person/search"

  # Set the website of the company you want to search
  COMPANY_WEBSITE = "peopledatalabs.com"

  # Create a parameters JSON object for the Company Cleaner API
  QUERY_STRING = { "website": COMPANY_WEBSITE }

  # 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_COMPANY_CLEANER_URL, headers=HEADERS, params=QUERY_STRING)

  # Check for successful response
  if response.status_code == 200:
      # Store the cleaned company from the API response
      cleaned_company = response.json()
  else:
      cleaned_company = {}
      print(f"Company Cleaner API Error for [{COMPANY_WEBSITE}]: {response.text}")

  # Employees at the cleaned company
  company_employee_matches = {}

  # Check for cleaned company
  if cleaned_company:
      # Set HEADERS
      headers = {
          'Content-Type': "application/json",
          'X-api-key': API_KEY
      }

      # Create an SQL query
      SQL_QUERY = f"""
      SELECT * FROM person
      WHERE job_company_id = '{cleaned_company['id']}'
      """

      # Create a parameters JSON object for the Person Search API
      PARAMS = {
          'sql': SQL_QUERY,
          'size': 100
      }

      # Pass the parameters object to the Person Search API
      response = requests.get(PDL_PERSON_SEARCH_URL, headers=HEADERS, params=PARAMS)

      # Check for successful response
      if response.status_code == 200:
          # Store the employees of the cleaned company from the API response
          company_employee_matches = response.json()['data']
      else:
          company_employee_matches = {}
          print(f"Person Search Error for [{COMPANY_WEBSITE}]: {response.text}")

  print(f"Found {len(company_employee_matches)} employee profiles at {COMPANY_WEBSITE}.")
  ```
</CodeGroup>


## Related topics

- [Cleaner APIs](/docs/cleaner-apis.md)
- [Quickstart - Cleaner APIs](/docs/quickstart-cleaner-apis.md)
- [Reference - Cleaner APIs](/docs/cleaner-apis-reference.md)
- [Output Responses - Cleaner APIs](/docs/output-response-cleaner-apis.md)
- [Input Parameters - Cleaner APIs](/docs/input-parameters-cleaner-apis.md)
