Skip to content

Instantly share code, notes, and snippets.

@Static-Flow
Created December 7, 2018 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Static-Flow/7185ece49d3a1d0f25a733f7fbcde583 to your computer and use it in GitHub Desktop.
Save Static-Flow/7185ece49d3a1d0f25a733f7fbcde583 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
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