Giter Site home page Giter Site logo

pyhunter's Introduction

PyPI version

PyHunter

A Python wrapper for the Hunter.io v2 API

Installation

Requirements:

  • Python 3 (no Python 2 version, c'mon, we're in 2020!)

To install:

pip install pyhunter

Usage

PyHunter supports all the methods from the Hunter.io v2 API:

  • domain_search
  • email_finder
  • email_verifier
  • email_count
  • account_information

PyHunter also supports new methods from the Leads and Leads Lists APIs.

How to use PyHunter

Import the PyHunter and instantiate it:

from pyhunter import PyHunter
hunter = PyHunter('my_hunter_api_key')

You can search all the email adresses for a given domain:

hunter.domain_search('instagram.com')

You can also pass the company name, along with optional parameters:

hunter.domain_search(company='Instragram', limit=5, offset=2, emails_type='personal')

You can find a specific email adress:

email, confidence_score = hunter.email_finder('instragram.com', first_name='Kevin', last_name='Systrom')

You can also use the company name and the full name instead, along with raw to get the full response:

hunter.email_finder(company='Instragram', full_name='Kevin Systrom', raw=True)

You can check the deliverability of a given email adress:

hunter.email_verifier('[email protected]')

You can check how many email addresses Hunter has for a given domain:

hunter.email_count('instagram.com')

You can also use a company name if the domain is unknown::

hunter.email_count(company='Instagram')

When both domain and company are passed, the domain will be used:

hunter.email_count(domain='instagram.com', company='Instagram')

And you can finally check your account information (PyHunter adds the number of calls still available in the payload):

hunter.account_information()

NOTE: By default, all of the calls (except email_verifier()) return the 'data' element of the JSON response. You can get the "raw" response by passing raw=True to those calls. This gives access to the response headers, e.g. X-RateLimit-Remaining returned for the domain_search() call, and also the complete response body, including meta.

But that's not all folks! As the v2 API added Leads and Leads Lists, these methods are also available on PyHunter

Leads methods

You can get all your leads:

hunter.get_leads()

Or filter the leads you want using these arguments:

hunter.get_leads(offset=2, limit=10, lead_list_id=1, first_name='Kevin', last_name='Systrom', email='[email protected]', company='Instagram', phone_number='0102030405', twitter='kevin')

You can also get a specific lead by giving its id:

hunter.get_lead(42)

You can create a lead:

hunter.create_lead('Quentin', 'Durantay', email='[email protected]', position='CEO', company='Unicorn Consulting', company_size=10, confidence_score=100, website='unicornsaregreat.io', contry_code='FR', postal_code=75000, source='theinternet.com', linkedin_url='www.linkedin.com/in/masteroftheuniverse', phone_number=0102030405, twitter='quentindty', leads_list_id=1)

You can update a lead by giving its id and the parameters to change (same as creation):

hunter.update_lead(1, position='CEO in chief')

And you can also delete a lead by giving its id:

hunter.delete_lead(42)

Leads Lists methods

You can get all your Leads Lists:

hunter.get_leads_lists()

And filter the results with these arguments:

hunter.get_leads_lists(offset=3, limit=2)

You can get a specific Leads List by giving its id:

hunter.get_leads_list(42)

You can create a Leads Lists:

hunter.create_leads_list('Ultra hot prospects', team_id=1)

You can update a Leads List by giving its id:

hunter.update_leads_list(42, 'Ultra mega hot prospects', team_id=2)

And you can finally delete a Leads Lists by giving its id:

hunter.delete_leads_list(42)

Information

This library is still in development, don't hesitate to share bugs if you find some (nomally it's good, but you never know :p ).

Contribute

It's my first (ever) open-source library! So it can be improved. Feel very welcome to fork it and ask for pull requests if you find something buggy or lacking ;)

Have a nice day scraping B2B emails with PyHunter!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.