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 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.1.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.1-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: leakradar-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 639a154998373c993cb57d363b6e25d824e00c2731ac499fbcf0805569d6961f
MD5 1fc985ef1e63e9bd74ff5f245c889a3f
BLAKE2b-256 76a41e7f6c44ef1e3ede1a74b0d57406680a7c335d222e6ae08e4e08a3c08c84

See more details on using hashes here.

File details

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

File metadata

  • Download URL: leakradar-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5fb25297d597ce9cc15d57a0a3efd66eeebb82017d32dde4c70448c90812dfa
MD5 7c7040e528933a0b8eac9ab981227aff
BLAKE2b-256 41efa9617c0e9277452bdc40e11a4f69332579a420325d2265366b17a6afad97

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