Class: PartyResearch::Adapters::PeopleDataLabs
- Defined in:
- app/services/party_research/adapters/people_data_labs.rb
Overview
People Data Labs (PDL) adapter — identity resolution for individuals AND
small-business firmographics, recommended by the team's enrichment
vendor review (Basecamp todo #9497751860). PDL's coverage complements
our existing adapters:
- Apollo skews enterprise, missed Bob Electric and Metropolitan
Paving entirely; PDL Company Enrichment returned both with
founded year, LinkedIn URL, size, summary, and a website we
didn't have on file. - PDL Person Enrichment takes a personal email and returns
name + social profiles, when the person is in their ~3B index.
Strategy by party type:
- Contact (always a person) → /v5/person/enrich
- homeowner Customer (also a person) → /v5/person/enrich
- company Customer → /v5/company/enrich
Anchor priority:
- Person: email > phone > (name + locality)
- Company: domain (derived from contact emails) > name
Trial-tier caveat: PDL redacts the actual values of phone numbers and
emails on the Person Starter bundle (returns booleans like
phone_numbers: [true] instead of the real number). We only surface
fields that come back as real strings — name corrections, social
URLs, country-level location, company firmographics — and drop
"this field exists but the value is hidden" rows since they're not
actionable.
Auth: X-Api-Key header. Credential at
Heatwave::Configuration.fetch(:peopledatalabs, :api_key).
Constant Summary collapse
- BASE_URL =
'https://api.peopledatalabs.com/v5'- TIMEOUT_SECONDS =
20- LIKELIHOOD_FLOOR =
PDL's
likelihood(0..10) — confidence that the returned record
matches the query. We drop anything below 4 because lower
likelihoods produced "Bob Electric in Brick NJ" when our actual
customer is in Huntington Beach CA. 4
Constants inherited from Base
Base::ALL, Base::PERSONAL_EMAIL_DOMAINS
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
- .configured? ⇒ Boolean
-
.relevant_for?(party) ⇒ Boolean
PDL is useful in two distinct shapes — person enrichment for individuals (Contact rows, homeowner Customers) and company enrichment for non-homeowner Customers.
Instance Method Summary collapse
Methods inherited from Base
adapter_name, arbiter?, #finding, #initialize, lookup, registered
Constructor Details
This class inherits a constructor from PartyResearch::Adapters::Base
Class Method Details
.configured? ⇒ Boolean
54 55 56 |
# File 'app/services/party_research/adapters/people_data_labs.rb', line 54 def configured? Heatwave::Configuration.fetch(:peopledatalabs, :api_key).present? end |
.relevant_for?(party) ⇒ Boolean
PDL is useful in two distinct shapes — person enrichment for
individuals (Contact rows, homeowner Customers) and company
enrichment for non-homeowner Customers. Both are reachable
under the same credential.
62 63 64 65 66 67 |
# File 'app/services/party_research/adapters/people_data_labs.rb', line 62 def relevant_for?(party) return true if party.is_a?(Contact) return false unless party.is_a?(Customer) true end |
Instance Method Details
#findings_for ⇒ Object
70 71 72 73 74 75 76 77 78 |
# File 'app/services/party_research/adapters/people_data_labs.rb', line 70 def findings_for raise ConfigurationError, 'PeopleDataLabs api_key is not configured in Heatwave::Configuration' unless self.class.configured? if company_party? enrich_company else enrich_person end end |