Skip to main content

Check if a password is leaked

GET/v2/leaked-passwords/{passwordHashPrefix}
API version
v2
Request method
GET
Operation ID
user-searched-leaked-passwords-by-range

Request​

  • passwordHashPrefixstring (≤ 5 characters)required

    First 5 characters of the SHA1 hash of a password.

Responses​

Format
application/json
Description

All password hashes beginning with the searched prefix are returned alongside prevalence counts.

  • Array[
    • *string
    ]
Content-Type: application/json

"[\"0018A45C4D1DEF81644B54AB7F969B88D65\", \"00D4F6E8FA6EECAD2A3AA415EEC418D38EC\", \"011053FD0102E94D6AE2F8B83D76FAF94F6\", \"012A7CA357541F0AC487871FEEC1891C49C\", \"0136E006E24E7D152139815FB0FC6A50B15\"]'\n"
{
"example": "[\"0018A45C4D1DEF81644B54AB7F969B88D65\", \"00D4F6E8FA6EECAD2A3AA415EEC418D38EC\", \"011053FD0102E94D6AE2F8B83D76FAF94F6\", \"012A7CA357541F0AC487871FEEC1891C49C\", \"0136E006E24E7D152139815FB0FC6A50B15\"]'\n",
"items": {
"type": "string"
},
"type": "array"
}

Usage examples​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/leaked-passwords/0018A
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.user.searchedLeakedPasswordsByRange({
"passwordHashPrefix": "0018A"
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\User\SearchedLeakedPasswordsByRange\SearchedLeakedPasswordsByRangeRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new SearchedLeakedPasswordsByRangeRequest(
passwordHashPrefix: "0018A"
));
$response = $client->user()->searchedLeakedPasswordsByRange($request);

var_dump($response->getBody();

On this page