-
-
Save hxlxmjxbbxs/7350dfb3aa4ae1a56025ea940f40b8a1 to your computer and use it in GitHub Desktop.
Script to gather emails from Hunter.io API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
total=$(curl -s "https://api.hunter.io/v2/email-count?domain=$1" | jq -r '.data.total') | |
echo "Total is $total" | |
if [ "$total" != "0" ]; then | |
for (( i=0; i<=$total; i+=100 )) | |
do | |
echo "offset $i" | |
curl -s "https://api.hunter.io/v2/domain-search?domain=$1&api_key=KEYHERE&limit=100&offset=$i" | jq -r '.data.emails[].value' >> hunter_emails.txt | |
done | |
sort -uo hunter_emails.txt hunter_emails.txt | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment