PHPackages                             chekalskiy/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. chekalskiy/php-banks-db

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

chekalskiy/php-banks-db
=======================

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

v1.0.0(1y ago)15289.8k↓15.4%19[1 PRs](https://github.com/chekalskiy/php-banks-db/pulls)MITPHPPHP &gt;=8.3CI passing

Since Jul 2Pushed 10mo ago6 watchersCompare

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

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

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

[](#php-banks-db)

[![PHP Tests](https://github.com/chekalsky/php-banks-db/actions/workflows/ci.yml/badge.svg)](https://github.com/chekalsky/php-banks-db/actions/workflows/ci.yml)

> 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

55

—

FairBetter than 98% of packages

Maintenance49

Moderate activity, may be stable

Popularity48

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

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

Recently: every ~547 days

Total

11

Last Release

458d ago

Major Versions

v0.3.4 → v1.0.02025-02-15

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

v0.2PHP &gt;=7.1

v0.3PHP &gt;=7.2

v1.0.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a23d829168f130bd1e8113dd18c0e490d02d47c2f455b90ed2197ab0e04b228?d=identicon)[chekalskiy](/maintainers/chekalskiy)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (4 commits)")[![chekalsky](https://avatars.githubusercontent.com/u/241584?v=4)](https://github.com/chekalsky "chekalsky (3 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

bankbank-cardbanks-dbbincredit-cardiincreditcardcardbinIINissuer identification numbers

###  Code Quality

TestsPHPUnit

Static AnalysisRector

### Embed Badge

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

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[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)[hipsterjazzbo/landlord

A simple, single database multi-tenancy solution for Laravel 5.2+

613270.0k1](/packages/hipsterjazzbo-landlord)[stancl/virtualcolumn

Eloquent virtual column.

826.8M13](/packages/stancl-virtualcolumn)

PHPackages © 2026

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