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

# Request Parameters

There are two primary ways to pass parameters in an API request:

1. Set the parameters directly in the [URL](#in-url) of the API request.
2. Set the parameters through a parameters [JSON](#in-a-json-object) object.

We recommend that you pass parameters through a JSON object, though you may also pass parameters in the URL if you'd like. Anything that we find in a JSON object will take precedence over parameters that we find in the URL.

Here is an example of using parameters with our [Person Enrichment API](/docs/enrichment-api) for reference:

## In URL

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

  url = "https://api.peopledatalabs.com/v5/person/enrich?api_key={YOUR API KEY}&company=People Data Labs&profile=linkedin.com/in/linfluencer"

  response = requests.get(url)

  print(response.text)
  ```

  ```bash cURL theme={null}
  curl -X GET -G \
    'https://api.peopledatalabs.com/v5/person/enrich'\
    -H 'X-Api-Key: YOUR API KEY' \
    --data-urlencode 'company=People Data Labs'\
   	--data-urlencode 'profile=linkedin.com/in/linfluencer'
  ```

  ```javascript JavaScript theme={null}
  // Complete URL with parameters
  const url = 'https://api.peopledatalabs.com/v5/person/enrich?api_key={YOUR API KEY}&company=People Data Labs&profile=linkedin.com/in/linfluencer';

  // Send GET request
  fetch(url)
      .then(response => {
          if (!response.ok) {
              throw new Error('There was an error.');
          }
          return response.json();
      })
      .then(data => {
          console.log('Data:', data);
      })
      .catch(error => {
          console.error('There was a problem with the fetch operation:', error);
      });
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'uri'

  # Base URL of the API
  url = URI('https://api.peopledatalabs.com/v5/person/enrich?api_key={YOUR API KEY}&company=People Data Labs&profile=linkedin.com/in/linfluencer')

  # Send GET request
  response = Net::HTTP.get(url)

  # Handle the response
  if response
    puts "Response: #{response}"
  else
    puts "Error: Unable to get data"
  end
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"io/ioutil"
  	"net/http"
  )

  func main() {
  	// Base URL of the API
    URL := "https://api.peopledatalabs.com/v5/person/enrich?api_key={YOUR API KEY}&company=People Data Labs&profile=linkedin.com/in/linfluencer"

  	// Send GET request
  	resp, err := http.Get(URL)
  	if err != nil {
  		fmt.Println("Error:", err)
  		return
  	}
  	defer resp.Body.Close()

  	// Read and print the response
  	body, err := ioutil.ReadAll(resp.Body)
  	if err != nil {
  		fmt.Println("Error reading response:", err)
  		return
  	}

  	fmt.Println("Response:", string(body))
  }

  ```
</CodeGroup>

## In a JSON Object

<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
  PARAMS = {
    "company": "People Data Labs",
    "email": "ben@peopledatalabs.com".
    "profile": "linkedin.com/in/linfluencer"
  }

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

  # Print the API response in JSON format
  print(json_response)
  ```

  ```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((jsonResponse) => {
      // Print the API response in JSON format
      console.log(jsonResponse);
  }).catch((error) => {
      console.log(error);
  });
  ```

  ```ruby Ruby theme={null}
  require 'json'

  # 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
  json_response = JSON.dump(Peopledatalabs::Enrichment.person(params: PARAMS))

  # Print the API response in JSON format
  puts json_response
  ```

  ```go Go expandable theme={null}
  package main

  import (
      "fmt"
      "encoding/json"
      "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)
      
      // Check for successful response
      if err == nil {
          // Convert the API response to JSON
          jsonResponse, jsonErr := json.Marshal(response)
          // Print the API response
          if (jsonErr == nil) {
              fmt.Println(string(jsonResponse))
          }
      }  
  }
  ```

  ```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"

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

  # Pass the parameters object to the Person Enrichment API
  json_response = requests.get(PDL_URL,  params=PARAMS).json()

  # Print the API response in JSON format
  print(json_response)
  ```
</CodeGroup>


## Related topics

- [Input Parameters - Cleaner APIs](/docs/input-parameters-cleaner-apis.md)
- [Reference - Company Enrichment API](/docs/reference-company-enrichment-api.md)
- [Reference - Person Search API](/docs/reference-person-search-api.md)
- [Reference - Company Search API](/docs/reference-company-search-api.md)
- [Examples - Person Enrichment API](/docs/examples-person-enrichment-api.md)
