### Autocomplete API Examples (JavaScript) Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Demonstrates how to get autocomplete suggestions for job titles, companies, and skills using the People Data Labs Autocomplete API. Requires an API key and the 'peopledatalabs' library. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); // Autocomplete job titles try { const response = await PDLJSClient.autocomplete({ field: 'title', text: 'software eng', size: 10, titlecase: true }); console.log('Suggestions for "software eng":'); response.data?.forEach(suggestion => { console.log(` ${suggestion.name} (${suggestion.count?.toLocaleString()} records)`); }); } catch (error) { console.error('Autocomplete failed:', error.message); } // Autocomplete companies try { const response = await PDLJSClient.autocomplete({ field: 'company', text: 'goog', size: 5 }); response.data?.forEach(suggestion => { console.log(`${suggestion.name} - ${suggestion.meta?.website}`); }); } catch (error) { console.error(error); } // Autocomplete skills try { const response = await PDLJSClient.autocomplete({ field: 'skill', text: 'python', size: 10 }); console.log(response.data); } catch (error) { console.error(error); } ``` -------------------------------- ### Install People Data Labs JavaScript SDK Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Installs the People Data Labs JavaScript SDK using npm or yarn package managers. ```bash npm install peopledatalabs # or yarn add peopledatalabs ``` -------------------------------- ### Autocomplete API: Get Suggestions Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Shows how to use the Autocomplete API to get suggestions for fields like 'title' based on a given text input and a specified size. ```javascript // Get Autocomplete Suggestions try { const response = await PDLJSClient.autocomplete({ field: 'title', text: 'full', size: 10 }); console.log(response); } catch (error) { console.log(error); } ``` -------------------------------- ### IP Enrichment API Example (JavaScript) Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Enriches an IP address to retrieve associated company information, person characteristics, and geographic location. This example requires an API key and the 'peopledatalabs' library. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); try { const response = await PDLJSClient.ip({ ip: '72.212.42.228', return_ip_location: true, return_ip_metadata: true, return_person: true, min_confidence: 'high' }); if (response.data?.company) { console.log('Associated Company:'); console.log(' Name:', response.data.company.name); console.log(' Website:', response.data.company.website); console.log(' Industry:', response.data.company.industry); console.log(' Size:', response.data.company.size); console.log(' Confidence:', response.data.company.confidence); } if (response.data?.ip?.location) { console.log(' IP Location:'); console.log(' City:', response.data.ip.location.locality); console.log(' Region:', response.data.ip.location.region); console.log(' Country:', response.data.ip.location.country); console.log(' Timezone:', response.data.ip.location.timezone); } if (response.data?.ip?.metadata) { console.log(' IP Metadata:'); console.log(' VPN:', response.data.ip.metadata.vpn); console.log(' Proxy:', response.data.ip.metadata.proxy); console.log(' Tor:', response.data.ip.metadata.tor); console.log(' Hosting:', response.data.data.ip.metadata.hosting); } if (response.data?.person) { console.log(' Typical Person Profile:'); console.log(' Title Role:', response.data.person.job_title_role); console.log(' Title Levels:', response.data.person.job_title_levels?.join(', ')); } } catch (error) { console.error('IP enrichment failed:', error.message); } ``` -------------------------------- ### Sandbox Mode Testing Examples (JavaScript) Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Demonstrates how to use the sandbox mode for testing People Data Labs API endpoints (person enrichment, person search, company enrichment) without incurring charges. Requires an API key and the 'peopledatalabs' library. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); // Sandbox person enrichment try { const response = await PDLJSClient.person.enrichment({ email: 'reneewillis74@aol.com', sandbox: true }); console.log('Sandbox result:', response.data.full_name); } catch (error) { console.error(error); } // Sandbox person search try { const response = await PDLJSClient.person.search.sql({ searchQuery: "SELECT * FROM person WHERE location_country='united states'", size: 5, sandbox: true }); console.log('Sandbox search total:', response.total); } catch (error) { console.error(error); } // Sandbox company enrichment try { const response = await PDLJSClient.company.enrichment({ website: 'kohlerinteriors.com', sandbox: true }); console.log('Sandbox company:', response.name); } catch (error) { console.error(error); } ``` -------------------------------- ### GET /v5/school/cleaner Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Clean and standardize raw school name strings to canonical educational institution records. ```APIDOC ## GET /v5/school/cleaner ### Description Standardize raw school names to canonical records. ### Method GET ### Endpoint /v5/school/cleaner ### Query Parameters - **name** (string) - Required - Raw school name ### Response #### Success Response (200) - **name** (string) - Canonical school name - **website** (string) - School website - **domain** (string) - School domain ``` -------------------------------- ### GET /v1/autocomplete Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Retrieves autocomplete suggestions for fields like job titles, companies, and skills to improve search accuracy. ```APIDOC ## GET /v1/autocomplete ### Description Provides autocomplete suggestions for specific fields to assist in user input and search queries. ### Method GET ### Endpoint /v1/autocomplete ### Parameters #### Query Parameters - **field** (string) - Required - The field to autocomplete (e.g., 'title', 'company', 'skill'). - **text** (string) - Required - The search string to autocomplete. - **size** (integer) - Optional - Number of results to return. - **titlecase** (boolean) - Optional - Whether to return results in title case. ### Request Example { "field": "title", "text": "software eng", "size": 10 } ### Response #### Success Response (200) - **data** (array) - List of suggested objects. #### Response Example { "data": [{"name": "Software Engineer", "count": 5000}] } ``` -------------------------------- ### GET /v5/person/enrichment/preview Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Preview person enrichment results to see which fields are available before committing to a full enrichment request. ```APIDOC ## GET /v5/person/enrichment/preview ### Description Preview person enrichment results with limited fields visible. Returns boolean indicators for fields that would be available in full response. ### Method GET ### Endpoint /v5/person/enrichment/preview ### Parameters #### Query Parameters - **phone** (string) - Optional - Phone number to preview - **min_likelihood** (integer) - Optional - Minimum likelihood score ### Request Example { "phone": "4155688415", "min_likelihood": 5 } ### Response #### Success Response (200) - **data** (object) - Preview object containing available fields - **likelihood** (integer) - Confidence score #### Response Example { "likelihood": 5, "data": { "full_name": "John Smith", "emails": true } } ``` -------------------------------- ### GET /v5/company/cleaner Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Clean and standardize raw company name strings to canonical company records. ```APIDOC ## GET /v5/company/cleaner ### Description Standardize raw company names or websites to canonical records. ### Method GET ### Endpoint /v5/company/cleaner ### Query Parameters - **name** (string) - Optional - Raw company name - **website** (string) - Optional - Company website URL ### Response #### Success Response (200) - **name** (string) - Standardized name - **website** (string) - Canonical website - **industry** (string) - Industry classification ``` -------------------------------- ### GET /v5/person/identify Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Perform fuzzy matching to identify potential person records from incomplete or partial information. ```APIDOC ## GET /v5/person/identify ### Description Fuzzy match to identify potential person records from incomplete or partial information. Returns multiple matches with confidence scores. ### Method GET ### Endpoint /v5/person/identify ### Parameters #### Query Parameters - **name** (string) - Optional - Name of the person - **company** (string) - Optional - Current company - **locality** (string) - Optional - City or location ### Request Example { "name": "sean thorne", "company": "people data labs" } ### Response #### Success Response (200) - **matches** (array) - List of potential person matches #### Response Example { "matches": [ { "match_score": 95, "data": { "full_name": "Sean Thorne" } } ] } ``` -------------------------------- ### GET /v5/location/cleaner Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Parse and standardize raw location strings into structured geographic data. ```APIDOC ## GET /v5/location/cleaner ### Description Standardize raw location strings into structured geographic data. ### Method GET ### Endpoint /v5/location/cleaner ### Query Parameters - **location** (string) - Required - Raw location string ### Response #### Success Response (200) - **name** (string) - Standardized location name - **locality** (string) - City or locality - **region** (string) - State or region - **country** (string) - Country ``` -------------------------------- ### Job Title Enrichment API: Enrich Title Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Provides an example of enriching a job title using the Job Title Enrichment API. This can be used to get standardized information about a given job title. ```javascript // Enrich a Job Title try { const response = await PDLJSClient.jobTitle({ jobTitle: 'software engineer' }); console.log(response); } catch (error) { console.log(error); } ``` -------------------------------- ### Job Title Enrichment API Example (JavaScript) Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Enriches a given job title string to provide a cleaned title, relevant skills, and similar job titles. This function requires an API key and the 'peopledatalabs' library. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); try { const response = await PDLJSClient.jobTitle({ jobTitle: 'software engineer', titlecase: true }); console.log('Cleaned Title:', response.data?.cleaned_job_title); console.log(' Relevant Skills:'); response.data?.relevant_skills?.forEach(skill => { console.log(` - ${skill}`); }); console.log(' Similar Titles:'); response.data?.similar_job_titles?.forEach(title => { console.log(` - ${title}`); }); } catch (error) { console.error('Job title enrichment failed:', error.message); } ``` -------------------------------- ### GET /v1/ip/enrichment Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Enriches an IP address to identify associated company data, geographic location, and typical person profiles. ```APIDOC ## GET /v1/ip/enrichment ### Description Retrieves intelligence about an IP address including company, location, and metadata. ### Method GET ### Endpoint /v1/ip/enrichment ### Parameters #### Query Parameters - **ip** (string) - Required - The IP address to enrich. - **return_ip_location** (boolean) - Optional - Include location data. - **return_ip_metadata** (boolean) - Optional - Include VPN/proxy/hosting metadata. - **return_person** (boolean) - Optional - Include typical person profile data. ### Request Example { "ip": "72.212.42.228" } ### Response #### Success Response (200) - **company** (object) - Associated company details. - **ip** (object) - Location and metadata details. - **person** (object) - Typical person profile details. #### Response Example { "data": { "company": {"name": "Example Corp"}, "ip": {"location": {"locality": "New York"}} } } ``` -------------------------------- ### GET /v5/person/enrichment Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Enrich partial person data with complete profile information using identifiers like email, phone, or LinkedIn profile. ```APIDOC ## GET /v5/person/enrichment ### Description Enrich partial person data with complete profile information including employment history, education, contact details, and social profiles. ### Method GET ### Endpoint /v5/person/enrichment ### Parameters #### Query Parameters - **email** (string) - Optional - Email address of the person - **phone** (string) - Optional - Phone number of the person - **profile** (string) - Optional - LinkedIn profile URL - **min_likelihood** (integer) - Optional - Minimum likelihood score for matches - **required** (string) - Optional - Fields required in the response ### Request Example { "email": "john.smith@company.com", "min_likelihood": 6 } ### Response #### Success Response (200) - **data** (object) - The enriched person profile - **likelihood** (integer) - Confidence score of the match #### Response Example { "likelihood": 6, "data": { "full_name": "John Smith", "job_title": "Software Engineer", "job_company_name": "Company Inc" } } ``` -------------------------------- ### GET /v1/job-title/enrichment Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Enriches a raw job title string by providing a cleaned version, relevant skills, and similar job titles. ```APIDOC ## GET /v1/job-title/enrichment ### Description Cleans and enriches job title strings with metadata. ### Method GET ### Endpoint /v1/job-title/enrichment ### Parameters #### Query Parameters - **jobTitle** (string) - Required - The job title to enrich. - **titlecase** (boolean) - Optional - Whether to return the cleaned title in title case. ### Request Example { "jobTitle": "software engineer" } ### Response #### Success Response (200) - **cleaned_job_title** (string) - The standardized title. - **relevant_skills** (array) - List of associated skills. - **similar_job_titles** (array) - List of related titles. #### Response Example { "data": { "cleaned_job_title": "Software Engineer", "relevant_skills": ["Java", "System Design"], "similar_job_titles": ["Software Developer"] } } ``` -------------------------------- ### Initialize PDLJS Client Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Initializes the PDLJS client with an API key. Optionally, the API version can be specified. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY', // Optional: override default API version version: 'v5' }); ``` -------------------------------- ### Execute Company Search using SQL Syntax Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Demonstrates how to perform a company search using the SQL query syntax within the PDLJS SDK. It accepts a search query string and a size parameter, returning the total count of matching records. ```javascript const sqlQuery = "SELECT * FROM company WHERE website='peopledatalabs.com';"; try { const response = await PDLJS.company.search.sql({ searchQuery: sqlQuery, size: 10 }); console.log(response.total); } catch (error) { console.log(error); } ``` -------------------------------- ### Initialize PDLJS Client Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Initializes the People Data Labs JavaScript client with your API key. This client instance is then used to make requests to various PDL API endpoints. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR API KEY' }) ``` -------------------------------- ### Company Search using SQL - JavaScript Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Searches the company dataset using a SQL-like query syntax. Requires an API key and accepts a SQL query string and optional parameters like 'size'. Returns a list of companies matching the query. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); const sqlQuery = ` SELECT * FROM company WHERE tags='big data' AND industry='financial services' AND location.country='united states' `; try { const response = await PDLJSClient.company.search.sql({ searchQuery: sqlQuery, size: 10 }); console.log('Total companies found:', response.total); response.data.forEach(company => { console.log(` ${company.name}`); console.log(` Website: ${company.website}`); console.log(` Industry: ${company.industry}`); console.log(` Size: ${company.size}`); console.log(` Location: ${company.location?.name}`); }); } catch (error) { console.error('Company search failed:', error.message); } ``` -------------------------------- ### Person API: Enrichment and Search Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Demonstrates various ways to interact with the Person API, including single enrichment, preview enrichment, bulk enrichment, SQL search, Elasticsearch search, fuzzy identification, and changelog lookups. Requires a valid API key and handles potential errors. ```javascript // By Enrichment try { const response = await PDLJSClient.person.enrichment({ phone: '4155688415' }); console.log(response); } catch (error) { console.log(error); } ``` ```javascript // By Preview Enrichment try { const response = await PDLJSClient.person.enrichmentPreview({ phone: '4155688415' }); console.log(response); } catch (error) { console.log(error); } ``` ```javascript // By Bulk Enrichment const bulkEnrichmentRecords = { requests: [ { params: { profile: ['linkedin.com/in/seanthorne'], }, }, { params: { profile: ['linkedin.com/in/randrewn'], }, }, ], }; try { const response = await PDLJSClient.person.bulk.enrichment(bulkEnrichmentRecords); console.log(response.items); } catch (error) { console.log(error); } ``` ```javascript // By Search (SQL) const sqlQuery = "SELECT * FROM person WHERE location_country='mexico' AND job_title_role='health'AND phone_numbers IS NOT NULL;" try { const response = await PDLJSClient.person.search.sql({ searchQuery: sqlQuery, size: 10 }); console.log(response.total); } catch (error) { console.log(error); } ``` ```javascript // By Search (Elasticsearch) const esQuery = { query: { bool: { must:[ { term: { location_country: 'mexico' } }, { term: { job_title_role: 'health' } }, { exists: { field: 'phone_numbers' } } ] } } } try { const response = await PDLJSClient.person.search.elastic({ searchQuery: esQuery, size: 10 }); console.log(response.total); } catch (error) { console.log(error); } ``` ```javascript // By Fuzzy Enrichment try { const response = await PDLJSClient.person.identify({ name: 'sean thorne' }); console.log(response); } catch (error) { console.log(error); } ``` ```javascript // By Changelog const personChangelogLookup = { currentVersion: '31.2', originVersion: '32.0', type: 'updated', } try { const response = await PDLJSClient.person.changelog(personChangelogLookup); console.log(response); } catch (error) { console.log(error); } ``` -------------------------------- ### Person Search API using SQL Syntax (JavaScript) Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Searches the person dataset using SQL-like syntax. This method supports complex filtering, pagination, and dataset versioning. It requires an API key and returns a list of matching person records along with total count and a scroll token for pagination. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); const sqlQuery = ` SELECT * FROM person WHERE location_country='mexico' AND job_title_role='health' AND phone_numbers IS NOT NULL `; try { const response = await PDLJSClient.person.search.sql({ searchQuery: sqlQuery, size: 10, titlecase: true }); console.log('Total matching records:', response.total); console.log('Scroll token for pagination:', response.scroll_token); response.data.forEach(person => { console.log(`${person.full_name} - ${person.job_title} at ${person.job_company_name}`); console.log(` Location: ${person.location_name}`); console.log(` Phone: ${person.phone_numbers?.[0]}`); }); } catch (error) { console.error('Search failed:', error.message); } ``` -------------------------------- ### Company API: Enrichment and Search Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Illustrates how to use the Company API for enrichment, bulk enrichment, SQL search, and Elasticsearch search. This includes specifying company identifiers and search criteria. ```javascript // By Enrichment try { const response = await PDLJSClient.company.enrichment({ website: 'peopledatalabs.com' }); console.log(response); } catch (error) { console.log(error); } ``` ```javascript // By Bulk Enrichment const bulkEnrichmentRecords = { requests: [ { params: { profile: 'linkedin.com/in/peopledatalabs', }, }, { params: { profile: 'linkedin.com/in/apple', }, }, ], }; try { const response = await PDLJSClient.company.bulk.enrichment(bulkEnrichmentRecords); console.log(response.items); } catch (error) { console.log(error); } ``` ```javascript // By Search (SQL) const sqlQuery = "SELECT * FROM company WHERE tags='big data' AND industry='financial services' AND location.country='united states';" try { const response = await PDLJSClient.company.search.sql({ searchQuery: sqlQuery, size: 10 }); console.log(response.total); } catch (error) { console.log(error); } ``` ```javascript // By Search (Elasticsearch) const esQuery = { query: { bool: { must:[ { term: { tags: 'big data' } }, { term: { industry: 'financial services' } }, { term: { location_country: 'united states' } } ] } } } try { const response = await PDLJSClient.company.search.elastic({ searchQuery: esQuery, size: 10 }); console.log(response.total); } catch (error) { console.log(error); } ``` -------------------------------- ### POST /v5/company/search/sql Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Search the company dataset using SQL-like query syntax to filter by tags, industry, and location. ```APIDOC ## POST /v5/company/search/sql ### Description Search the company dataset using SQL-like query syntax. ### Method POST ### Endpoint /v5/company/search/sql ### Request Body - **searchQuery** (string) - Required - SQL query string - **size** (integer) - Optional - Number of results to return ### Request Example { "searchQuery": "SELECT * FROM company WHERE tags='big data'", "size": 10 } ### Response #### Success Response (200) - **total** (integer) - Total number of companies found - **data** (array) - List of company objects #### Response Example { "total": 1, "data": [{"name": "People Data Labs", "website": "peopledatalabs.com"}] } ``` -------------------------------- ### Cleaner APIs: Clean Raw Data Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Demonstrates the usage of the Cleaner APIs for various data types, including company names, location strings, and school names. These functions help standardize and clean raw input data. ```javascript // Clean Raw Company Strings try { const response = await PDLJSClient.company.cleaner({ name: 'peOple DaTa LabS' }); console.log(response); } catch (error) { console.log(error); } ``` ```javascript // Clean Raw Location Strings try { const response = await PDLJSClient.location.cleaner({ location: '455 Market Street, San Francisco, California 94105, US' }); console.log(response); } catch (error) { console.log(error); } ``` ```javascript // Clean Raw School Strings try { const response = await PDLJSClient.school.cleaner({ name: 'university of oregon' }); console.log(response); } catch (error) { console.log(error); } ``` -------------------------------- ### Perform Person Identify API Call Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Demonstrates how to call the Person Identify API using the PDLJS library. The method accepts an object containing valid API parameters, such as 'name'. ```javascript PDLJS.person.identify({ name: 'sean thorne' }); ``` -------------------------------- ### Search Person Data via SQL Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Performs a structured search on person records using SQL query syntax. Returns the total count of matching records based on the provided criteria. ```javascript try { const response = await PDLJSClient.person.search.sql({ searchQuery: "SELECT * FROM person WHERE location_country='united states';", size: 10, sandbox: true, }); console.log(response.total); } catch (error) { console.log(error); } ``` -------------------------------- ### IP Enrichment API: Enrich IP Address Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Shows how to enrich an IP address using the IP Enrichment API to retrieve associated data. ```javascript // Enrich an IP Address try { const response = await PDLJSClient.ip({ ip: '72.212.42.228' }); console.log(response); } catch (error) { console.log(error); } ``` -------------------------------- ### POST /person/search/sql Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Search for person records using SQL syntax. ```APIDOC ## POST /person/search/sql ### Description Performs a search for person records using a SQL query string. ### Method POST ### Endpoint /person/search/sql ### Parameters #### Request Body - **searchQuery** (string) - Required - SQL query string. - **size** (integer) - Optional - Number of results to return. - **sandbox** (boolean) - Optional - Use sandbox mode. ### Request Example { "searchQuery": "SELECT * FROM person WHERE location_country='united states';", "size": 10, "sandbox": true } ### Response #### Success Response (200) - **total** (integer) - Total number of matching records. #### Response Example { "total": 100 } ``` -------------------------------- ### Person Search API (SQL) Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Search the person dataset using SQL-like syntax. This endpoint supports complex filtering, pagination, and dataset versioning. ```APIDOC ## Person Search API (SQL) ### Description Search the person dataset using SQL-like syntax. Supports complex filtering, pagination, and dataset versioning. ### Method POST ### Endpoint /v2/person/search/sql ### Parameters #### Query Parameters - **searchQuery** (string) - Required - The SQL-like query string. - **size** (integer) - Optional - The number of records to return per page. - **titlecase** (boolean) - Optional - If true, titlecases fields in the response. ### Request Example ```javascript const sqlQuery = ` SELECT * FROM person WHERE location_country='mexico' AND job_title_role='health' AND phone_numbers IS NOT NULL `; try { const response = await PDLJSClient.person.search.sql({ searchQuery: sqlQuery, size: 10, titlecase: true }); // ... process response } catch (error) { console.error('Search failed:', error.message); } ``` ### Response #### Success Response (200) - **total** (integer) - The total number of matching records. - **scroll_token** (string) - A token for paginating through results. - **data** (array) - An array of person records. #### Response Example ```json { "total": 100, "scroll_token": "some_scroll_token", "data": [ { "full_name": "John Doe", "job_title": "Software Engineer", "job_company_name": "Tech Corp", "location_name": "San Francisco, CA", "phone_numbers": ["+15551234567"] } ] } ``` ``` -------------------------------- ### Search Company Data via SQL Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Queries company records using SQL syntax to filter by tags and industry. Returns the total number of companies matching the criteria. ```javascript const sqlQuery = "SELECT * FROM company WHERE tags='hotel consultant' AND industry='hospitality';"; try { const response = await PDLJSClient.company.search.sql({ searchQuery: sqlQuery, size: 10, sandbox: true }); console.log(response.total); } catch (error) { console.log(error); } ``` -------------------------------- ### Person Identify API - JavaScript Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Fuzzy matches potential person records from incomplete information, returning multiple matches with confidence scores and associated data. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); try { const response = await PDLJSClient.person.identify({ name: 'sean thorne', company: 'people data labs', locality: 'san francisco' }); console.log('Potential matches found:', response.matches.length); response.matches.forEach((match, index) => { console.log(` Match ${index + 1}:`); console.log(' Score:', match.match_score); console.log(' Matched On:', match.matched_on.join(', ')); console.log(' Name:', match.data.full_name); console.log(' Email:', match.data.work_email); console.log(' Title:', match.data.job_title); }); } catch (error) { console.error('Identify failed:', error.message); } ``` -------------------------------- ### POST /company/enrichment Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Enriches company data using a website domain. ```APIDOC ## POST /company/enrichment ### Description Retrieves company details based on a provided website domain. ### Method POST ### Endpoint /company/enrichment ### Parameters #### Request Body - **website** (string) - Required - The company website domain. - **sandbox** (boolean) - Optional - Use sandbox mode. ### Request Example { "website": "kohlerinteriors.com", "sandbox": true } ### Response #### Success Response (200) - **data** (object) - The enriched company profile. #### Response Example { "status": 200, "data": { ... } } ``` -------------------------------- ### Enrich Company Data Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Retrieves comprehensive profile information for a company using its website domain. Requires the PDLJSClient instance. ```javascript try { const response = await PDLJSClient.company.enrichment({ website: 'kohlerinteriors.com', sandbox: true }); console.log(response); } catch (error) { console.log(error); } ``` -------------------------------- ### Bulk Person Retrieve API (JavaScript) Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Retrieves multiple person records by PDL ID in a single request. It takes an array of person IDs and optional filters, returning detailed person data for each. Dependencies include the 'peopledatalabs' JavaScript library. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); const bulkRetrieveRequest = { requests: [ { id: 'qEnOZ5Oh0poWnQ1luFBfVw_0000', metadata: { internal_id: 'A1' } }, { id: 'K5PnOnk1pYmZ0w1quLBfXw_0000', metadata: { internal_id: 'A2' } } ], filter_updated: ['job_change', 'work_email'], titlecase: true }; try { const response = await PDLJSClient.person.bulk.retrieve(bulkRetrieveRequest); console.log('Rate Limit:', response.rateLimit); response.items.forEach(item => { console.log(` Internal ID: ${item.metadata?.internal_id}`); console.log(` Billed: ${item.billed}`); console.log(` Name: ${item.data?.full_name}`); }); } catch (error) { console.error('Bulk retrieve failed:', error.message); } ``` -------------------------------- ### Person Preview Enrichment API - JavaScript Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Previews person enrichment results with limited fields before a full enrichment. Returns boolean indicators for available fields and likelihood score. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); try { const response = await PDLJSClient.person.enrichmentPreview({ phone: '4155688415', min_likelihood: 5 }); // Preview returns full data for key fields console.log('Full Name:', response.data.full_name); console.log('Job Title:', response.data.job_title); console.log('Company:', response.data.job_company_name); console.log('LinkedIn URL:', response.data.linkedin_url); // Other fields show boolean if data exists console.log('Has Emails:', response.data.emails); console.log('Has Phone Numbers:', response.data.phone_numbers); console.log('Likelihood:', response.likelihood); } catch (error) { console.error('Preview failed:', error.message); } ``` -------------------------------- ### Person Changelog API (JavaScript) Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Tracks changes to person records between dataset versions, including additions, updates, deletions, merges, and opt-outs. It requires specifying the current and origin dataset versions and the type of changes to track. The 'peopledatalabs' library is a dependency. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); try { const response = await PDLJSClient.person.changelog({ currentVersion: '31.2', originVersion: '32.0', type: 'updated', fieldsUpdated: ['job_title', 'job_company_name'] }); if (response.data) { console.log('Version Range:', response.data.origin_version, '->', response.data.current_version); console.log('Change Type:', response.data.type); if (response.data.updated) { response.data.updated.forEach(record => { console.log(` Updated ID: ${record.id}`); console.log(' Fields Changed:', record.additional_metadata?.fields_updated?.join(', ')); }); } // Handle pagination if (response.data.scroll_token) { const nextPage = await PDLJSClient.person.changelog({ currentVersion: '31.2', originVersion: '32.0', type: 'updated', scroll_token: response.data.scroll_token }); } } } catch (error) { console.error('Changelog failed:', error.message); } ``` -------------------------------- ### Bulk Company Enrichment API (JavaScript) Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Enriches multiple companies in a single batch request. It accepts an array of company identifiers and returns enriched data for each. This function requires the 'peopledatalabs' JavaScript library and is useful for processing multiple companies efficiently. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); const bulkRequest = { requests: [ { params: { website: 'peopledatalabs.com' }, metadata: { custom_id: 'pdl' } }, { params: { website: 'apple.com' }, metadata: { custom_id: 'apple' } }, { params: { name: 'Google', locality: 'Mountain View' }, metadata: { custom_id: 'google' } } ], titlecase: true }; try { const response = await PDLJSClient.company.bulk.enrichment(bulkRequest); console.log('Rate Limit Remaining:', response.rateLimit.remaining); response.items.forEach(item => { if (item.status === 200) { console.log(` ${item.metadata?.custom_id}: ${item.name}`); console.log(` Industry: ${item.industry}`); console.log(` Size: ${item.size}`); } }); } catch (error) { console.error('Bulk company enrichment failed:', error.message); } ``` -------------------------------- ### Bulk Person Enrichment API (JavaScript) Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Enriches multiple person records in a single API call for efficient batch processing. This method supports custom metadata for tracking requests and requires an API key. It returns the enrichment results for each requested record, including status and data. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); const bulkRequest = { requests: [ { params: { profile: ['linkedin.com/in/seanthorne'] }, metadata: { id: 'user_001' } }, { params: { email: 'john.doe@company.com' }, metadata: { id: 'user_002' } }, { params: { name: 'Jane Smith', company: 'Google', locality: 'Mountain View' }, metadata: { id: 'user_003' } } ], titlecase: true, include_if_matched: true }; try { const response = await PDLJSClient.person.bulk.enrichment(bulkRequest); console.log('Rate Limit Remaining:', response.rateLimit.remaining); response.items.forEach(item => { if (item.status === 200) { console.log(` Metadata: ${JSON.stringify(item.metadata)}`); console.log(` Name: ${item.data.full_name}`); console.log(` Title: ${item.data.job_title}`); console.log(` Likelihood: ${item.likelihood}`); } else { console.log(` Failed: ${JSON.stringify(item.metadata)} - Status: ${item.status}`); } }); } catch (error) { console.error('Bulk enrichment failed:', error.message); } ``` -------------------------------- ### Bulk Person Retrieve API Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Retrieve multiple person records by PDL ID in a single request. This API allows for efficient fetching of several person profiles simultaneously. ```APIDOC ## Bulk Person Retrieve API ### Description Retrieve multiple person records by PDL ID in a single request. ### Method POST ### Endpoint /v2/person/bulk ### Parameters #### Request Body - **requests** (array) - Required - An array of objects, where each object contains an `id` for the person and optional `metadata`. - **filter_updated** (array) - Optional - Filters for specific types of updates. - **titlecase** (boolean) - Optional - Converts output fields to title case. ### Request Example ```json { "requests": [ { "id": "qEnOZ5Oh0poWnQ1luFBfVw_0000", "metadata": { "internal_id": "A1" } }, { "id": "K5PnOnk1pYmZ0w1quLBfXw_0000", "metadata": { "internal_id": "A2" } } ], "filter_updated": ["job_change", "work_email"], "titlecase": true } ``` ### Response #### Success Response (200) - **rateLimit** (object) - Information about the rate limit. - **items** (array) - An array of retrieved person records, each with `metadata`, `billed` status, and `data`. #### Response Example ```json { "rateLimit": { "limit": 100, "remaining": 99, "reset": 1677647999 }, "items": [ { "metadata": { "internal_id": "A1" }, "billed": true, "data": { "full_name": "John Doe", "job_title": "Software Engineer" } }, { "metadata": { "internal_id": "A2" }, "billed": false, "data": { "full_name": "Jane Smith", "job_title": "Data Scientist" } } ] } ``` ``` -------------------------------- ### POST /v5/company/search/elastic Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Search companies using Elasticsearch query DSL for complex filtering requirements. ```APIDOC ## POST /v5/company/search/elastic ### Description Search companies using Elasticsearch query DSL. ### Method POST ### Endpoint /v5/company/search/elastic ### Request Body - **searchQuery** (object) - Required - Elasticsearch query DSL object - **size** (integer) - Optional - Number of results to return - **titlecase** (boolean) - Optional - Whether to return names in titlecase ### Request Example { "searchQuery": {"query": {"term": {"industry": "software"}}}, "size": 20 } ### Response #### Success Response (200) - **total** (integer) - Total matching companies - **data** (array) - List of company objects ``` -------------------------------- ### Person Enrichment API - JavaScript Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Enriches partial person data with complete profile information using various identifiers like email, phone, or LinkedIn profile. Includes error handling for API requests. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); // Enrich person by email try { const response = await PDLJSClient.person.enrichment({ email: 'john.smith@company.com', min_likelihood: 6, required: 'emails', titlecase: true }); console.log('Likelihood:', response.likelihood); console.log('Full Name:', response.data.full_name); console.log('Job Title:', response.data.job_title); console.log('Company:', response.data.job_company_name); console.log('LinkedIn:', response.data.linkedin_url); console.log('Matched On:', response.matched); } catch (error) { console.error('Enrichment failed:', error.message); } // Enrich person by phone number try { const response = await PDLJSClient.person.enrichment({ phone: '4155688415' }); console.log(response.data); } catch (error) { console.error(error); } // Enrich person by LinkedIn profile try { const response = await PDLJSClient.person.enrichment({ profile: 'linkedin.com/in/seanthorne' }); console.log(response.data); } catch (error) { console.error(error); } ``` -------------------------------- ### Identify Person via Fuzzy Enrichment Source: https://github.com/peopledatalabs/peopledatalabs-js/blob/main/README.md Performs a fuzzy identification lookup for a person based on provided attributes like email. Useful for resolving identities with partial information. ```javascript try { const response = PDLJSClient.person.identify({ email: 'reneewillis74@aol.com', sandbox: true }); console.log(response); } catch (error) { console.log(error); } ``` -------------------------------- ### School Cleaner API - JavaScript Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Cleans and standardizes raw school name strings into canonical educational institution records. Accepts a school name and returns standardized school data, including name, website, domain, type, location, and LinkedIn URL. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); try { const response = await PDLJSClient.school.cleaner({ name: 'university of oregon' }); console.log('Cleaned Name:', response.name); console.log('Website:', response.website); console.log('Domain:', response.domain); console.log('Type:', response.type); console.log('Location:', response.location?.name); console.log('LinkedIn:', response.linkedin_url); } catch (error) { console.error('School cleaner failed:', error.message); } ``` -------------------------------- ### Person Retrieve API (JavaScript) Source: https://context7.com/peopledatalabs/peopledatalabs-js/llms.txt Retrieves a complete person record by PDL ID with optional filtering for recently updated fields. This method requires a person's unique PDL ID and an API key. It returns the full person record if found and billed. ```javascript import PDLJS from 'peopledatalabs'; const PDLJSClient = new PDLJS({ apiKey: 'YOUR_API_KEY' }); try { const response = await PDLJSClient.person.retrieve({ id: 'qEnOZ5Oh0poWnQ1luFBfVw_0000', titlecase: true, filter_updated: 'job_change' // Only return if job changed }); if (response.billed) { console.log('Record retrieved and billed'); console.log('Name:', response.data.full_name); console.log('Current Title:', response.data.job_title); console.log('Current Company:', response.data.job_company_name); } } catch (error) { console.error('Retrieve failed:', error.message); } ```