Skip to main content

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

  1. Visit https://hackcheck.io/profile
  2. Add your IP address in the "Authorized IP Addresses" text area and click Update
  3. 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())

Metadata

Release files for hackcheck 3.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hackcheck 3.0.3
File Size Uploaded
hackcheck-3.0.3.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hackcheck 3.0.3
File Interpreter ABI Platform
hackcheck-3.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / hackcheck-3.0.3.tar.gz

Download URL hackcheck-3.0.3.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
034d16b00ebbbec8e7c7814f16a8e98572f293769f4545f93fde55b66688b565
BLAKE2b-256 checksum
How to use checksums
77c7e3788000da3338815bd36698c0ae4acfc52cd01544f77c6bf62d70d88712
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.15.4 CPython/3.12.3 Windows/10

Release files / hackcheck-3.0.3-py3-none-any.whl

Download URL hackcheck-3.0.3-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6746180c3aef6d7413d177e984b620dbefd59902e2569f824876cbabe4d13b7
BLAKE2b-256 checksum
How to use checksums
057c91b9f9b06fa99e0fa9944137de307d58d738a4aeca64f714d2caa58ce2ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.15.4 CPython/3.12.3 Windows/10

Release history Release notifications | RSS feed

This release

3.0.3 This release

2 release files

3.0.2

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page