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

# Preview Enrichment API

## Overview

The Preview Enrichment API supports our [Person Enrichment API](https://docs.peopledatalabs.com/docs/person-enrichment-api) by providing a preview of what fields have data in a record.

We’ve heard from many of our users in the lead/candidate search platform market that they often “tease” their users with previews of contact information for a person to incentivize them. The Preview Enrichment API will help solve this problem.

![Preview Enrichment API.svg](https://mintcdn.com/peopledatalabs/YteP5zgY1fC23mEV/images/docs/8f9b2d9-Preview_Enrichment_API.svg?fit=max\&auto=format\&n=YteP5zgY1fC23mEV\&q=85\&s=faac7a352b1ea9f5e153a2ea642ff5c3)

## Request Format

The endpoint for the Preview Enrichment API is `https://api.peopledatalabs.com/v5/person/enrich/preview`.

See [Input Parameters - Person Enrichment API](https://docs.peopledatalabs.com/docs/input-parameters-person-enrichment-api.md) for details on the supported parameters. All valid input parameters for the Person Enrichment API will work the same way for the Preview Enrichment API.

### Example

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

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

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

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

# Create a parameters JSON object
PARAMS = {
    "email": ["sean@peopledatalabs.com"],
    "min_likelihood": 6
}

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

# Check for successful response
if json_response["status"] == 200:
  record = json_response['data']

  # Save enrichment data to JSON file
  with open("my_pdl_enrichment_preview.jsonl", "w") as out:
    out.write(json.dumps(record) + "\n")
else:
  print("Enrichment preview unsuccessful. See error and try again.")
  print("error:", json_response)
```

```bash cURL theme={null}
curl -X GET -G \
  'https://api.peopledatalabs.com/v5/person/enrich/preview' \
  -H 'X-Api-Key: xxxx' \
  --data-urlencode 'email=sean@peopledatalabs.com'
```

## Response Format

The output is formatted as such:

| Field Name | Type | Description |
| - | - | - |
| `data` | `Object` | The person response object. |
| `status` | `Integer` | The HTTP status code. |
| `likelihood` | `Integer` | The likelihood score. |

The Preview Enrichment API is a wrapper on the Person Enrichment API, meaning it returns all of [the same fields](https://docs.peopledatalabs.com/docs/fields) as the Person Enrichment API, but with **true / false** values instead (**true** meaning we have a value for that field and **false** meaning we do not have a value for it).

Any nested objects will not be included in the Preview Enrichment response. For example, if a record has data for the `education` field, the response will have `"education": true`, but will not list any of the subfields (such as `education.major`).

To help users know which record they're looking at, the following fields will have the actual data if it exists for the record: `activity_score`, `dataset_version`, `full_name`, `id`, `industry`, `job_company_name`, `job_company_website`, `job_title`, `job_title_class`, `job_title_levels`, `job_title_role`, `job_title_sub_role`, `linkedin_url`, `location_name`, `profile_score`, `sex`.

All other fields will have true/false values as described above.

See the [Preview Bundle](https://docs.peopledatalabs.com/docs/person-data-field-bundles.md#preview-bundle) for the full list of fields and their Exposed / T/F Flag status.

### Full Example Response

```json JSON expandable theme={null}
{
   "status": 200,
   "likelihood": 6,
   "data": {
       "id": "qEnOZ5Oh0poWnQ1luFBfVw_0000",
       "full_name": "sean thorne",
       "sex": "male",
       "linkedin_url": "linkedin.com/in/seanthorne",
       "industry": "computer software",
       "job_title": "co-founder and chief executive officer",
       "job_title_class": "general_and_administrative",
       "job_title_role": null,
       "job_title_sub_role": null,
       "job_title_levels": [
           "owner",
           "cxo"
       ],
       "job_company_name": "people data labs",
       "job_company_website": "peopledatalabs.com",
       "location_name": "san francisco, california, united states",
       "activity_score": "positive signals",
       "profile_score": "positive signals",
       "birth_date": false,
       "birth_year": true,
       "countries": true,
       "education": true,
       "emails": true,
       "experience": true,
       "facebook_id": true,
       "facebook_url": true,
       "facebook_username": true,
       "first_name": true,
       "github_url": false,
       "github_username": false,
       "interests": true,
       "job_company_facebook_url": true,
       "job_company_founded": true,
       "job_company_id": true,
       "job_company_industry": true,
       "job_company_industry_v2": true,
       "job_company_linkedin_id": true,
       "job_company_linkedin_url": true,
       "job_company_location_address_line_2": true,
       "job_company_location_continent": true,
       "job_company_location_country": true,
       "job_company_location_geo": true,
       "job_company_location_locality": true,
       "job_company_location_metro": true,
       "job_company_location_name": true,
       "job_company_location_postal_code": true,
       "job_company_location_region": true,
       "job_company_location_street_address": true,
       "job_company_size": true,
       "job_company_twitter_url": true,
       "job_last_changed": true,
       "job_last_verified": true,
       "job_start_date": true,
       "last_initial": true,
       "last_name": true,
       "linkedin_id": true,
       "linkedin_username": true,
       "location_address_line_2": false,
       "location_continent": true,
       "location_country": true,
       "location_geo": true,
       "location_last_updated": true,
       "location_locality": true,
       "location_metro": true,
       "location_names": true,
       "location_postal_code": false,
       "location_region": true,
       "location_street_address": false,
       "middle_initial": true,
       "middle_name": true,
       "mobile_phone": true,
       "personal_emails": false,
       "recommended_personal_email": true,
       "phone_numbers": true,
       "profiles": true,
       "regions": true,
       "skills": true,
       "street_addresses": false,
       "twitter_url": true,
       "twitter_username": true,
       "work_email": true,
       "dataset_version": "35.0"
   }
}
```

### Field Availability

The Preview Enrichment API will only return the fields shown in the example response above. Even if you have purchased additional fields or bundles for Person Enrichment, those fields will not show in the Preview Enrichment response.

### Errors

If the request encounters an error, it will instead return an Error Response in the format described in [Errors](https://docs.peopledatalabs.com/docs/errors.md).

## Access & Billing

The Preview Enrichment API is available for purchase by enterprise Person Enrichment customers. If you’d like access, please [reach out to us](https://www.peopledatalabs.com/talk-to-sales).


## Related topics

- [October 2022 Release Notes](https://docs.peopledatalabs.com/changelog/october-2022-release-notes-v20.md)
- [Person Enrichment API](https://docs.peopledatalabs.com/docs/person-enrichment-api.md)
- [Preview Search API](https://docs.peopledatalabs.com/docs/preview-search-api.md)
- [Skill Enrichment API](https://docs.peopledatalabs.com/docs/skill-enrichment-api.md)
- [Company Enrichment API](https://docs.peopledatalabs.com/docs/company-enrichment-api.md)
