Skip to main content

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

  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())

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.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

hackcheck-3.0.3-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file hackcheck-3.0.3.tar.gz.

File metadata

  • Download URL: hackcheck-3.0.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.15.4 CPython/3.12.3 Windows/10

File hashes

Hashes for hackcheck-3.0.3.tar.gz
Algorithm Hash digest
SHA256 034d16b00ebbbec8e7c7814f16a8e98572f293769f4545f93fde55b66688b565
MD5 53fe6ff9a8f7094402749c95d165871e
BLAKE2b-256 77c7e3788000da3338815bd36698c0ae4acfc52cd01544f77c6bf62d70d88712

See more details on using hashes here.

File details

Details for the file hackcheck-3.0.3-py3-none-any.whl.

File metadata

  • Download URL: hackcheck-3.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.15.4 CPython/3.12.3 Windows/10

File hashes

Hashes for hackcheck-3.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f6746180c3aef6d7413d177e984b620dbefd59902e2569f824876cbabe4d13b7
MD5 c15ca206e0b163ffdea9dd292561729c
BLAKE2b-256 057c91b9f9b06fa99e0fa9944137de307d58d738a4aeca64f714d2caa58ce2ec

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page