Skip to main content

Asynchronous client for the LeakRadar.io API

Project description

LeakRadar Async Python Client

A user-friendly, asynchronous Python 3 wrapper for the LeakRadar.io API.

Documentation

See the full API documentation here: https://api.leakradar.io/docs

Features

  • Async/await support using httpx.
  • Authentication via Bearer token.
  • Customizable User-Agent.
  • Error handling with custom exceptions (no retries).
  • Easy-to-use methods for:
    • Advanced, email and domain search
    • Unlocking leaks (all or specific)
    • Requesting CSV exports for leaks
    • Metadata search
    • Managing notifications
    • Fetching and updating profile information

Requirements

  • Python 3.7+
  • httpx library (installed automatically)

Installation

pip install leakradar

Usage

  1. Retrieve your API key from LeakRadar.io Profile.
  2. Create a client instance, passing your Bearer token.
import asyncio
from leakradar.api import LeakRadarClient

async def main():
    token = "YOUR_BEARER_TOKEN"
    async with LeakRadarClient(token=token) as client:
        profile = await client.get_profile()
        print("User Profile:", profile)

        # Perform an advanced search
        results = await client.search_advanced(username="john.doe@example.com")
        print("Search Results:", results)

        # Unlock all matching leaks
        unlocked = await client.unlock_all_advanced({"username": "john.doe@example.com"})
        print("Unlocked leaks:", unlocked)

        # Request an export of the leaks
        export_info = await client.export_advanced(username="john.doe@example.com")
        print("Export created:", export_info)

asyncio.run(main())

Error Handling

All errors raise a LeakRadarAPIError subclass. For example:

  • BadRequestError (400)
  • UnauthorizedError (401)
  • ForbiddenError (403)
  • NotFoundError (404)
  • ValidationError (422)
  • TooManyRequestsError (429)

Contributing

Please open an issue or PR if you have suggestions or improvements.

License

MIT

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

leakradar-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

leakradar-0.1.0-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

File details

Details for the file leakradar-0.1.0.tar.gz.

File metadata

  • Download URL: leakradar-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for leakradar-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0ffc8d179c71abaeb35f4872d3d9ad03491bf40445fc427fd85e76e20a48ed6a
MD5 a70541ab1d97d0090f92d997f553d1da
BLAKE2b-256 758fb22ab74c71cc58ecafde998d17fe93483df081a53525e29bf69c844d6699

See more details on using hashes here.

File details

Details for the file leakradar-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: leakradar-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for leakradar-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 063c3b8ed97be99ca34334df8caccf9f4e77c6103cf2159b121932ba2140a0a5
MD5 3c0d88db480b553d0b7c4c78e2607a95
BLAKE2b-256 324368cac71017b616556ea5a105fa4ec3da02ad5fde267c6b45b427c77a323c

See more details on using hashes here.

Supported by

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