# How to Configure the HTTP Request Timeout in Holehe

> Learn how to configure the HTTP request timeout in Holehe using the -T or --timeout command-line argument. Set custom timeouts for your requests and improve application performance.

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

---

**Holehe exposes the HTTP timeout as a command-line argument `-T` or `--timeout` that defaults to 10 seconds and configures the underlying httpx.AsyncClient instance.**

Holehe is an open-source OSINT tool developed by megadose/holehe that checks whether an email is registered across hundreds of platforms. Understanding how to configure the HTTP request timeout allows you to adapt the tool to slower networks or stricter latency requirements when verifying email addresses.

## Command-Line Timeout Configuration

The simplest way to adjust the timeout is via the command-line interface. In [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py), the argument parser defines the `-T`/`--timeout` flag around line 194, setting a default value of 10 seconds:

```python
parser.add_argument("-T","--timeout", …, default=10)

```

You can override this default when invoking the tool. The following examples demonstrate how to use both the short and long flag formats:

```bash

# Use the default 10-second timeout (implicit)

holehe user@example.com

# Set a custom timeout of 5 seconds

holehe user@example.com -T 5

# Alternative long-form syntax

holehe user@example.com --timeout 5

```

## Internal Implementation with httpx

After argument parsing, the timeout value is passed directly to the httpx asynchronous client constructor at line 213 in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py):

```python
client = httpx.AsyncClient(timeout=timeout)

```

This client instance is shared across all platform-specific check modules (e.g., [`holehe/modules/social_media/myspace.py`](https://github.com/megadose/holehe/blob/main/holehe/modules/social_media/myspace.py), [`holehe/modules/medical/caringbridge.py`](https://github.com/megadose/holehe/blob/main/holehe/modules/medical/caringbridge.py)), ensuring the timeout applies globally to every HTTP request made during the email verification process.

## Programmatic Configuration

If you are embedding Holehe within another Python application rather than using the CLI, you can configure the timeout by instantiating your own httpx client and passing it to Holehe's internal functions:

```python
import httpx
from holehe.core import run_holehe  # hypothetical entry for reuse

# Define custom timeout in seconds

custom_timeout = 3
client = httpx.AsyncClient(timeout=custom_timeout)

# Pass the client to Holehe's internals (implementation depends on your integration)

# Example: await run_holehe(email, client=client)

```

This approach gives you fine-grained control over the httpx configuration, including timeout behaviors, when integrating Holehe into custom workflows.

## Summary

- **Default timeout**: 10 seconds, defined in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py) via the argument parser at line 194.
- **CLI flags**: Use `-T` or `--timeout` followed by the number of seconds to adjust the global timeout.
- **Internal mechanism**: The value is passed to `httpx.AsyncClient(timeout=timeout)` at line 213 in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py).
- **Global scope**: All platform checks (e.g., [`holehe/modules/social_media/myspace.py`](https://github.com/megadose/holehe/blob/main/holehe/modules/social_media/myspace.py)) inherit this timeout via the shared client instance.
- **Programmatic use**: Create a custom `httpx.AsyncClient` with your desired timeout when embedding Holehe in Python scripts.

## Frequently Asked Questions

### What is the default HTTP timeout in Holehe?

The default timeout is **10 seconds**, as specified in the argument parser in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py) at line 194. This value is used unless you explicitly override it with the `-T` or `--timeout` flag.

### Can I set different timeouts for different websites using Holehe?

No. According to the source code, the timeout is configured globally in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py) and applied to the shared `httpx.AsyncClient` instance used by all modules. Individual platform checks (such as those in [`holehe/modules/social_media/myspace.py`](https://github.com/megadose/holehe/blob/main/holehe/modules/social_media/myspace.py)) inherit this global setting. To implement per-site timeouts, you would need to modify the individual module implementations or handle client instantiation programmatically.

### Why does Holehe use httpx instead of the standard requests library?

Holehe uses **httpx** to support asynchronous HTTP requests, allowing the tool to perform multiple email verification checks concurrently. The timeout parameter passed to `httpx.AsyncClient` controls how long the client waits for each asynchronous operation before aborting.

### How do I troubleshoot timeout errors when scanning multiple websites?

If you encounter frequent timeout errors, increase the timeout value using `holehe user@example.com -T 30` (or higher) to accommodate slower network conditions or rate-limited services. Alternatively, check your network connectivity, as the default 10 seconds is sufficient for most stable connections.