How to Find Email Addresses

One of the first tasks I was given when I started working as a Growth Marketer, was to retrieve email addresses from certain companies. First of all, I want to mention that this article is not an encouragement for people to start collecting email addresses, nor sending unsolicited emails to these people. However, as a blogger that writes about automation, I do want to share the knowledge about all the possibilities that exist nowadays. So if you are working on email marketing, and you are curious to learn how to find email addresses then this article is for you.

How to obtain email addresses header

Time needed: 5 minutes

In this article I will explain how to find email addresses using Hunter.io

  1. Authentication

    Here you are going to tell the API that you are authorized to make a request

  2. Obtain multiple email addresses

    Using a Python script you can get multiple email addresses

Email addresses

So when I mention email addresses, I am talking about both business email addresses as personal email addresses. Yes, there is a whole ethical aspect to the activity of finding and using email addresses online. However, there is an argument to be made that we are talking about the worldwide web, which is publicly available for everyone. The tool (Hunter.io) that I am mentioning in this article is only getting their email addresses from publicly available sources and deletes any email address if that source is not available anymore. Additionally, they disclose exactly where they have found that email address. Once again, if you do not feel comfortable with this, or if such an activity might be considered illegal in your country then I would recommend you to not execute any of the code that I am explaining below.

find email addresses with hunter banner

Hunter.io

Hunter.io has multiple tools available for email marketing. You can use each of these tools to find someone’s email address. In the sections below I will shortly explain each of them.

  • Domain Search
  • Email Finder
  • Author Finder
  • Email Verifier

Domain Search

One of the easiest ways to find an email address is to start with a website. Hunter allows you to fill in the website of let say a company, and it will return all the known email addresses for that domain/company. This is really useful if you have a list of company websites that you need contact details for.

Email Finder

For this approach, your starting point is someone’s first name, last name, and the company that person works at. For example, you want to find the email address of John Doe and you know he works at Google, you can fill in this information and Hunter will allow you to find an email address for that person.

Author Finder

Similar to the Domain Search, the input for this approach is a website. However, in this case you are filling in the URL for a certain blog post. Hunter will look for the email address of the author from that blog post.

Email Verifier

Imagine you have already found some email addresses, and you want to make sure that these are legit email addresses. With the Email Verifier from Hunter, you can fill in the email address and Hunter will check the validity of that email address

How to use the Hunter API to find email addresses

Of course it wouldn’t be an Automation Help blog article, if it did not involve any Python coding. In the section below I will explain how you can use the Hunter API to find email addresses. More specifically, I will explain the easy to use authentication process, and the short for loop I have written to obtain email addresses using a list of company websites.

find email addresses with hunter banner

Authentication

As I have explained in other articles as well, authentication is all about telling the API that you are authorized to make that request. I have also created other articles regarding the Requests library, and how to send HTTP requests in Python. With the Hunter API you will be using a API key that you will add to your URL parameter when making the API call. Just go to the API page and copy the key from there (it’s the value with all the dots, which is highlighted in black in the screenshot below)

authentication screenshot for how to find email addresses

Obtain multiple email addresses

With the code below we will loop over an Excel sheet that has a column with company websites. For the example below the column is called “Domain”. We start with importing the Requests module (to do the API call) and Pandas (to read our Excel sheet). Then we will open a CSV that will contain our output. Don’t forget to replace the api_key variable with the API key obtained in the previous step. Our output will contain the domain that you searched for and all the email addresses associated with that domain.

import requests
import pandas as pd
import csv

df = pd.read_excel("input.xlsx")
urls = df["Domain"]
api_key = {{API_KEY}}

with open('output.csv','w') as f1:
    writer=csv.writer(f1, delimiter=',',lineterminator='\n',)
    for index, domain in enumerate(urls):
        response = requests.get(f"https://api.hunter.io/v1/search?domain={domain}.com&api_key={api_key}")
        response = response.json()
        if "emails" in response:
            for email in response["emails"]:
                csv_result = []
                csv_result.append(response["domain"])
                csv_result.append(email["value"])
                writer.writerow(csv_result)

I hope you have enjoyed learning how to find email addresses using Hunter. It doesn’t really matter whether you start with a company website, a blog post or full names. Just take into account that the API endpoint is different for each of these methods. Let me know if you would like to see some automation code for these approaches. Let me know if you have any other questions using the comments below.

find email addresses with hunter banner

Leave a Comment

Your email address will not be published. Required fields are marked *