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. [API Development](/categories/api)
4. /
5. laszlof/php-hibp

ActiveLibrary[API Development](/categories/api)

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 2w ago

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 26% 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

3188d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1486486?v=4)[Frank Laszlo](/maintainers/laszlof)[@laszlof](https://github.com/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

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[avalara/avataxclient

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

528.3M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1942.4k4](/packages/aimeos-prisma)

PHPackages © 2026

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