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

> Easily export Holehe results to CSV using the --csv flag or Python. Get timestamped data for any email directly from the command line or your scripts. Learn how now.

- Repository: [Palenath/holehe](https://github.com/megadose/holehe)
- Tags: how-to-guide
- Published: 2026-09-10

---

**Holehe supports native CSV export via the `--csv` (or `-C`) flag, which automatically writes timestamped results to `holehe_<unix-timestamp>_<email>_results.csv` in the current working directory.**

Holehe is an open-source OSINT tool maintained by megadose/holehe that checks email addresses against hundreds of online services. When you need to archive scan results or analyze them in spreadsheet applications, you can export Holehe results to CSV using built-in functionality. The export logic is implemented in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py) and accessible both via command-line interface and programmatically through the Python API.

## Command-Line CSV Export

The fastest way to export Holehe results to CSV is using the **`--csv`** (short **`-C`**) argument. When this flag is present, Holehe creates a CSV file automatically after completing the scan.

### Basic CSV Export

To save a standard scan to CSV, append the `-C` flag to your command:

```bash
holehe -C user@example.com

```

This executes the full lookup sequence and then writes the results to a file named `holehe_<unix-timestamp>_user@example.com_results.csv` in your current directory.

### Filtering Results Before Export

You can combine the CSV flag with other options such as **`--only-used`** to limit the export to services where the email is confirmed active:

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

```

The filtering occurs before the export, so only the subset of results you specify are written to the CSV file.

## CSV Output Structure

According to the implementation in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py) (lines 54-65), the **export_csv** function generates files following this naming convention:

```

holehe_<unix-timestamp>_<email>_results.csv

```

Each row in the CSV represents one service check and preserves all fields returned by the Holehe modules, including:

- **`domain`** – the service domain checked
- **`exists`** – boolean indicating if the email is registered
- **`emailrecovery`** – recovered email addresses (if available)
- **`phoneNumber`** – recovered phone numbers (if available)
- Additional metadata fields returned by specific modules

## Programmatic CSV Export in Python

If you are embedding Holehe in a custom Python workflow, you can trigger the same CSV export logic directly without invoking the CLI. The **`export_csv`** function in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py) handles the file creation and writing.

```python
from holehe.core import export_csv

# results: list of dictionaries returned by the scanning process

# args: argparse.Namespace object with csvoutput=True

# email: string of the target email address

export_csv(results, args, email)

```

This approach is useful when building automated OSINT pipelines or when you need to process the data in memory before deciding to write to disk.

## Summary

- Use the **`--csv`** or **`-C`** flag to automatically export Holehe results to CSV from the command line
- Output files are named `holehe_<unix-timestamp>_<email>_results.csv` and saved in the working directory
- The **`export_csv`** function in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py) (lines 54-65) handles all CSV writing operations
- All module-returned fields—including `domain`, `exists`, `emailrecovery`, and `phoneNumber`—are preserved in the export
- Combine with flags like `--only-used` to filter data before exporting

## Frequently Asked Questions

### Does Holehe support CSV export natively?

Yes. The functionality is built into the core tool via the `--csv` / `-C` argument, defined in the argument parser at lines 92-94 of [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py). No additional plugins or post-processing scripts are required.

### What filename format does Holehe use for CSV exports?

Holehe generates filenames using the pattern `holehe_<unix-timestamp>_<email>_results.csv`. For example, a scan against `user@example.com` executed at Unix timestamp `1728001234` produces `holehe_1728001234_user@example.com_results.csv`.

### Can I export CSV results when using Holehe as a Python library?

Yes. Import the **`export_csv`** function from [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py) and pass it your results list, an `argparse.Namespace` object with `csvoutput=True`, and the target email string. This writes the CSV using the same logic as the CLI.

### Which data fields are included in the exported CSV?

The CSV contains every field returned by each Holehe module, including but not limited to **`domain`**, **`exists`**, **`emailrecovery`**, and **`phoneNumber`**. The exact columns depend on which services return data during the scan.