A PHP Package built for the haveibeenpwned.com API.

v0.1 2017-09-04 04:49 UTC

This package is auto-updated.

Last update: 2021-02-12 12:11:31 UTC


A PHP Library built for ';--have i been pwned?

Actively Maintained Latest Stable Version Total Downloads Scrutinizer Code Quality Build Status Codacy Badge License

Table of contents


  1. This uses only API v2.
  2. PHP 7 or higher.


Open your composer.json file and add the following to the require key:

"ridvanbaluyos/haveibeenpwned": "v0.1"

After adding the key, run composer update from the command line to install the package

composer install


composer update


// namespace and autoloaders
use \Ridvanbaluyos\Pwned\BreachedAccount as BreachedAccount;
require_once __DIR__ . '/vendor/autoload.php';

$breachedAccount = new BreachedAccount();
$result = $breachedAccount->setAccount('test@example.com')->get();

Breached Account

use \Ridvanbaluyos\Pwned\BreachedAccount as BreachedAccount;

$breachedAccount = new BreachedAccount();
$result = $breachedAccount->setAccount('test@example.com')

Breached Sites

use \Ridvanbaluyos\Pwned\Breaches as Breaches;

$breachedSites = new Breaches();
$result = $breachedSites->setDomain('adobe.com')->get();

Data Classes

use \Ridvanbaluyos\Pwned\DataClasses as DataClasses;

$dataClasses = new DataClasses();
$result = $dataClasses->get();

Pastes Account

use \Ridvanbaluyos\Pwned\PasteAccount as PasteAccount;

$pasteAccount = new PasteAccount();
$result = $pasteAccount->setAccount('test@example.com')->get();

Pwned Passwords

Note: Please be careful when using this. Do not send any password you actively use to a third-party service - even this one!

use Ridvanbaluyos\Pwned\PwnedPasswords as PwnedPasswords;

$pwnedPasswords = new PwnedPasswords();
$result = $pwnedPasswords->setPassword('password123')->get();