A Python client for the HaveIBeenPwned REST API. https://haveibeenpwned.com/
pip install pypwned
- requests
- pyOpenSSL
- ndg-httpsclient
- pyasn1
Note: The below examples assume you have loaded the envrionment variable HIBP_API_KEY with your appropriate Have I Been Pwned API key. More details here, https://haveibeenpwned.com/API/Key.
import pypwned, os
your_hibp_key = os.environ.get("HIBP_API_KEY")
pwny = pypwned.pwned(your_hibp_key)
pwny.getAllBreachesForAccount(email="foo@bar.com")
import pypwned, os
your_hibp_key = os.environ.get("HIBP_API_KEY")
pwny = pypwned.pwned(your_hibp_key)
pwny.getAllBreachesForAccount(email="foo@bar.com",domain="adobe.com")
import pypwned, os
your_hibp_key = os.environ.get("HIBP_API_KEY")
pwny = pypwned.pwned(your_hibp_key)
pwny.getAllBreaches()
import pypwned, os
your_hibp_key = os.environ.get("HIBP_API_KEY")
pwny = pypwned.pwned(your_hibp_key)
pwny.getAllBreaches(domain="adobe.com")
Return the details of a single breach, by breach name.
import pypwned, os
your_hibp_key = os.environ.get("HIBP_API_KEY")
pwny = pypwned.pwned(your_hibp_key)
pwny.getSingleBreachedSite(name="adobe")
Return the different types of data classes that are associated with a record in a breach. E.G, Email addresses and passwords
import pypwned, os
your_hibp_key = os.environ.get("HIBP_API_KEY")
pwny = pypwned.pwned(your_hibp_key)
pwny.getAllDataClasses()
Return any pastes that contain the given email address
import pypwned, os
your_hibp_key = os.environ.get("HIBP_API_KEY")
pwny = pypwned.pwned(your_hibp_key)
pwny.getAllPastesForAccount(account="foo@bar.com")