├── .gitignore ├── functions ├── __init__.py ├── http.py ├── hunterio.py ├── rocketreach.py └── generic.py ├── requirements.txt ├── settings.py ├── README.md └── peopleScrap.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pyo 3 | settings.py 4 | -------------------------------------------------------------------------------- /functions/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ["generic","rocketreach"] 2 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests==2.21.0 2 | tabulate==0.8.2 3 | Unidecode==1.0.23 4 | -------------------------------------------------------------------------------- /settings.py: -------------------------------------------------------------------------------- 1 | #### Set API keys here 2 | # RocketReach 3 | ROCKETREACH_API_KEY="" 4 | # HunterIO 5 | HUNTERIO_API_KEY="" 6 | 7 | #### Some constants 8 | # Web/requests 9 | USER_AGENT="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:64.0) Gecko/20100101 Firefox/64.0" 10 | DEFAULT_WAIT=2 11 | DEFAULT_TIMEOUT=3 12 | 13 | ### API 14 | # RocketReach 15 | ROCKETREACH_ACCOUNT_URL="https://api.rocketreach.co/v1/api/account" 16 | ROCKETREACH_SEARCH_URL="https://api.rocketreach.co/v1/api/search" 17 | ROCKETREACH_STATUS_URL="https://api.rocketreach.co/v1/api/checkStatus" 18 | ROCKETREACH_LOOKUP_URL="https://api.rocketreach.co/v1/api/lookupProfile" 19 | # HunterIO 20 | HUNTERIO_ACCOUNT_URL="https://api.hunter.io/v2/account" 21 | HUNTERIO_DOMAIN_URL="https://api.hunter.io/v2/domain-search" 22 | 23 | # Color 24 | GREEN="\033[0;32m" 25 | RED="\033[0;31m" 26 | ORANGE="\033[0;33m" 27 | NOCOLOR="\033[0m" 28 | 29 | # Global variables 30 | def init_datalist(): 31 | global PEOPLE_DATA 32 | PEOPLE_DATA = [] 33 | -------------------------------------------------------------------------------- /functions/http.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | from settings import * 4 | 5 | # Get JSON loaded data from HTTP GET request 6 | def http_get_json(HTTP_REQ): 7 | req = http_get(HTTP_REQ) 8 | if req != None: 9 | http_code = req.status_code 10 | try: # Try and parse JSON data 11 | json_data = json.loads(req.content) 12 | return http_code, json_data 13 | except ValueError as e: 14 | return http_code, e 15 | return None, None 16 | 17 | # Perform HTTP query 18 | def http_get(HTTP_REQ): 19 | # Define headers 20 | headers = { 21 | "User-Agent": "%s" % (HTTP_REQ["user-agent"]), 22 | "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 23 | "Accept_language": "en-US,en;q=0.5", 24 | "Accept_encoding": "gzip, deflate, br" 25 | } 26 | 27 | try: 28 | return requests.get(HTTP_REQ["url"], headers=headers, proxies=HTTP_REQ["proxy"], timeout=HTTP_REQ["timeout"]) 29 | except requests.exceptions.ConnectionError as e: 30 | print("[!] No connection to the Internet") 31 | except requests.exceptions.HTTPError as e: 32 | print("[!] Exception while performing HTTP request to %s" % (HTTP_REQ["url"])) 33 | except requests.exceptions.ReadTimeout as e: 34 | print("[!] Timeout while performing HTTP request to %s" % (HTTP_REQ["url"])) 35 | 36 | return None 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PeopleScrap 2 | 3 | PeopleScrap helps gathering information about people in a company (i.e.: mycompany) or domain (i.e.: mycompany.com). 4 | 5 | ### Features 6 | - Find emails, first name, last name, job position, city/location, phone numbers, etc. 7 | - Uses RocketReach & Hunter.io APIs to gather information 8 | - Generate emails according to user's choice 9 | - Output result to CSV file 10 | - Developped in Python3 11 | - Handle user interruption (in case of network issues) and display current results anyway 12 | 13 | ### Installation 14 | * Install Python3 dependencies 15 | ``` 16 | pip3 install --user -r requirements.txt 17 | ``` 18 | * Set up your API keys in "settings.py" 19 | * Run 20 | ``` 21 | ./peopleScrap.py 22 | ``` 23 | 24 | ### Usage 25 | ``` 26 | _____ _ _____ 27 | | __ \ | | / ____| 28 | | |__) |__ ___ _ __ | | ___| (___ ___ _ __ __ _ _ __ 29 | | ___/ _ \/ _ \| '_ \| |/ _ \___ \ / __| '__/ _` | '_ \ 30 | | | | __/ (_) | |_) | | __/____) | (__| | | (_| | |_) | 31 | |_| \___|\___/| .__/|_|\___|_____/ \___|_| \__,_| .__/ 32 | | | | | 33 | |_| |_| 34 | 35 | usage: peopleScrap.py [-h] [-c company] [-d domain] [-l] [-o ] 36 | [--wait