Javascript Implementation
Password Request
function loadJSON(callback) {
var xobj = new XMLHttpRequest();
xobj.overrideMimeType("application/json");
xobj.open('GET', 'https://leakedpassword.com/api/?p={your-password}', true);
xobj.onreadystatechange = function () {
if (xobj.readyState == 4 && xobj.status == "200") {
callback(xobj.responseText);
}
};
xobj.send(null);
}
function init() {
loadJSON(function(response) {
var actual_JSON = JSON.parse(response);
console.log(actual_JSON);
});
}
init();
SHA1 Hash Request
function loadJSON(callback) {
var xobj = new XMLHttpRequest();
xobj.overrideMimeType("application/json");
xobj.open('GET', 'https://leakedpassword.com/api/?s={your-sha1-hash}', true);
xobj.onreadystatechange = function () {
if (xobj.readyState == 4 && xobj.status == "200") {
callback(xobj.responseText);
}
};
xobj.send(null);
}
function init() {
loadJSON(function(response) {
var actual_JSON = JSON.parse(response);
console.log(actual_JSON);
});
}
init();
Response
{
"password": {
"leak": true,
"hash": "7110eda4d09e062aa5e4a390b0a572ac0d2c0220",
"seen": 1256907
}
}