SDKs overview

Hunter.io provides programmatic access to its email-related services, including Email Finder, Email Verifier, and Domain Search, through a RESTful API. To facilitate integration, Hunter.io offers official SDKs in several popular programming languages. These SDKs encapsulate the underlying HTTP requests and response parsing, allowing developers to interact with the API using native language constructs rather than direct HTTP client operations. This approach can reduce development time and potential error points by providing pre-built functions for common API calls.

The API operates using API keys for authentication, which are typically passed as a query parameter or an HTTP header with each request. The official documentation provides comprehensive details on API endpoints, request parameters, and response structures (Hunter.io API documentation). While official SDKs are the primary recommendation for integration, the RESTful nature of the API also allows for direct HTTP requests using any programming language or tool capable of making web requests, such as the curl command-line tool or HTTP client libraries like Python's requests or Node.js's axios.

Beyond the official offerings, the developer community has also contributed various libraries and wrappers for specific use cases or languages not officially supported. These community-driven projects can offer alternative integration paths, though their maintenance and feature parity with the official API may vary.

Official SDKs by language

Hunter.io maintains official client libraries for several programming languages, designed to simplify interaction with their API. These libraries handle aspects such as API key authentication, request formatting, and response parsing. The following table outlines the key official SDKs available:

Language Package Name Installation Command Maturity / Status
Python hunterio pip install hunterio Actively maintained
PHP hunterio/hunterio-php composer require hunterio/hunterio-php Actively maintained
Ruby hunterio gem install hunterio Actively maintained
Node.js hunter.io npm install hunter.io Actively maintained

Installation

Installation of Hunter.io's official SDKs typically follows the standard package management practices for each respective language. Below are detailed instructions for the primary supported languages:

Python

The Python SDK can be installed using pip, the standard package installer for Python (Python pip documentation).

pip install hunterio

PHP

For PHP, Composer is used to manage dependencies (Composer documentation). Ensure Composer is installed before running the command.

composer require hunterio/hunterio-php

Ruby

RubyGems is the package manager for Ruby. The SDK can be installed using the gem command.

gem install hunterio

Node.js

Node.js packages are managed via npm. The Hunter.io package can be installed with the following command:

npm install hunter.io

Quickstart example

This example demonstrates how to use the Hunter.io Python SDK to find email addresses associated with a domain and verify an email address. You will need a Hunter.io API key, which can be obtained from your Hunter.io dashboard.

Python Email Finder and Verifier

First, ensure you have installed the Python SDK as described in the installation section.

from hunterio import HunterIO

# Replace 'YOUR_API_KEY' with your actual Hunter.io API key
api_key = 'YOUR_API_KEY'
hunter = HunterIO(api_key=api_key)

# --- Domain Search Example ---
domain_to_search = 'example.com'
print(f"Searching emails for domain: {domain_to_search}")
try:
    domain_search_result = hunter.domain_search(domain=domain_to_search)
    if domain_search_result and 'data' in domain_search_result and 'emails' in domain_search_result['data']:
        for email_data in domain_search_result['data']['emails']:
            print(f"  Found Email: {email_data['value']} (Type: {email_data['type']})")
    else:
        print(f"  No emails found for {domain_to_search}")
except Exception as e:
    print(f"Error during domain search: {e}")

print("\n" + "-"*30 + "\n")

# --- Email Verifier Example ---
email_to_verify = '[email protected]'
print(f"Verifying email: {email_to_verify}")
try:
    email_verifier_result = hunter.email_verifier(email=email_to_verify)
    if email_verifier_result and 'data' in email_verifier_result and 'status' in email_verifier_result['data']:
        print(f"  Verification Status for {email_to_verify}: {email_verifier_result['data']['status']}")
        if 'result' in email_verifier_result['data']:
            print(f"  Result: {email_verifier_result['data']['result']}")
        if 'score' in email_verifier_result['data']:
            print(f"  Score: {email_verifier_result['data']['score']}")
    else:
        print(f"  Could not retrieve verification status for {email_to_verify}")
except Exception as e:
    print(f"Error during email verification: {e}")

This Python script initializes the Hunter.io client with your API key, then performs a domain search to find email addresses and subsequently verifies a specific email address. The output will show the discovered emails and the verification status and score for the specified email.

Community libraries

While Hunter.io provides official SDKs, the open nature of RESTful APIs encourages community contributions. Developers often create libraries for languages not officially supported, or develop specialized wrappers that cater to particular frameworks or use cases. These community-maintained libraries can offer additional flexibility or features, but it is important to consider their maintenance status, documentation quality, and alignment with the latest API versions.

For example, a developer might create a Ruby on Rails gem that integrates Hunter.io services directly into an ActiveRecord model, or a Go package for high-performance concurrent email verification. When evaluating a community library, checking its GitHub repository for recent commits, open issues, and pull requests can provide insight into its active development and community support. Always refer to the specific library's documentation for installation and usage instructions, as they can differ significantly from the official SDKs.

Due to the dynamic nature of community projects, a comprehensive, up-to-date list is best found by searching platforms like GitHub or package repositories (e.g., PyPI for Python, npm for Node.js) using terms like "hunter.io api client" or "hunter.io sdk [language name]". It is recommended to consult the official Hunter.io API documentation to understand the core API functionality before relying on third-party integrations.