> ## 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.

# Authentication

## Authentication

There are three ways to authenticate requests:

* [In URL](/docs/authentication#in-url)
* [In Header](/docs/authentication#in-header)
* [In SDKs](/docs/authentication#in-sdks)

### In URL

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

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

  # Set the Person Enrichment API URL, including the API key
  PDL_URL = "https://api.peopledatalabs.com/v5/person/enrich?api_key={}".format(API_KEY)

  # Pass the URL to the Person Enrichment API
  json_response = requests.get(PDL_URL).json()
  ```

  ```bash cURL theme={null}
  curl -X GET \
    'https://api.peopledatalabs.com/v5/person/enrich?api_key=xxxx'
  ```
</CodeGroup>

### In Header

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

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

  # Set the Person Enrichment API URL
  PDL_URL = "https://api.peopledatalabs.com/v5/person/enrich"

  # Set the headers
  HEADERS = {
      "X-Api-Key": API_KEY
  }

  # Pass the URL and the headers to the Person Enrichment API
  json_response = requests.get(PDL_URL,  headers=HEADERS).json()
  ```

  ```bash cURL theme={null}
  curl -X GET \
    'https://api.peopledatalabs.com/v5/person/enrich' \ 
    -H 'X-Api-Key: xxxx'
  ```
</CodeGroup>

### In SDKs

<CodeGroup>
  ```python Python3 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
  PARAMS = {
      "company": ["Hallspot", "People Data Labs"],
    	"email": ["sean.thorne@talentiq.co"]
  }

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

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

  ```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 = {
      company: "Hallspot",
      company: "People Data Labs",
      email: "sean.thorne@talentiq.co"
  }

  // Pass the parameters object to the Person Enrichment API
  PDLJSClient.person.enrichment(params).then((response) => {
      // Print the API response in JSON format
      console.log(response);
  }).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'

  # Create a parameters JSON object
  PARAMS = {
      "company": ["Hallspot", "People Data Labs"],
    	"email": ["sean.thorne@talentiq.co"]
  }

  # Pass the parameters object to the Person Enrichment API
  response = Peopledatalabs::Enrichment.person(params: PARAMS)

  # 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
      params := pdlmodel.EnrichPersonParams {
          PersonParams: pdlmodel.PersonParams {
              Company: []string{"Hallspot", "People Data Labs"},
              Email: []string{"sean.thorne@talentiq.co"},
          },
      }

      // Pass the parameters object to the Person Enrichment API
      response, err := client.Person.Enrich(context.Background(), params)
      
      // Print the API response
      if err == nil {
          fmt.Println(response)
      }  
  }
  ```
</CodeGroup>

Requests with an invalid API Key will return a `401` [Error](/docs/errors).

If you need any assistance, 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 <a href="mailto:support@peopledatalabs.com">[support@peopledatalabs.com](mailto:support@peopledatalabs.com)</a>


## Related topics

- [Reference - Job Posting Search API](/docs/reference-job-posting-search-api.md)
- [Data Delivery Using Direct Download](/docs/data-delivery-using-direct-download.md)
- [Input Parameters - Autocomplete API](/docs/input-parameters-autocomplete-api.md)
- [Input Parameters - Company Enrichment API](/docs/input-parameters-company-enrichment-api.md)
- [Input Parameters - Company Search API](/docs/input-parameters-company-search-api.md)
