Skip to main content

XposedOrNot Python Client

A Python client for the XposedOrNot API to check for data breaches and exposed credentials.

Installation

pip install xposedornot

Quick Start

from xposedornot import XposedOrNot

# Initialize the client
xon = XposedOrNot()

# Check if an email has been exposed
result = xon.check_email("test@example.com")
print(f"Found in {len(result.breaches)} breaches: {result.breaches}")

# Get detailed breach analytics
analytics = xon.breach_analytics("test@example.com")
print(f"Total exposures: {analytics.exposures_count}")
print(f"First breach: {analytics.first_breach}")

for breach in analytics.breaches_details:
    print(f"  - {breach.breach}: {breach.xposed_records} records")

# Get all known breaches
breaches = xon.get_breaches()
print(f"Total breaches in database: {len(breaches)}")

# Filter breaches by domain
adobe_breaches = xon.get_breaches(domain="adobe.com")

# Check if a password has been exposed (uses k-anonymity)
pwd_result = xon.check_password("password123")
print(f"Password exposed {pwd_result.count} times")

Features

  • Email Breach Check: Check if an email has been exposed in known data breaches
  • Breach Analytics: Get detailed analytics including metrics by industry, risk level, and year
  • Breach Database: Access the full database of known breaches with filtering
  • Password Check: Securely check passwords using k-anonymity (only hash prefix sent)
  • Rate Limiting: Built-in rate limiting (1 request/second) to respect API limits
  • Type Hints: Full type annotations for IDE support

API Reference

XposedOrNot Client

from xposedornot import XposedOrNot

# Basic initialization
xon = XposedOrNot()

# With options
xon = XposedOrNot(
    api_key="your-api-key",      # For authenticated endpoints
    timeout=30.0,                 # Request timeout in seconds
    rate_limit=True,              # Enable/disable rate limiting
)

# Use as context manager
with XposedOrNot() as xon:
    result = xon.check_email("test@example.com")

Methods

check_email(email: str) -> EmailBreachResponse

Check if an email has been exposed in data breaches.

result = xon.check_email("test@example.com")
print(result.breaches)  # ['Adobe', 'LinkedIn', ...]

breach_analytics(email: str) -> BreachAnalyticsResponse

Get detailed breach analytics for an email.

analytics = xon.breach_analytics("test@example.com")
print(analytics.exposures_count)      # Total exposures
print(analytics.breaches_count)       # Number of breaches
print(analytics.first_breach)         # Date of first breach
print(analytics.breaches_details)     # List of BreachDetails
print(analytics.metrics)              # BreachMetrics with industry, risk, etc.

get_breaches(domain: str = None) -> list[Breach]

Get all known breaches, optionally filtered by domain.

# All breaches
all_breaches = xon.get_breaches()

# Filter by domain
adobe = xon.get_breaches(domain="adobe.com")

check_password(password: str) -> PasswordCheckResponse

Check if a password has been exposed using k-anonymity.

result = xon.check_password("mypassword")
print(result.count)            # Times found in breaches
print(result.characteristics)  # Password traits

Error Handling

from xposedornot import (
    XposedOrNot,
    NotFoundError,
    RateLimitError,
    ValidationError,
)

xon = XposedOrNot()

try:
    result = xon.check_email("test@example.com")
except NotFoundError:
    print("Email not found in any breaches")
except RateLimitError:
    print("Rate limit exceeded, please wait")
except ValidationError as e:
    print(f"Invalid input: {e}")

Response Models

All responses are typed dataclasses:

  • EmailBreachResponse - Contains list of breach names
  • BreachAnalyticsResponse - Detailed analytics with metrics
  • BreachDetails - Individual breach information
  • BreachMetrics - Analytics breakdown
  • Breach - Breach database entry
  • PasswordCheckResponse - Password exposure data

License

MIT License

Metadata

Release files for xposedornot 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xposedornot 0.1.0
File Size Uploaded Provenance Actions
xposedornot-0.1.0.tar.gz 8.5 kB Without provenance Details for xposedornot-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xposedornot 0.1.0
File Interpreter ABI Platform Actions
xposedornot-0.1.0-py3-none-any.whl Python 3 none any Details for xposedornot-0.1.0-py3-none-any.whl

Total release size: 20.3 kB

Release files / xposedornot-0.1.0.tar.gz

Download URL xposedornot-0.1.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b9e0bfed5724ae59c8fbe49d1f1484d02184486bfc815557dc78fc9ba09870a4
BLAKE2b-256 checksum
How to use checksums
f8bbd2adfa36999521248cda0194671bcb03d78bad1e23e9b3229e572ebcc12f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / xposedornot-0.1.0-py3-none-any.whl

Download URL xposedornot-0.1.0-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c49dd5d6e6cdc4dc82bd2cc2f346984298b9c0e9c3182b23a9d807d1876633c
BLAKE2b-256 checksum
How to use checksums
4ffe150bd0dbe207cefd32fc85a3b8bf3fc48bc873d408adb9cdfd7ca75c1b90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for xposedornot 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page