Python Quick Start
1. Get an API Key and Secret
2. Install the Enzoic Library in Your Project
pip install enzoic3. Try Out Our Example Code
# Create a new instance of the Enzoic class - this is our primary interface for making API calls
from enzoic import Enzoic
enzoic = Enzoic("YOUR_API_KEY", "YOUR_API_SECRET")
# Check whether a password has been compromised
if enzoic.check_password("password_to_test"):
print("Password is compromised")
else:
print("Password is not compromised")
# Check whether a specific set of credentials are compromised
if enzoic.check_credentials("[email protected]", "password_to_test"):
print("Credentials are compromised")
else:
print("Credentials are not compromised")
# Use the optional parameters on the check_credentials call to tweak performance
# by including the date/time of the last check and excluding BCrypt
if enzoic.check_credentials("[email protected]", "password_to_test", last_check_datetime_object, [PasswordType.Bcrypt]):
print("Credentials are compromised")
else:
print("Credentials are not compromised")
# Get all exposures for a given user
exposures = enzoic.get_exposures_for_user("[email protected]")
print(str(exposures["count"] + " exposures found for [email protected]")
# Now get the full details for the first exposure returned in the exposures response above
details = enzoic.get_exposure_details(exposures["exposures"][0])
print("First exposure for [email protected] was " + details["title"])
4. Learn More
Last updated
Was this helpful?