messerli90/hunterio

Laravel wrapper to discover email addresses throgh the Hunter.io API

1.0.1 2020-06-27 05:42 UTC

This package is auto-updated.

Last update: 2020-06-27 05:45:09 UTC


README

Latest Version on Packagist Build Status Quality Score Total Downloads

Using this package you can easily query the Hunter.io API.

Here are some examples of the provided methods:

use Hunter;

// Retrieve email addresses of people with a marketing title from ghost.org
Hunter::domainSearch()->domain('ghost.org')->department('marketing')->get();

// Find an email address belonging to John Doe working at Ghost
Hunter::emailFinder()->company('Ghost')->name('John Doe')->get();

Installation

Requires Laravel 7+ and PHP 7.3+

You can install the package via composer:

composer require messerli90/hunterio

You'll need an API key from Hunter.io

Optionally, you can publish the config file of this package with this command:

php artisan vendor:publish --provider="Messerli90\Hunterio\HunterServiceProvider"

or, manually add it to your config/services.php file

[
    ...
    'hunter' => [
        'key' => env('HUNTER_API_KEY')
    ]
]

Usage

Read the Hunter.io API Documentation to check how to handle each endpoint's response.

Domain Search

Search all the email addresses corresponding to one website.

// Search by company name or website
Hunter::domainSearch()->company('Ghost')->get();
Hunter::domainSearch()->domain('ghost.org')->get();

// Narrow your search by chaining attributes
$query = Hunter::domainSearch()->company('Ghost')->domain('ghost.org')
    ->seniority(['senior', 'executive'])->department('marketing')
    ->limit(5)->skip(5)->type('personal')
    ->get();

Email Finder

This API endpoint generates or retrieves the most likely email address from a domain name, a first name and a last name.

// Search by first and last name
Hunter::emailFinder()->domain('ghost.org')->name('John', 'Doe')->get();

// or use a single string to search by 'full name'
Hunter::emailFinder()->company('Ghost')->name('John Doe')->get();

Email Count

This API endpoint allows you to know how many email addresses we have for one domain or for one company. It's free and doesn't require authentication.

This endpoint is public does not require an API key

Hunter::emailCount()->domain('ghost.org')->get();

// Narrow search to only 'personal' addresses
Hunter::emailCount()->domain('ghost.org')->type('personal')->get();

Email Verifier

This API endpoint allows you to verify the deliverability of an email address.

Hunter::emailVerifier()->verify('steli@close.io');

Email Verifier

This API endpoint enables you to get information regarding your Hunter account at any time.

Hunter::account();

Testing

./vendor/bin/phpunit

Roadmap

  • Domain Search
  • Email Finder
  • Email Verifier
  • Email Count
  • Account Information
  • Leads
  • Leads List

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please tweet me at @michaelmesserli instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.