PHPackages                             cryental/php-banks-db - 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. [Database &amp; ORM](/categories/database)
4. /
5. cryental/php-banks-db

ActiveLibrary[Database &amp; ORM](/categories/database)

cryental/php-banks-db
=====================

PHP bank cards IIN/BIN database. Get bank info by card number

v0.3.5(4y ago)089[2 PRs](https://github.com/Cryental/php-banks-db/pulls)MITPHPPHP &gt;=7.2

Since Jul 2Pushed 1y agoCompare

[ Source](https://github.com/Cryental/php-banks-db)[ Packagist](https://packagist.org/packages/cryental/php-banks-db)[ Docs](https://github.com/cryental/php-banks-db)[ RSS](/packages/cryental-php-banks-db/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (15)Used By (0)

PHP Banks DB
============

[](#php-banks-db)

[![Build Status](https://camo.githubusercontent.com/5e353ab06c1cb22a5705085e8e482387c2af51a79a5499a26ad4fb68052d5682/68747470733a2f2f7472617669732d63692e636f6d2f6368656b616c736b792f7068702d62616e6b732d64622e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/chekalsky/php-banks-db) [![codecov](https://camo.githubusercontent.com/9e40f9a15c7357e4cfc9992da8eb3e5eb252964534e2fb4680369f60e8fd3c94/68747470733a2f2f636f6465636f762e696f2f67682f6368656b616c736b792f7068702d62616e6b732d64622f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/chekalsky/php-banks-db)

> It is a PHP port of [ramoona's banks-db](https://github.com/ramoona/banks-db).

Returns bank's name and brand color by bank card number's first digits (BIN, Issuer Identification Numbers, IIN).

### Installation

[](#installation)

```
composer require chekalskiy/php-banks-db

```

### Basic usage

[](#basic-usage)

```
$card_prefix = '5275 9400 0000 0000'; // we only need first 6 digits but it could be the whole card number

try {
    $bank_db = new BankDb();
    $bank_info = $bank_db->getBankInfo($card_prefix);

    $result = [
        'is_unknown' => $bank_info->isUnknown(), // is bank unknown
        'name' => $bank_info->getTitle(true),
        'color' => $bank_info->getColor(),
        'type' => $bank_info->getCardType(),
    ];

    return $result;
} catch (BankDbException $e) {
    // todo handle exception
}
```

### About database

[](#about-database)

We use simple PHP-file with an array inside (it's regenerates every time ramoona's repository is updated). It's very fast and simple way to work with data because of opcache enabled by default in PHP 7. But you can extend `BankDB` class to make it work with redis or something, but for most cases compiled php-file is OK.

#### Database update

[](#database-update)

Database updates from [original library](https://github.com/ramoona/banks-db) by me. To update php cache file after manual database change run `composer rebuild`.

### Contributions

[](#contributions)

Feel free to open [an issue](https://github.com/chekalskiy/php-banks-db/issues) on every question you have. If you have new prefixes for database please commit them to [ramoona/banks-db repository](https://github.com/ramoona/banks-db) — I will update them once your PR will me merged there.

---

> It's a community driven database, so it can potentially contains mistakes.

For UI examples see the [original library](https://github.com/ramoona/banks-db).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~133 days

Recently: every ~275 days

Total

11

Last Release

1539d ago

PHP version history (3 changes)v0.1.1PHP &gt;=7.0

v0.2PHP &gt;=7.1

v0.3PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/3458f2ede65204c3184db719894be728fe5c0882eba558604036a046adb6da12?d=identicon)[Cryental](/maintainers/Cryental)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (4 commits)")[![Cryental](https://avatars.githubusercontent.com/u/44664655?v=4)](https://github.com/Cryental "Cryental (3 commits)")[![chekalsky](https://avatars.githubusercontent.com/u/241584?v=4)](https://github.com/chekalsky "chekalsky (2 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (2 commits)")[![Phrlog](https://avatars.githubusercontent.com/u/9060150?v=4)](https://github.com/Phrlog "Phrlog (1 commits)")

---

Tags

creditcardcardbinIINissuer identification numbers

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/cryental-php-banks-db/health.svg)

```
[![Health](https://phpackages.com/badges/cryental-php-banks-db/health.svg)](https://phpackages.com/packages/cryental-php-banks-db)
```

###  Alternatives

[chekalskiy/php-banks-db

PHP bank cards IIN/BIN database. Get bank info by card number

15289.8k](/packages/chekalskiy-php-banks-db)[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)[inacho/php-credit-card-validator

Validates popular debit and credit cards numbers against regular expressions and Luhn algorithm. Also validates the CVC and the expiration date

2051.4M11](/packages/inacho-php-credit-card-validator)

PHPackages © 2026

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