Node library for querying the Clearbit business intelligence APIs. Currently supports:
Setup
$ npm install clearbit
var clearbit = 'api_key';// orvar Client = Client;var clearbit = key: 'api_key';
Performing Lookups
Person
Person.find(options)
-> Promise
email
String: The email address to look up (required)webhook_id
String: Custom identifier for the webhook requestsubscribe
Boolean: Set totrue
to subscribe to the changesstream
Boolean: Set totrue
to use the streaming API instead of webhookstimeout
Integer: The timeout in milliseconds after which a socket closed error will be thrown.
var Person = clearbitPerson;Person ;
Company
Company.find(options)
-> Promise
domain
String: The company domain to look up (required)webhook_id
String: Custom identifier for the webhook requeststream
Boolean: Set totrue
to use the streaming API instead of webhookstimeout
Integer: The timeout in milliseconds after which a socket closed error will be thrown.
var Company = clearbitCompany;Company ;
NameToDomain
NameToDomain.find(options)
-> Promise
name
String: The company name to look up (required)timeout
Integer: The timeout in milliseconds after which a socket closed error will be thrown.
var NameToDomain = clearbitNameToDomain;NameToDomain ;
Prospector
Prospector.search(options)
-> Promise
domain
String: The domain to search for. (required)role
String: Employment role to filter by.roles
Array[String]: Employment roles to filter by.seniority
String: Employment seniority to filter by.seniorities
Array[String]: Employment seniorities to filter by.title
String: Job title to filter by.titles
Array[String]: Job titles to filter by.city
String: City to filter by.cities
Array[String]: Cities to filter by.state
String: State to filter by.states
Array[String]: States to filter by.country
String: Country to filter by.countries
Array[String]: Countries to filter by.name
String: Name of an individual to filter by.page
Integer: The page of results to fetch.page_size
Integer: The number of results per page.suppression
String: Set toeu
to exclude records with country data in the EU. Set toeu_strict
to exclude records with country data in the EU or with null country data.
var Prospector = clearbitProspector;Prospector ;
Error Handling
Lookups return Bluebird promises. Any status code >=400 will trigger an error, including lookups than do not return a result. You can easily filter out unknown records from true errors using Bluebird's error class matching:
Person ;
Callbacks
If you really want to use node-style callbacks, use Bluebird's nodeify method:
Person;