Skip to main content
The official Python wrapper lets you interact with the LeakCheck API from your code. It supports both the private (authenticated) Pro API v2 and the public (unauthenticated) API, and ships with a CLI tool. Source code: github.com/LeakCheck/leakcheck-api · MIT license.

Features

  • Lookup email addresses, usernames, and other identifiers against leaked databases.
  • Supports both the Pro API v2 (authenticated via API key) and the Public API.
  • HTTP/SOCKS proxy support.
  • Customizable request limits and offsets for paginated queries.

Installation

Pro API v2 — LeakCheckAPI_v2

To use the Pro API, you need an API key from LeakCheck. You can pass the key directly or set it via an environment variable.

Environment variables

Parameters for lookup()

query
string
required
The identifier to look up (email, username, etc.).
query_type
string
The type of query (e.g. email, username). Auto-detected if not provided — see Search types.
limit
integer
default:"100"
Limit the number of results (maximum 1000).
offset
integer
default:"0"
Offset for the results (maximum 2500).

Error handling

lookup() raises a ValueError when the API returns an error, which makes failures easy to catch and debug:
  • If the API key is invalid or not provided, an error is raised.
  • The method validates the limit and offset parameters.
  • Network and request exceptions are handled as well.
The error messages match the API error table.

Public API — LeakCheckAPI_Public

The Public API does not require authentication but offers limited access — use it for simple email or username source checks:
lookup() takes a single query — an email, an email hash, or a username.

Proxy support

Both wrappers support proxy configurations (HTTP, HTTPS, SOCKS5). Set the proxy with set_proxy() or via the LEAKCHECK_PROXY environment variable: