Skip to content

clearbit/clearbit-python

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
November 7, 2018 09:18
December 8, 2014 16:16
November 30, 2018 16:20
October 22, 2017 17:15
September 15, 2015 11:56

Clearbit

A Python API client to https://clearbit.com.

Maintenance Status

This repository is currently not actively maintained. If you're looking to integrate with Clearbit's API we recommend looking at the HTTP requests available in our documentation at clearbit.com/docs

Installation

To install the Clearbit Python bindings, run:

pip install clearbit

Or

easy_install clearbit

Usage

First authorize requests by setting the API key found on your account's settings page.

import clearbit
clearbit.key = 'mykey'

You can also set the API key via the CLEARBIT_KEY environment variable.

Then you can lookup people by email address. If the email's domain is corporate we'll also return a company response.

response = clearbit.Enrichment.find(email='alex@clearbit.com', stream=True)

See the documentation for more information.

Company lookup

You can lookup company data by domain name:

company = clearbit.Company.find(domain='uber.com',stream=True)

If the company can't be found, then None will be returned.

See the documentation for more information.

Name to Domain

You can search for companies using name as a keyword:

response = clearbit.NameToDomain.find(name='Clearbit')

See the documentation for more information.

Proxy Usage

Passing a proxies dictionary allows you to specify proxy servers to pass the requests through given various protocols.

proxies = {
  'http': 'http://user:password@proxyserver.tld:8080',
  'https': 'https://user:password@proxyserver.tld:8080',
}

response = clearbit.Enrichment.find(email='alex@clearbit.com', proxies=proxies)

Testing

Set the PYTHONPATH env var to the current directory to load the library locally:

export PYTHONPATH=.

Deploy