https://github.com/thoughtbot/clearbit
Go client library and command line interface to the Clearbit API
https://github.com/thoughtbot/clearbit
Last synced: 5 months ago
JSON representation
Go client library and command line interface to the Clearbit API
- Host: GitHub
- URL: https://github.com/thoughtbot/clearbit
- Owner: thoughtbot
- License: mit
- Archived: true
- Created: 2016-02-24T18:14:03.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-08-14T19:50:23.000Z (almost 9 years ago)
- Last Synced: 2025-04-17T23:07:58.737Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 52.7 KB
- Stars: 30
- Watchers: 8
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
clearbit
========
[][GoDoc]
[](https://circleci.com/gh/thoughtbot/clearbit)
`clearbit` is a client library and command-line interface
for the [Clearbit] API.
[Clearbit]: https://clearbit.com/
Install for the command line
----------------------------
For OS X users, you can install and upgrade through the Homebrew package:
```
brew tap thoughtbot/formulae
brew update
brew install clearbit
```
Or, for anyone with Go installed, you can install from the command-line:
```
go get -u github.com/thoughtbot/clearbit/cmd/clearbit
```
Then, store your [Clearbit API key][clearbit-api-key] in `~/.clearbit_key`.
Usage from the command line
---------------------------
Use the subcommands to interact with the different
[Clearbit API endpoints][clearbit-api].
Get detailed information about a person from their email address:
```
$ clearbit enrich b@thoughtbot.com
```
Get data about a company from its domain:
```
$ clearbit enrich thoughtbot.com
```
Get contact details for a company ([role & seniority picklist][role-seniority]):
```
$ clearbit prospect -role marketing -seniority executive thoughtbot.com
```
Since each command produces JSON as its output,
the `clearbit` command pairs nicely with [`jq`][jq] for processing.
Get company copy-pasteable company contacts:
```
$ clearbit prospect thoughtbot.com |
jq '.[] | "\(.name.fullName) <\(.email)>"'
```
Run `clearbit help [subcommand]` for details on additional options.
[clearbit-api]: https://clearbit.com/docs
[clearbit-api-key]: https://dashboard.clearbit.com/keys
[jq]: https://stedolan.github.io/jq/
Usage from Go
-------------
The `clearbit` package exposes types for interacting with the Clearbit API and
the data it returns.
```go
import "github.com/thoughtbot/clearbit"
client, _ := clearbit.NewClient(os.Getenv("CLEARBIT_API_KEY"))
bernerd, _ := client.EnrichPerson("b@thoughtbot.com")
thoughtbot, _ := client.EnrichCompany(bernerd.Employment.Domain)
prospects, _ := client.Prospect(clearbit.ProspectQuery{
Domain: "thoughtbot.com",
Titles: []string{"CEO", "CTO", "VP"},
})
for _, prospect := range prospects {
prospectDetails, _ := client.EnrichPerson(prospect.Email)
}
```
For detailed API documentation, [read the go docs][GoDoc].
[GoDoc]: https://godoc.org/github.com/thoughtbot/clearbit
Contributing
------------
We love pull requests from everyone.
By participating in this project,
you agree to abide by the thoughtbot [code of conduct].
[code of conduct]: https://thoughtbot.com/open-source-code-of-conduct
We expect everyone to follow the code of conduct
anywhere in thoughtbot's project codebases,
issue trackers, chatrooms, and mailing lists.
License
-------
`clearbit` is Copyright (c) 2016 thoughtbot, inc. It is free software,
and may be redistributed under the terms specified in the [LICENSE] file.
[LICENSE]: /LICENSE
About
-----
`clearbit` is maintained by Bernerd Schaefer and [thoughtbot's Go development team].
[thoughtbot's Go development team]: "Go development team | Hire thoughtbot Gophers"

The names and logos for thoughtbot are trademarks of thoughtbot, inc.
We love open source software!
See [our other projects][community]
or [hire us][hire] to help build your product.
[community]: https://thoughtbot.com/community?utm_source=github
[hire]: https://thoughtbot.com/hire-us?utm_source=github
[role-seniority]: http://support.clearbit.com/article/120-employment-role-and-seniority