Using Have I Been Pwned to Prevent Your Users from Using Breached Passwords
developer.okta.com
developer.okta.com
I haven't heard of k-Anonymity, so maybe I'm misunderstanding, but wouldn't there be a high rate of collision if you're only testing 5 characters? Seems like you'd match a lot of uncompromised hashes.
This URL is the entire API. Just change the last parameter to whatever 5 characters you want:
https://api.pwnedpasswords.com/range/aaaaa
Note that the returned hashes omit the first 5 characters, since that would be a waste of resources.
You should also note that ALL possible combinations of 5 characters return at least 300 results. So it doesn't make sense to use this API any other way.
Code at https://github.com/OktaSecurityLabs/passprotect-js/blob/mast...
At some point they made a number and a special character a requirement in the password and the code was either stripped (or still sat there and never triggered). The irony isn't entirely lost on me.