How to Export Holehe Results to CSV: Command-Line and Python Guide

Use the --csv (or -C) flag when running Holehe to automatically write all email lookup results to a timestamped CSV file in your current working directory.

Holehe is an open-source intelligence tool in the megadose/holehe repository that checks whether an email address is registered on hundreds of websites. When you need to archive scan results or feed them into analysis pipelines, you can export Holehe results to CSV format using the built-in command-line option or the core Python API.

Command-Line CSV Export

Using the --csv Flag

To generate a CSV report, append -C or --csv to your standard Holehe command. The tool executes the email lookup across all supported modules and then writes the complete dataset to disk.

holehe -C user@example.com

This creates a file named holehe_<unix-timestamp>_user@example.com_results.csv in your working directory. The export includes every field returned by each service module, such as domain, exists, emailrecovery, and phoneNumber.

Filtering Results Before Export

Combine the CSV flag with other Holehe options to limit the output. For instance, use --only-used to export only services where the email is registered:

holehe --only-used -C user@example.com

Understanding the CSV Output Structure

The export follows a strict naming convention: holehe_<unix-timestamp>_<email>_results.csv. Each row represents one service module, containing the exact data structure returned by the individual checker. This preserves boolean existence flags, recovery email fragments, phone number hints, and other metadata for downstream processing in spreadsheets or BI tools.

Programmatic Export with the Python API

For custom scripts embedding Holehe, import the export_csv function from holehe/core.py to write results without invoking the CLI.

from holehe.core import export_csv

# results: list of dicts from the scanning process

# args: argparse.Namespace with csvoutput=True

# email: target email address string

export_csv(results, args, email)

The function handles file creation, timestamp generation, and header writing automatically.

Technical Implementation in the Source Code

According to the megadose/holehe source code, the CSV export logic resides in holehe/core.py.

The export_csv function (lines 54–65) opens a new file in write mode, constructs the timestamped filename, and iterates through the results list to write rows using Python's csv.DictWriter.

The command-line interface exposes this functionality via the argument parser defined at lines 92–94 in the same file, which adds the --csv / -C store_true action to the argparse configuration.

Summary

  • Use the -C or --csv flag to export Holehe results to CSV directly from the command line.
  • Output files follow the pattern holehe_<unix-timestamp>_<email>_results.csv.
  • Each row includes all data fields returned by the service modules: domain, exists, emailrecovery, phoneNumber, and others.
  • For Python integrations, call export_csv() from holehe.core with your results list and arguments namespace.
  • The export implementation lives in holehe/core.py, specifically in the export_csv function (lines 54–65) and the CLI argument definition (lines 92–94).

Frequently Asked Questions

What filename does Holehe use for CSV exports?

Holehe generates filenames using the pattern holehe_<unix-timestamp>_<email>_results.csv, placing the file in the current working directory where the command was executed.

Can I export only sites where the email exists?

Yes. Combine the --only-used flag with -C or --csv. This filters the results to include only services returning positive existence checks before writing to the CSV.

Which data fields are included in the CSV output?

The CSV contains every field returned by each Holehe module, typically including domain, exists (boolean), emailrecovery, phoneNumber, and other metadata specific to the service being checked.

How do I export results when using Holehe as a Python library?

Import export_csv from holehe.core and pass your results list, an argparse namespace with csvoutput=True, and the target email string. The function handles file naming and writing automatically according to the implementation in holehe/core.py.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →