Want to check if an email has been exposed in a data breach? There’s now a free SDK for that from XposedOrNot. Two, actually – one for JavaScript, one for Python.
Install it. Call a method. Get results. That’s the whole workflow.
No need to wrangle HTTP requests or parse API responses yourself. Just clean, simple methods that return exactly what you need.
Getting Started
Grab the package:
npm install xposedornot
Or if Python’s your thing:
pip install xposedornot
You’ll need Node.js 18+ for the JavaScript SDK, or Python 3.8+ for the Python version. That’s the only prerequisite.
Your First Breach Check
Let’s check an email and see if it’s been exposed. Here’s the JavaScript version:
import { XposedOrNot } from 'xposedornot';
const xon = new XposedOrNot();
const result = await xon.checkEmail('user@example.com');
if (result.found) {
console.log(`Uh oh. Found in ${result.breaches.length} breaches.`);
console.log(result.breaches); // ['LinkedIn', 'Adobe', ...]
} And Python:
from xposedornot import XposedOrNot
xon = XposedOrNot()
result = xon.check_email("user@example.com")
print(f"Found in {len(result.breaches)} breaches")
That’s really all there is to it. You get back a boolean telling you if the email was found, plus a list of breach names where it appeared. Simple and direct.
Going Deeper with Breach Analytics
Sometimes a yes or no isn’t enough. You want the full picture. When did this start? How bad is it? What exactly got leaked?
That’s where breach analytics comes in. You’ll get a complete breakdown of an email’s exposure history.
const analytics = await xon.getBreachAnalytics('user@example.com');
console.log(`First breach: ${analytics.firstBreach}`);
console.log(`Total exposures: ${analytics.exposureCount}`);
console.log(`Risk level: ${analytics.riskLevel}`); analytics = xon.breach_analytics("user@example.com")
print(f"First breach: {analytics.first_breach}")
print(f"Exposure count: {analytics.exposure_count}") You’ll get metrics broken down by industry, by year, and by risk level. Each breach is listed with details about what data types were exposed, emails, passwords, phone numbers, addresses, and whatever was in that particular leak.
This is the kind of data you’d want for a security dashboard. Or a detailed report for users who want to understand their exposure.
Browsing the Breach Database
Curious what breaches are out there? You can pull the entire catalog. Or filter it down to a specific domain if you’re investigating something.
// Get everything
const allBreaches = await xon.getBreaches();
// Or filter by domain
const breaches = await xon.getBreaches({ domain: 'linkedin.com' });
# Get everything
all_breaches = xon.get_breaches()
# Or filter by domain
breaches = xon.get_breaches(domain="linkedin.com")
Each breach record includes the date it happened, what data types got exposed, how many records were affected, the industry that got hit, and whether the breach has been verified. Useful context when you’re explaining exposure to end users.
We Handled the Annoying Stuff
APIs have quirks. Rate limits, timeouts, flaky connections. Nobody wants to write that boilerplate for the hundredth time.
So we built it in.
Hit a rate limit? The SDK backs off and retries automatically with exponential backoff. No babysitting required. It just works.
Errors are specific too. You’ll get RateLimitError, ValidationError, NotFoundError, or NetworkError, not some generic exception that tells you nothing. Catch what you care about, let the rest bubble up.
try {
const result = await xon.checkEmail(email);
} catch (error) {
if (error instanceof RateLimitError) {
// Maybe wait and retry, or queue for later
}
if (error instanceof ValidationError) {
// Bad email format, tell the user
}
} Need to tweak the defaults? You can configure timeouts, retry counts, and custom headers when you initialize the client.
const xon = new XposedOrNot({
timeout: 10000, // 10 seconds
retries: 5
}); And if you’re using TypeScript, you get full type definitions out of the box. Your autocomplete will actually work. Your IDE will catch mistakes before you run anything.
Where Does This Fit?
A few ideas to get you thinking.
User registration. When someone signs up, check if their email’s been in a breach. You’re not blocking them just nudging them toward a strong, unique password. A small thing that builds trust.
Security dashboards. Breach analytics gives you the numbers and trends you need. Show users their exposure over time, break it down by risk level, and list the specific incidents.
Account recovery flows. Is someone resetting their password? Good time to mention if their email’s been floating around in breach databases.
Internal security audits. Scan your team’s work emails and see what’s been exposed. Credential stuffing attacks are real. Better to know where you stand.
Go Build Something
Both SDKs are MIT-licensed and fully open source. Use them however you want.
– https://www.npmjs.com/package/xposedornot
– https://pypi.org/project/xposedornot/
– https://github.com/XposedOrNot/XposedOrNot-JS
– https://github.com/XposedOrNot/XposedOrNot-Python
Found a bug? Have an idea? The repos are open for issues and pull requests. Happy building.