Python Library Usage

Holehe can be imported and used within your own Python scripts. Because Holehe uses trio for concurrency, your scripts must also be asynchronous.

Basic Implementation

To use a specific module (e.g., checking Instagram):

import trio
import httpx
from holehe.modules.social_media.instagram import instagram

async def main():
    email = "test@gmail.com"
    out = []

    # Initialize an async client
    async with httpx.AsyncClient() as client:
        # Run the module
        await instagram(email, client, out)

    # 'out' is a list of dictionaries containing results
    print(out)

if __name__ == "__main__":
    trio.run(main)

Using Core Logic

If you want to run all modules programmatically, you can mimic the behavior in holehe/core.py.

Note: You will need to import modules dynamically or import specific ones as needed.

Data Structure

The out variable passed to modules is a list that gets populated with dictionaries. Each dictionary represents a result from a specific website:

{
  "name": "instagram",
  "domain": "instagram.com",
  "rateLimit": false,
  "exists": true,
  "emailrecovery": null,
  "phoneNumber": null,
  "others": null
}
Key Type Description
name string Internal name of the module.
domain string The website domain being checked.
rateLimit boolean True if the check failed due to rate limiting.
exists boolean True if the account was found.
emailrecovery string Obfuscated recovery email (if returned by the site).
phoneNumber string Obfuscated phone number (if returned by the site).
others dict/string Any additional info (e.g., full name, creation date).