PHPackages                             laszlof/php-hibp - 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. laszlof/php-hibp

ActiveLibrary

laszlof/php-hibp
================

A PHP library for communicating with the HaveIBeenPwned.com API

0.1.2(8y ago)021MITPHPPHP ^7.0

Since Oct 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/laszlof/php-hibp)[ Packagist](https://packagist.org/packages/laszlof/php-hibp)[ RSS](/packages/laszlof-php-hibp/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

PHP HaveIBeenPwned.Com SDK
==========================

[](#php-haveibeenpwnedcom-sdk)

[![Build Status](https://camo.githubusercontent.com/a50df226dea9abd865ab863210d87cd06cd97b817cd8e0f4bafc5624dcd02aa4/68747470733a2f2f7472617669732d63692e6f72672f6c61737a6c6f662f7068702d686962702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/laszlof/php-hibp)

`laszlof/php-hibp` is an SDK which allows PHP developers to easily communicate with the [API](https://haveibeenpwned.com/API/v2) provided by [HaveIBeenPwned.Com](https://haveibeenpwned.com).

Requirements
------------

[](#requirements)

- PHP 7.0+

How to install
--------------

[](#how-to-install)

```
composer require laszlof/php-hibp
```

Usage
-----

[](#usage)

### Get a list of breaches for a specific acccount (username/email)

[](#get-a-list-of-breaches-for-a-specific-acccount-usernameemail)

```
use Hibp\Hibp;

$account = 'you@yourdomain.com';
$breaches = Hibp::getBreaches($account);
```

### Get a single breach by name

[](#get-a-single-breach-by-name)

```
use Hibp\Hibp;

$name = 'Adobe';
$breach = Hibp::getBreach($account);
```

### Get a list of sites that have been breached (optionally filtered by domain)

[](#get-a-list-of-sites-that-have-been-breached-optionally-filtered-by-domain)

```
use Hibp\Hibp;

$breaches = Hibp::getBreachedSites();

$domain = 'adobe.com';
$breaches = Hibp::getBreachedSites($domain);
```

### Get a list of the types of dataclasses

[](#get-a-list-of-the-types-of-dataclasses)

```
use Hibp\Hibp;

$dataClasses = Hibp::getDataClasses();
```

### Get a list of pastes for a specific acccount (username/email)

[](#get-a-list-of-pastes-for-a-specific-acccount-usernameemail)

```
use Hibp\Hibp;

$account = 'you@yourdomain.com';
$breaches = Hibp::getPastes($account);
```

### Check if a password has been compromised.

[](#check-if-a-password-has-been-compromised)

```
use Hibp\Hibp;

$password = 'password123';
$isCompromised = Hibp::checkPassword($password);

// Optionally check with a password that IS a hash itself.
$password_is_a_hash = '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8';
$isCompromised = Hibp::checkPassword($password_is_a_hash, true);
```

Links
-----

[](#links)

- [HaveIBeenPwned](https://haveibeenpwned.com/)
- [HIBP API v2](https://haveibeenpwned.com/API/v2)
- [Google](https://www.google.com)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

3140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f9020992f3afd0e5dcfc59ea5cea9c3370176036e88cd891098fe459fbe6159e?d=identicon)[laszlof](/maintainers/laszlof)

---

Top Contributors

[![laszlof](https://avatars.githubusercontent.com/u/1486486?v=4)](https://github.com/laszlof "laszlof (14 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laszlof-php-hibp/health.svg)

```
[![Health](https://phpackages.com/badges/laszlof-php-hibp/health.svg)](https://phpackages.com/packages/laszlof-php-hibp)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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