Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
clearbit
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
prospector
clearbit
Commits
5661195b
Commit
5661195b
authored
Oct 10, 2014
by
Ben Drucker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Basic docs for setup, Person, and Company
parent
4dc98af4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
README.md
README.md
+70
-0
No files found.
README.md
View file @
5661195b
clearbit-node [](https://travis-ci.org/bendrucker/clearbit-node) [](https://codeclimate.com/github/bendrucker/clearbit-node) [](https://codeclimate.com/github/bendrucker/clearbit-node)
clearbit-node [](https://travis-ci.org/bendrucker/clearbit-node) [](https://codeclimate.com/github/bendrucker/clearbit-node) [](https://codeclimate.com/github/bendrucker/clearbit-node)
=============
=============
Node library for querying the
[
Clearbit
](
https://clearbit.co
)
business intelligence APIs. Currently supports:
*
[
Person API
](
https://clearbit.co/docs#person-api
)
*
[
Company API
](
https://clearbit.co/docs#company-api
)
# Setup
```
bash
$
npm
install
clearbit
```
```
js
var
clearbit
=
require
(
'clearbit'
)(
'api_key'
);
// or
var
Client
=
require
(
'clearbit'
).
Client
;
var
clearbit
=
new
Client
({
key
:
'api_key'
});
```
## Person
#### `Person.find(options)` -> `Promise`
*
`email`
*String*
: The email address to look up
**(required)**
*
`webhook_id`
*String*
: Custom identifier for the webhook request
*
`subscribe`
*Boolean*
: Set to
`true`
to subscribe to the changes
*
`company`
*Boolean*
: Set to
`true`
to include a company lookup on the email’s domain name in the response
*
`stream`
*Boolean*
: Set to
`true`
to use the
[
streaming API
](
https://clearbit.co/docs?shell#streaming
)
instead of webhooks
```
js
var
Person
=
clearbit
.
Person
;
Person
.
find
({
email
:
'email@domain.com'
})
.
then
(
function
(
person
)
{
if
(
!
person
.
pending
())
{
console
.
log
(
'Name: '
,
person
.
name
.
fullName
);
}
})
.
catch
(
Person
.
NotFoundError
,
function
(
err
)
{
console
.
log
(
err
);
// Person could not be found
})
.
catch
(
function
(
err
)
{
console
.
log
(
'Bad/invalid request, unauthorized, Clearbit error, or failed request'
);
});
```
#### `person.pending()` -> `Boolean`
If Clearbit responds with a
`202`
status indicating that lookup has been queued,
`person.pending`
returns
`true`
.
## Company
#### `Company.find(options)` -> `Promise`
*
`domain`
*String*
: The company domain to look up
**(required)**
*
`webhook_id`
*String*
: Custom identifier for the webhook request
*
`stream`
*Boolean*
: Set to
`true`
to use the
[
streaming API
](
https://clearbit.co/docs?shell#streaming
)
instead of webhooks
```
js
var
Company
=
clearbit
.
Company
;
Company
.
find
({
domain
:
'www.uber.com'
})
.
then
(
function
(
company
)
{
if
(
!
company
.
pending
())
{
console
.
log
(
'Name: '
,
company
.
name
);
}
})
.
catch
(
Company
.
NotFoundError
,
function
(
err
)
{
console
.
log
(
err
);
// Company could not be found
})
.
catch
(
function
(
err
)
{
console
.
log
(
'Bad/invalid request, unauthorized, Clearbit error, or failed request'
);
});
```
#### `company.pending()` -> `Boolean`
If Clearbit responds with a
`202`
status indicating that lookup has been queued,
`company.pending`
returns
`true`
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment