0.0
The project is in a healthy, maintained state
People Data Labs builds people data. Use our dataset of 1.5 Billion unique person profiles to build products, enrich person profiles, power predictive modeling/ai, analysis, and more.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

~> 2.3
~> 13.0
~> 3.0

Runtime

~> 5.0
 Project Readme

People Data Labs Logo

People Data Labs Ruby Library

Official Ruby client for the People Data Labs API.

Repo Status   People Data Labs on RubyGems   Tests Status

This is a simple Ruby client library to access the various API endpoints provided by People Data Labs.

This library bundles up PDL API requests into simple function calls, making it easy to integrate into your projects. You can use the various API endpoints to access up-to-date, real-world data from our massive Person and Company Datasets.

Table of Contents

  • 🔧 Installation
  • 🚀 Usage
  • 🌐 Endpoints
  • 📘 Documentation

Installation

  1. Add this line to your application's Gemfile:
gem 'peopledatalabs'
  1. And then execute:
$ bundle

Or install it yourself as:

$ gem install peopledatalabs
  1. Sign up for a free PDL API key

🚀 Usage

First, add your API Key:

Peopledatalabs.api_key = 'api_key'

Then, send requests to any PDL API Endpoint:

Getting Person Data

# By Enrichment
Peopledatalabs::Enrichment.person(params: { phone: '4155688415' })

# By Bulk Enrichment
Peopledatalabs::Bulk.people(params: {requests: [{params: {profile: ['linkedin.com/in/seanthorne']}}, {params: {profile: ['linkedin.com/in/randrewn']}}]})

# By Search (SQL)
Peopledatalabs::Search.people(searchType: 'sql', query: "SELECT * FROM person WHERE job_company_name='people data labs'")

# By Search (Elasticsearch)
Peopledatalabs::Search.people(searchType: 'elastic', query: {"query": {"term": {"job_company_name": "people data labs"}}})

# By PDL_ID
Peopledatalabs::Retrieve.person(person_id: 'qEnOZ5Oh0poWnQ1luFBfVw_0000')

# By Fuzzy Enrichment
Peopledatalabs::Identify.person(params: { name: 'sean thorne' })

Getting Company Data

# By Enrichment
Peopledatalabs::Enrichment.company(params: { website: 'peopledatalabs.com' })

# By Search (SQL)
Peopledatalabs::Search.company(searchType: 'sql', query: "SELECT * FROM company WHERE tags='big data' AND industry='financial services' AND location.country='united states'")

# By Search (Elasticsearch)
Peopledatalabs::Search.company(searchType: 'elastic', query: {"query": "must": [{"term": {"tags": "big data"}}, {"term": {"industry": "financial services"}}, {"term": {"location_country": "united states"}}]})

Using Supporting APIs

# Get Autocomplete Suggestions
Peopledatalabs::Autocomplete.retrieve(field: 'title', text: 'full', size: 10)

# Clean Raw Company Strings
Peopledatalabs::Cleaner.company(kind: 'name', value: 'peOple DaTa LabS')

# Clean Raw Location Strings
Peopledatalabs::Cleaner.location(value: '455 Market Street, San Francisco, California 94105, US')

# Clean Raw School Strings
Peopledatalabs::Cleaner.school(kind: 'name', value: 'university of oregon')

🌐 Endpoints

Person Endpoints

API Endpoint peopledatalabs Function
Person Enrichment API Peopledatalabs::Enrichment.person(...params)
Person Bulk Person Enrichment API Peopledatalabs::Bulk.people(...records)
Person Search API Peopledatalabs::Search.person(...params)
Person Retrieve API Peopledatalabs::Autocomplete.retrieve(...params)
Person Identify API Peopledatalabs::Identify.person(...params)

Company Endpoints

API Endpoint peopledatalabs Function
Company Enrichment API Peopledatalabs::Enrichment.company(...params)
Company Search API Peopledatalabs::Search.company(...params)

Supporting Endpoints

API Endpoint peopledatalabs Function
Autocomplete API Peopledatalabs::Autocomplete.retrieve(...params)
Company Cleaner API Peopledatalabs::Cleaner.company(...params)
Location Cleaner API Peopledatalabs::Cleaner.location(...params)
School Cleaner API Peopledatalabs::Cleaner.school(...params)

📘 Documentation

All of our API endpoints are documented at: https://docs.peopledatalabs.com/

These docs describe the supported input parameters, output responses and also provide additional technical context.

As illustrated in the Endpoints section above, each of our API endpoints is mapped to a specific method in the peopledatalabs class. For each of these class methods, all function inputs are mapped as input parameters to the respective API endpoint, meaning that you can use the API documentation linked above to determine the input parameters for each endpoint.

As an example:

The following is valid because name is a supported input parameter to the Person Identify API:

Peopledatalabs::Identify.person(params: { name: 'sean thorne' })

Conversely, this would be invalid because fake_parameter is not an input parameter to the Person Identify API:

Peopledatalabs::Identify.person(params: { fake_parameter: 'anything' })