Official python API wrapper for hackcheck.io
Project description
HackCheck-py
Official python library for the hackcheck.io API
Installation
Install with pip
pip install hackcheck
Quick start
Example usage
import asyncio
from hackcheck import (
HackCheckClient,
SearchFieldEmail,
SearchOptions,
)
async def main() -> None:
async with HackCheckClient("MY_API_KEY") as hc:
breaches = await hc.search(
SearchOptions(
field=SearchFieldEmail,
query="hello@gmail.com",
)
)
print(breaches.results)
asyncio.run(main())
Getting your api key
- Visit https://hackcheck.io/profile
- Add your IP address in the "Authorized IP Addresses" text area and click Update
- Copy your API key
Other examples
Breach Monitors
import asyncio
from hackcheck import HackCheckClient, UpdateDomainMonitorParams
async def main() -> None:
async with HackCheckClient("MY_API_KEY") as hc:
monitors = await hc.get_monitors()
print(monitors.asset_monitors)
print(monitors.domain_monitors)
my_asset_monitor = await hc.get_asset_monitor("...") # or hc.get_domain_monitor
print(my_asset_monitor.status)
print(my_asset_monitor.asset)
# Updating a monitor
domain_monitor = await hc.update_domain_monitor(
"id123123123",
UpdateDomainMonitorParams(
domain="website.com",
notification_email="notifications@example.com",
),
)
print(domain_monitor.domain)
asyncio.run(main())
Filtering databases
import asyncio
from hackcheck import (
HackCheckClient,
SearchFieldEmail,
SearchFilterOptions,
SearchFilterUse,
SearchOptions,
)
async def main() -> None:
async with HackCheckClient("MY_API_KEY") as hc:
# This will only yield results from "website.com" and "website.org"
breaches = await hc.search(
SearchOptions(
field=SearchFieldEmail,
query="example@example.com",
filter=SearchFilterOptions(
type=SearchFilterUse, databases=["website.com", "other.com"]
),
)
)
print(breaches.results)
asyncio.run(main())
Checking if a query exists
import asyncio
from hackcheck import (
CheckOptions,
SearchFieldEmail,
HackCheckClient,
)
async def main() -> None:
async with HackCheckClient("MY_API_KEY") as hc:
exists = await hc.check(
CheckOptions(
field=SearchFieldEmail,
query="example@example.com",
)
)
print(exists)
asyncio.run(main())
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hackcheck-3.0.2.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for hackcheck-3.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2d850eb72129ba042b96c82b0bbd1afb00c606520d8afc26b1d6ebe09853997 |
|
MD5 | d06075b34d066b88bc1114e074126e48 |
|
BLAKE2b-256 | a280367cc5634c6601ebad29f09063d83486ed5ed38b61ffa9371fa5be4a055e |