-
-
Save cobbr/d3756261cdac3c820e42d30fd0f07ea5 to your computer and use it in GitHub Desktop.
Simple Python 3 script to pull emails related to a domain from hunter.io and parse the data
This file contains hidden or 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
import requests | |
import sys | |
if len(sys.argv) is 3: | |
domain = sys.argv[1] | |
api_key = sys.argv[2] | |
if domain is not None: | |
url = "https://hunter.io/v2/domain-search?limit=10000&offset=0&domain="\ | |
+domain+"&api_key="+api_key+"&format=json" | |
hunterJsonData = requests.get(url) | |
for email in hunterJsonData.json()['data']['emails']: | |
print(email['value']) | |
else: | |
print("Missing some values. Correct usage is 'python DOMAIN APIKEY'") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment