Coder Social home page Coder Social logo

hunterio's Introduction

Hunter.io

A PHP wrapper for Hunter v2 API.

Getting Started

Initialization

use Hiraya\Hunter;

$hunter = new Hunter();

API Calls

Domain Search

The Domain Search returns all the email addresses found using one given domain name, with sources.

$hunter->searchDomain('hirayasolutions.co.nz');

You can add optional parameters by passing an array

$hunter->searchDomain('hirayasolutions.co.nz', ['limit' => 20, 'offset' => 1]);

Email Finder

This API Call guesses the most likely email of a person using his/her first name, last name and a domain name

$hunter->findEmail('hirayasolutions.co.nz', 'EJ', 'Ramos');

Email Verifier

This API Call checks the deliverability of a given email address, verifies if it has been found in our database, and returns their sources.

$hunter->verifyEmail('[email protected]');

Email Count

This API Call 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.

$hunter->countEmail('hirayasolutions.co.nz');

Account Information

This API Call enables you to get information regarding your Hunter account at any time. This call is free.

$hunter->displayAccount();

List all your leads

Returns all the leads already saved in your account. The leads are returned in sorted order, with the most recent leads appearing first.

$hunter->listLeads();

Get a lead

Retrieves all the fields of a lead.

$hunter->getLead(100128);

Create a lead

Creates a new lead. The parameters must be passed as a JSON hash.

$hunter->createLead([
    'email' => '[email protected]',
    'first_name' => 'EJ',
    'last_name' => 'Ramos',
    'company' => 'Hiraya Solutions',
]);

Update a lead

Updates an existing lead. The updated values must be passed as a JSON hash.

$hunter->updateLead(100128, [
    'email' => '[email protected]',
    'first_name' => 'EJ',
    'last_name' => 'Ramos',
    'company' => 'Hiraya Solutions',
]);

Delete a lead

Deletes an existing lead.

$hunter->deleteLead(100128);

API Reference

https://hunter.io/api/v2/docs

hunterio's People

Contributors

saintsweeto avatar

Stargazers

 avatar  avatar

Forkers

xitude

hunterio's Issues

Usage question

In the example case of ...

$hunter->findEmailByDomain('forrester.com', 'Brendan Witcher');

... how would you then access the output via PHP?

{
    "data": {
        "first_name": "brendan",
        "last_name": "witcher",
        "email": "[email protected]",
        "score": 84,
        "domain": "forrester.com",
        "position": null,
        "twitter": null,
        "linkedin_url": null,
        "phone_number": null,
        "company": "Forrester",
        "sources": []
    },
    "meta": {
        "params": {
            "first_name": null,
            "last_name": null,
            "full_name": "Bredan Witcher",
            "domain": "forrester.com",
            "company": null
        }
    }
}

Usage question v2

Hi, an awesome wrapper you got here & thanks for the recent update.

Having said that, I'm having trouble getting a good response from Hunter. I always get an empty response when trying to do searchDomain & I hope you could help me out as maybe other newbies might find this useful.

I have a function in my controller that looks like this (my-api-key is set):

public function hunterDS(Request $request) {
        $domains = preg_split('/\\s/', $request->input('domain'));
        $hunter = new Hunter('my-api-key');
        $hunter->searchDomain($domains, ['limit' => 5]);
        dd($hunter);
}

dd($hunter) dumps this:
Screen Shot 2019-12-12 at 3 05 31 PM

As you can notice there's no "domain" key in this query but I can see the requested domain in the browser URI.

Am I adding my api key the correct way or should it be added somewhere in hunter.php?

@saintsweeto

Need to Pass Params

There are many parameters that need to be passed.

For instance, limit (otherwise defaults to 10) and offset to get more results.

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.