A password leak check API that never sends the password
The standard way to check a password for leaks is Have I Been Pwned's Pwned Passwords range API: you hash the password with SHA-1, send only the first 5 characters of the hash, and compare the returned suffixes on your side. It's free, needs no key and never sees the password. Our Password Strength & Breach Check API does that lookup for you and adds a strength score, crack-time estimates and plain warnings for $0.003 per call.
Try it free Password Strength & Breach Check API, $0.003 · $0.003 / call
How a leak check can work without the password
Hundreds of hashes share any 5-character prefix, so the service can't tell which one you checked. Sending the header Add-Padding: true also hides the real size of the answer, which our API does on every lookup.
- Hash the password with SHA-1 and write it as 40 hex characters.
- Send the first 5 characters to api.pwnedpasswords.com/range/ followed by those 5 characters.
- Get back every hash suffix in that range with a count of how often it was seen in breaches.
- Look for your remaining 35 characters in the list. A match means the password is leaked.
Do it yourself in Python (free)
If a breach count is all you need, this is the cheapest option and it is what we recommend for your own server.
import hashlib, requests
def times_leaked(password: str) -> int:
sha = hashlib.sha1(password.encode()).hexdigest().upper()
r = requests.get(f"https://api.pwnedpasswords.com/range/{sha[:5]}",
headers={"Add-Padding": "true", "User-Agent": "my-app"}, timeout=10)
for line in r.text.splitlines():
suffix, count = line.split(":")
if suffix == sha[5:]:
return int(count)
return 0
print(times_leaked("P@ssw0rd"))
What the paid API adds
- A 0–4 score and a verdict you can act on: do_not_use, weak, ok or strong.
- Crack-time estimates for throttled online guessing and for offline attacks on slow and fast hashes.
- Patterns found: one of the 1,000 most common passwords, keyboard runs, repeats, years, dates and look-alike symbols like @ for a.
- Warnings and short suggestions you can show next to a sign-up form.
- The same k-anonymity breach lookup, or none at all if you send "check_breach": false.
One call
The password reaches our server over HTTPS for the strength check, so the honest privacy claim is this: it isn't stored, logged or returned, and only 5 hash characters go on to Have I Been Pwned. If you can't send a password to any third party, use the free code above instead.
curl -i -X POST https://iamai.markets/api/x402/services/6oBaKW6x8zP0 \
-H "Content-Type: application/json" \
-d '{"password": "P@ssw0rd"}'
# First answer: HTTP 402 with the price ($0.003).
# An x402 v2 client pays in USDC on Base and repeats the request.
# "P@ssw0rd" comes back as score 0, verdict do_not_use,
# rank #1 on the common list (with look-alike symbols) and seen in breaches millions of times.
Options compared
| Option | Breach count | Strength score | Cost |
|---|---|---|---|
| Pwned Passwords range API | Yes | No | Free, no key |
| zxcvbn library in your app | No | Yes, offline | Free |
| Password Strength & Breach Check (iamai.markets) | Yes | Yes, with patterns | $0.003 per call |
The product
Questions
Is it safe to send a password to a leak check API?
Only to one you trust with it. The range API design avoids sending it at all; our API receives it for the strength part and passes on only 5 SHA-1 characters.
Does a zero breach count mean the password is safe?
No. It means it isn't in the known breach lists. A short or patterned password can still be guessed quickly, which is why the score matters too.
Can I test it without a wallet?
Yes. The listing page gives 5 free tries a day.
Related
Updated 2026-12-02
