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

# Quickstart - IP Enrichment API

## Getting Started

In order to use our IP Enrichment API, you must have an active API key. You can look up your API key by logging into our [self-serve dashboard](https://www.peopledatalabs.com/main/api-keys) and going to the **API Keys** section.

<Tip>
  **Need an API Key?**

  If you don't have an API key, you can easily create one by [signing up](https://peopledatalabs.com/signup) for a self-serve account. For more information, check out our [Self-Serve Quickstart Guide](https://blog.peopledatalabs.com/post/self-signup-api-quickstart), which walks you through the sign-up process as well as shows you how to use the self-serve API dashboard.
</Tip>

## Simple Example

As mentioned in the [Overview](/docs/person-enrichment-api#overview), the IP Enrichment API is a means of performing a one-to-one match of an IP address.

Here's a quick example that demonstrates retrieving a record with an IP address of `72.212.42.169`:

<CodeGroup>
  ```python Python3 SDK 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",
  )

  # Create a parameters JSON object
  PARAMS = {
      "ip": "72.212.42.169"
  }

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

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

  ```bash cURL theme={null}
  curl -X GET \
    'https://api.peopledatalabs.com/v5/ip/enrich?api_key=xxxx&ip=72.212.42.169'
  ```

  ```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 = {
    ip: "72.212.42.169"
  }

  // Pass the parameters object to the Person Enrichment API
  PDLJSClient.ip(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 = {
      ip: '72.212.42.169'
  }

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

  # Print the API response in JSON format
  puts JSON.dump(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.IPParams {
          IPBaseParams: pdlmodel.IPBaseParams {
              IP: "72.212.42.169",
          },
      }

      // Pass the parameters object to the Person Enrichment API
      response, err := client.IP(context.Background(), params)
      
      // Convert the API response to JSON
      jsonResponse, jsonErr := json.Marshal(response.Data)

      // Print the API response
      if err == nil && 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/ip/enrich"

  # Create a parameters JSON object
  PARAMS = {
      "api_key": API_KEY,
      "ip": "72.212.42.169"
  }

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

The API will return the matching ip record if the IP passed to it exists in our dataset.

The result of running the above code should be the IP record for `72.212.42.169` from our IP Dataset:

```json JSON expandable theme={null}
{
    "status": 200,
    "data": {
        "ip": {
            "address": "72.212.42.169",
            "metadata": {
                "version": 4,
                "mobile": false,
                "hosting": false,
                "proxy": false,
                "tor": false,
                "vpn": false,
                "relay": false,
                "service": null,
              	"asn_domain": null,
            },
            "location": {
                "name": "phoenix, arizona, united states",
                "locality": "phoenix",
                "region": "arizona",
                "metro": "phoenix, arizona",
                "country": "united states",
                "continent": "north america",
                "postal_code": "85001",
                "geo": "33.44838,-112.07404",
                "timezone": "america/phoenix"
            }
        },
        "company": {
            "confidence": "very high",
            "id": "tnHcNHbCv8MKeLh92946LAkX6PKg",
            "website": "peopledatalabs.com",
            "name": "people data labs",
            "display_name": "People Data Labs",
            "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"
            },
            "size": "11-50",
            "industry": "computer software",
            "inferred_revenue": "$25m-$50m",
            "employee_count": 129,
            "tags": [
                "artificial intelligence",
                "data and analytics",
                "machine learning",
                "analytics",
                "database",
                "software",
                "developer apis",
                "data",
                "people data",
                "data science"
            ]
        },
        "person": {
            "confidence": "very high",
            "job_title_sub_role": "product",
            "job_title_role": "operations",
            "job_title_levels": [
                "cxo"
            ]
        },
      	"dataset_version": "1.1.0.2024w19"
    }
}
```

If you don't get this response, check out our [Errors](/docs/errors) page for more information.

***


## Related topics

- [IP Enrichment API](/docs/ip-enrichment-api.md)
- [Quickstart - Skill Enrichment API](/docs/quickstart-skill-enrichment-api.md)
- [Quickstart - Company Enrichment API](/docs/quickstart-company-enrichment-api.md)
- [Quickstart - Person Enrichment API](/docs/quickstart-person-enrichment-api.md)
- [Quickstart - Job Title Enrichment API](/docs/quickstart-job-title-enrichment-api.md)
