Python SDK & CLI for DataLeak Search — breach intelligence across billions of leaked records
Project description
DataLeak Search — Python SDK & CLI
Search billions of leaked records across 1,300+ breach databases from your terminal or Python code.
Install
pip install dataleaksearch
CLI Usage
dataleaksearch
Follow the interactive prompts to search by Email, Username, Password, Domain, or Phone.
Library Usage
from dataleaksearch import DataLeakSearchClient
# Context manager (auto-closes the session)
with DataLeakSearchClient() as client:
# Search by email
result = client.search_email("user@example.com")
if result.is_breached:
print(f"Found in {result.total_breaches} breach(es)")
for breach in result.breaches:
print(f" - {breach.name}: {breach.pwn_count:,} records")
else:
print("Clean — no breaches found!")
# Search by password (k-anonymity, NOT stored)
pw = client.search_password("S3cur3P@ss!")
if pw.password_hit_count:
print(f"Password seen {pw.password_hit_count:,} times!")
# Generic search
r = client.search("john_doe", "username")
r = client.search("example.com", "domain")
r = client.search("+1234567890", "phone")
API
DataLeakSearchClient(api_url=None, timeout=30, session=None)
| Method | Description |
|---|---|
search(query, search_type) |
Generic search. search_type: email, username, password, domain, phone |
search_email(email) |
Shortcut for email search |
search_username(username) |
Shortcut for username search |
search_password(password) |
Shortcut for password search (k-anonymity) |
search_domain(domain) |
Shortcut for domain search |
search_phone(phone) |
Shortcut for phone search |
close() |
Close the underlying HTTP session |
SearchResult
| Attribute | Type | Description |
|---|---|---|
query |
str |
The search query |
search_type |
str |
Type of search performed |
scanned_databases |
int |
Number of databases scanned |
total_breaches |
int |
Number of breaches found |
breaches |
list[Breach] |
List of breach records |
checked_at |
datetime | None |
When the check was performed |
password_hit_count |
int | None |
(Password only) Times the password appeared |
elapsed_ms |
int |
API response time in milliseconds |
is_breached |
bool |
True if any breaches found |
Exceptions
| Exception | Parent | When |
|---|---|---|
DataLeakSearchError |
Exception |
Base for all client errors |
TimeoutError |
DataLeakSearchError |
Request timed out |
ConnectionError |
DataLeakSearchError |
Cannot reach the server |
HTTPError |
DataLeakSearchError |
Non-2xx response (has .status_code) |
License
MIT — ThreatNova Security
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dataleaksearch-1.0.0.tar.gz.
File metadata
- Download URL: dataleaksearch-1.0.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b84f60fb461570c00af51d2ad9f979c7e6c6fcede9d2022d8c7ec23604faab66
|
|
| MD5 |
ff0b8274e41185b64a34284e118f3ccc
|
|
| BLAKE2b-256 |
04a307c9008045f16b32a6d0d7a9f67e4099a076e1eef770e436962c48fb552a
|
File details
Details for the file dataleaksearch-1.0.0-py3-none-any.whl.
File metadata
- Download URL: dataleaksearch-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9071c65e4354099357e0dbe2873ac84da87e16cd63a1a600d78fb7809e24db14
|
|
| MD5 |
d161bb75c439a5fb95c190b7a6f566d1
|
|
| BLAKE2b-256 |
419d55859a1ba6b53f59f450e1fda45f9cf1ef0e99d30de5dc4de6cc2959cc0a
|