PHPackages                             xsist10/haveibeenpwned - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. xsist10/haveibeenpwned

ActiveLibrary[API Development](/categories/api)

xsist10/haveibeenpwned
======================

Client for the "Have I Been Pwned" API

1.2.0(8y ago)1521.0k↓73.8%8[1 issues](https://github.com/xsist10/HaveIBeenPwned/issues)MITPHPPHP &gt;=5.5

Since Jun 21Pushed 7y ago2 watchersCompare

[ Source](https://github.com/xsist10/HaveIBeenPwned)[ Packagist](https://packagist.org/packages/xsist10/haveibeenpwned)[ RSS](/packages/xsist10-haveibeenpwned/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (3)Versions (10)Used By (0)

HaveIBeenPwned PHP client
=========================

[](#haveibeenpwned-php-client)

[![Build Status](https://camo.githubusercontent.com/97d1b58c937cc03637338a68bd9d8455b173ab88848bf979701f4db83c21be23/68747470733a2f2f7472617669732d63692e6f72672f787369737431302f48617665494265656e50776e65642e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/97d1b58c937cc03637338a68bd9d8455b173ab88848bf979701f4db83c21be23/68747470733a2f2f7472617669732d63692e6f72672f787369737431302f48617665494265656e50776e65642e7376673f6272616e63683d6d6173746572)

Install
-------

[](#install)

```
{
    "require": {
        "xsist10/haveibeenpwned": "~1.0"
    }
}
```

Usage
-----

[](#usage)

### Create manager instance

[](#create-manager-instance)

```
use xsist10\HaveIBeenPwned\HaveIBeenPwned;
use xsist10\HaveIBeenPwned\Adapter\Curl;
use xsist10\HaveIBeenPwned\Adapter\FileGetContents;

// By default the $manager will use a Curl adapter
$manager = new HaveIBeenPwned();

// You can create a new manager with a specified adapter
$manager = new HaveIBeenPwned(new Curl());

// You can also set the adapter after creation
$manager->setAdapter(new FileGetContents());
```

### Check if you've been pwned

[](#check-if-youve-been-pwned)

```
$manager->checkAccount("your_email_address");
```

### Check if your account has been leaked in a paste

[](#check-if-your-account-has-been-leaked-in-a-paste)

```
$manager->getPasteAccount("your_email_address");
```

### Check if your password has been leaked before

[](#check-if-your-password-has-been-leaked-before)

```
// Your password is not sent to the remote API. Only a partial of the SHA1
// value is sent and all matching full SHA1 results are returned and compared.
$numberOfTimesCompromised = $manager->isPasswordCompromised("your_password");
```

### List all breaches that have are on record

[](#list-all-breaches-that-have-are-on-record)

```
$manager->getBreaches();

$manager->getBreach('specific_breach_by_name');
```

### List the types of data that are covered when describing a leak

[](#list-the-types-of-data-that-are-covered-when-describing-a-leak)

```
$manager->getDataClasses();
```

Logger Support
--------------

[](#logger-support)

The adapters support [PSR-3 Logger](http://www.php-fig.org/psr/psr-3/). I recommend using [monolog](https://github.com/Seldaek/monolog).

### Install Monolog

[](#install-monolog)

```
$ composer require monolog/monolog
```

### Use Monolog with HaveIBeenPwned

[](#use-monolog-with-haveibeenpwned)

```
use xsist10\HaveIBeenPwned\HaveIBeenPwned;
use xsist10\HaveIBeenPwned\Adapter\Curl;

use Monolog\Logger;
use Monolog\Handler\StreamHandler;

$log = new Logger('name');
// Push all logging up to the level of DEBUG to our log file
$log->pushHandler(new StreamHandler('[full log filename]', Logger::DEBUG));

$adapter = new Curl();
$adapter->setLogger($log);
$manager = new HaveIBeenPwned($adapter);

// Calls made to HaveIBeenPwned will be logged to your log file now
```

Credits
-------

[](#credits)

- [Troy Hunt](https://github.com/troyhunt) for creating
- [Thomas Shone](https://github.com/xsist10)
- [Chung-Sheng, Li](https://github.com/peter279k)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/xsist10/HaveIBeenPwned/blob/master/LICENSE) for more information.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 91.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~192 days

Recently: every ~60 days

Total

8

Last Release

3048d ago

PHP version history (2 changes)1.0.1PHP &gt;=5.3.2

1.0.4PHP &gt;=5.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/415488?v=4)[Thomas Shone](/maintainers/xsist10)[@xsist10](https://github.com/xsist10)

---

Top Contributors

[![xsist10](https://avatars.githubusercontent.com/u/415488?v=4)](https://github.com/xsist10 "xsist10 (22 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (2 commits)")

---

Tags

password-safetyphpsecurity-tools

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xsist10-haveibeenpwned/health.svg)

```
[![Health](https://phpackages.com/badges/xsist10-haveibeenpwned/health.svg)](https://phpackages.com/packages/xsist10-haveibeenpwned)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M737](/packages/sylius-sylius)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69735.1M159](/packages/algolia-algoliasearch-client-php)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[keboola/storage-api-client

Keboola Storage API PHP Client

10405.9k40](/packages/keboola-storage-api-client)[flowwow/cloudpayments-php-client

cloudpayments api client

21101.2k](/packages/flowwow-cloudpayments-php-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
