A lightweight Ruby wrapper around Hunter.io (formerly Email Hunter) API, providing direct access to email search, verification, and company insights.
Add this line to your application's Gemfile:
gem 'emailhunter'Then execute:
$ bundle installOr install it yourself with:
$ gem install emailhunterrequire 'emailhunter'
email_hunter = EmailHunter.new('Your API Key')Your API key can be generated in your Hunter dashboard.
Core APIs:
- Domain Search API - Retrieve all email addresses associated with a domain
- Email Verification API - Check the deliverability of an email address
- Email Finder API - Find the most likely email using name and domain
- Count API - Get the number of email addresses for a domain (FREE)
- Account Information API - Retrieve details about your Hunter account
- Company Information API - Get company details using a domain name
- People Search API - Find key individuals associated with a company
Retrieve all email addresses associated with a given domain.
result = email_hunter.search('stripe.com')result.fetch(:meta)
result.fetch(:webmail)
result.fetch(:emails)
result.fetch(:pattern)
result.fetch(:domain)Check the deliverability of an email address.
result = email_hunter.verify('[email protected]')result.fetch(:result)
result.fetch(:score)
result.fetch(:regexp)
result.fetch(:gibberish)
result.fetch(:disposable)
result.fetch(:mx_records)
result.fetch(:smtp_server)
result.fetch(:smtp_check)
result.fetch(:accept_all)
result.fetch(:sources)
result.fetch(:meta)Guess the most likely email of a person using their first name, last name, and domain.
result = email_hunter.finder('gmail.com', 'Davide', 'Santangelo')result.fetch(:email)
result.fetch(:score)
result.fetch(:sources)
result.fetch(:domain)
result.fetch(:meta)Retrieve the number of email addresses associated with a domain (FREE API call).
result = email_hunter.count('gmail.com')result.fetch(:data)
result.fetch(:meta)Retrieve company details using a domain name.
result = email_hunter.company('stripe.com')result.fetch(:name)
result.fetch(:industry)
result.fetch(:employees)
result.fetch(:country)
result.fetch(:meta)Retrieve key individuals associated with a company based on a domain name.
result = email_hunter.people('stripe.com')result.fetch(:employees)
result.fetch(:position)
result.fetch(:email)
result.fetch(:meta)Search for companies using natural language queries.
result = email_hunter.discover('US-based Software companies', limit: 10)result.data # Array of companies
result.meta.fetch(:results)
result.meta.fetch(:limit)
result.meta.fetch(:offset)Manage your leads stored in Hunter.
result = email_hunter.leads(limit: 20, offset: 0)lead_data = {
email: '[email protected]',
first_name: 'John',
last_name: 'Doe',
company: 'Example Inc',
position: 'CEO'
}
result = email_hunter.lead_create(lead_data)update_data = { position: 'CTO' }
result = email_hunter.lead_update(lead_id, update_data)success = email_hunter.lead_delete(lead_id)result.data.leads # Array of lead objects
result.data.leads.first.email
result.data.leads.first.company
result.meta.fetch(:count)Manage your email campaigns and recipients.
result = email_hunter.campaigns(limit: 20)result = email_hunter.campaign_recipients(campaign_id, limit: 20)recipient_data = {
email: '[email protected]',
first_name: 'John',
last_name: 'Doe'
}
result = email_hunter.campaign_add_recipient(campaign_id, recipient_data)success = email_hunter.campaign_delete_recipient(campaign_id, '[email protected]')result.data.campaigns # Array of campaign objects
result.data.recipients # Array of recipient objects
result.meta.fetch(:limit)Enrich person data with 100+ attributes using email or LinkedIn.
# Using email
result = email_hunter.lead_enrichment(email: '[email protected]')
# Using LinkedIn
result = email_hunter.lead_enrichment(linkedin: 'matttharp')result.data.name.fullName
result.data.email
result.data.location
result.data.timeZone
result.data.employment.domain
result.data.employment.title
result.data.employment.name
result.data.twitter.handle
result.data.linkedin.handle
result.meta.fetch(:email)Enrich company data with detailed firmographic information.
result = email_hunter.company_enrichment('stripe.com')result.data.name
result.data.description
result.data.foundedYear
result.data.location
result.data.category.industry
result.data.metrics.employees
result.data.tech # Array of technologies used
result.data.site.emailAddresses
result.meta.fetch(:domain)Get both lead and company data in a single call.
result = email_hunter.combined_enrichment(email: '[email protected]')result.lead.data # Lead enrichment data
result.company.data # Company enrichment data
result.meta.email
result.meta.domainRetrieve details about your Hunter account.
result = email_hunter.account{
"data": {
"first_name": "Davide",
"last_name": "Santangelo",
"email": "[email protected]",
"plan_name": "Free",
"plan_level": 0,
"reset_date": "2025-06-29",
"team_id": 349,
"calls": {
"used": 4,
"available": 50
}
}
}The EmailHunter gem is released under the MIT License.
- Fork it ( https://github.com/[your-github-username]/emailhunter/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request