What Does the `--only-used` Flag Do in Holehe?
The --only-used flag filters Holehe's output to show only the services where the target email address is confirmed to exist, suppressing negative results and errors.
Holehe is an OSINT (Open Source Intelligence) tool by megadose/holehe designed to check if an email address is registered on various websites. By default, the tool outputs results for every module it runs, including sites where the email was not found or where the check failed. The --only-used CLI flag provides a cleaner view by displaying exclusively the sites where the email is actually associated with an existing account.
How the --only-used Flag Filters Results
When you execute a Holehe command without any filters, the tool loads every available module—each representing a different website or service—and attempts to verify if the target email has an account there. The standard output includes three possible states for each module: found (email exists), not found (email does not exist), or error (check failed).
Adding the --only-used parameter changes this behavior significantly. Before rendering the terminal output or generating CSV exports, Holehe evaluates the exists field in each result dictionary. The flag ensures that only entries where result["exists"] equals True are preserved. All other entries—where the email was not found or the check encountered an error—are discarded from the final presentation.
Implementation in the Source Code
The filtering logic resides in the main CLI handler within the Holehe repository.
CLI Argument Definition
The flag is registered in the argument parser located in holehe/core.py at lines 184-186:
parser.add_argument(
"--only-used",
default=False,
required=False,
action="store_true",
dest="onlyused",
help="Displays only the sites used by the target email address."
)
This configuration uses action="store_true" to set args.onlyused to True when the flag is present, requiring no additional value from the user.
Result Filtering Logic
After all modules execute, the aggregated results list (out) passes to the print_result function in the same file. Inside this function, the code checks the args.onlyused attribute:
If args.onlyused is True, the function filters the results list to exclude any entry where result["exists"] is False. This filtering occurs before the terminal table is rendered and before the optional CSV export is written to disk. Consequently, both the console output and the exported file contain only confirmed matches.
Practical Usage Examples
The --only-used flag integrates seamlessly with standard Holehe workflows.
Basic Filtering
To see only the sites where the email is actually registered:
holehe user@example.com --only-used
Combined with CSV Export
The flag also affects CSV generation when using the -C option:
holehe user@example.com --only-used -C
This command exports only the confirmed matches to a CSV file, eliminating the need to manually filter out negative results in spreadsheet software.
Summary
- The
--only-usedflag limits Holehe output to services where the target email is confirmed to exist, hiding "not found" and error results. - The argument is defined in
holehe/core.pyand stored asargs.onlyusedfor downstream evaluation. - Filtering occurs in the
print_resultfunction by checking theresult["exists"]boolean field. - Both terminal output and CSV exports respect this filter when the flag is enabled.
Frequently Asked Questions
What does the --only-used flag do in Holehe?
The --only-used flag tells Holehe to display only the websites where the supplied email address is confirmed to have an active account. It suppresses all output for sites where the email was not found or where the lookup failed, making the results more actionable.
Where is the --only-used flag implemented in the Holehe source code?
According to the megadose/holehe source code, the flag is defined in the argument parser in holehe/core.py at lines 184-186, and the filtering logic is implemented in the print_result function within the same file. The code checks args.onlyused and filters out results where result["exists"] is False.
Does --only-used affect CSV exports in Holehe?
Yes. When you combine --only-used with the -C flag for CSV export, Holehe applies the same filtering logic before writing the file. The resulting CSV contains only the rows where the email was found, excluding all negative and error results from the spreadsheet.
Can I combine --only-used with other Holehe CLI options?
Absolutely. The --only-used flag functions as a boolean toggle that works alongside other options such as -C for CSV output or threading parameters. It simply filters the final results list before any output formatting occurs, ensuring compatibility with all other CLI features.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →