Skip to content

b4dnewz/node-emailhunter

Repository files navigation

hunter.io

NPM version Build Status Dependency Status Coverage percentage

An unofficial NodeJs client for Hunter.io API

NPM

This is a unofficial client for Hunter.io.

Installation

The module is distributed through npm (node package manager) and yast, it can be installed using:

npm install hunter.io

Documentation

This project provides an additional documentation automatically generated with typedoc and based on the original documentation, you can find it at https://b4dnewz.github.io/node-emailhunter/

Looking for the cli tool?

You can install the dedicated cli version of this module, you simply have to install it globally and you are ready to go.

npm install -g hunter.io-cli

The package will register email-hunter command, which is built using commanderjs and provides automatic generated usage documentation for options and sub-commands.

$ email-hunter --help
$ email-hunter <command> --help

In order to use the cli you must use a valid Hunter.io API key.

You can set it in two ways, one is with command options, another is using environment variables, in particular a variable called HUNTERIO_KEY with your private API key, otherwise if not specified, most of the endpoints will fail since requires authentication.

Getting started

Import the module and and create an instance of the hunter:

import EmailHunter from 'hunter.io';
const hunter = new EmailHunter('YOUR API KEY');

Note: You can get the Hunter.io API key in your dashboard: https://hunter.io/api_keys

Methods

The project is TypeScript based and it comes with declaration files, every method signature is well described and can also be found in the online documentation.

  • domainSearch: You give one domain name and it returns all the email addresses using this domain name found on the internet.

  • emailFinder: This API endpoint generates the most likely email address from a domain name, a first name and a last name.

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

  • emailCount: This API endpoint allows you to know how many email addresses we have for one domain.

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

  • leads: The object which contains all the leads methods

    • list: Returns all the leads already saved in your account.
    • retrieve: Retrieves all the fields of a lead.
    • create: Creates a new lead.
    • update: Updates an existing lead.
    • delete: Deletes an existing lead by ID.
  • leadsList: The object which contains all the leads methods

    • list: Returns all the leads lists already saved in your account.
    • retrieve: Retrieves all the fields of a leads list.
    • create: Creates a new leads list.
    • update: Updates an existing leads list.
    • delete: Deletes an existing leads list.

All the methods supports both callback style functions or promises, so for example to get your profile informations you can do:

// with callback
hunter.account((err, result) => { });

// with promises
const data = await hunter.account()

hunter.account().then(data => {
  
})

Contributing

  1. Fork it ( https://github.com/b4dnewz/node-emailhunter/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Write some tests and run (npm run test)
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request

License

The hunter.io is released under the MIT License.