npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

nuban-prediction

v1.1.6

Published

Predict banks using account number

Readme

NUBAN Bank Predictor

Overview

In the Nigerian financial ecosystem, while many APIs provide account owner names based on bank and account number, there's a significant gap: the ability to suggest the corresponding bank solely from an account number. This library addresses that challenge by providing a robust solution to predict the likely bank(s) associated with a given NUBAN (Nigerian Uniform Bank Account Number) or even identify fintech platforms based on phone numbers.

Problem Solved

Traditional bank account validation often requires both the bank code and the account number. This library fills a crucial need by allowing developers to determine potential banks when only the NUBAN is available, streamlining user experience and reducing friction in financial applications.

Features

  • NUBAN to Bank Prediction: Accurately predicts possible banks for a given 10-digit NUBAN using the official NUBAN check digit algorithm.
  • Fintech Identification (Phone Numbers): Identifies popular fintech platforms (like OPay, PalmPay, Moniepoint) when a valid Nigerian phone number is provided as input.
  • Smart Prioritization: Intelligently prioritizes and orders suggested banks based on:
    • Specific Moniepoint NUBAN prefixes.
    • A predefined list of popular banks (e.g., Access Bank, Zenith Bank, UBA).
  • Comprehensive Bank Data: Utilizes an up-to-date list of Nigerian banks and their codes.
  • Easy to Integrate: Designed as a simple, importable JavaScript function.

Installation

To install the library, use npm:

npm install nuban-prediction

Usage

Importing the Function

You can import the getPredictedBanks function into your JavaScript/Node.js project:

const getPredictedBanks = require("nuban-prediction");
// Or for ES Modules:
// import getPredictedBanks from 'nuban-bank-predictor';

NUBAN Prediction

Use a 10-digit NUBAN as input to get a list of possible banks. The list will be prioritized based on internal logic.

const nuban = "0088064294"; // Example NUBAN for Access Bank
const possibleBanks = getPredictedBanks(nuban);
console.log(possibleBanks);
/*
Example Output (order may vary based on prioritization):
[
  { name: 'Access Bank', code: '044' },
  { name: 'First Bank of Nigeria', code: '011' },
  // ... other matching banks
]
*/

const moniepointNuban = "5600000011"; // Example NUBAN for Moniepoint
const moniepointResult = getPredictedBanks(moniepointNuban);
console.log(moniepointResult);
/*
Example Output:
[
  { name: 'Moniepoint MFB', code: '50515' },
  // ... other matching banks
]
*/

Phone Number Prediction

Use a valid Nigerian phone number (e.g., 8012345678 or 9012345678) as input to get a list of associated fintechs. Moniepoint will be added if the phone number starts with specific prefixes (90, 81).

const genericPhoneNumber = "8012345678";
const fintechs = getPredictedBanks(genericPhoneNumber);
console.log(fintechs);
/*
Example Output:
[
  { name: 'OPay Digital Services Limited (OPay)', code: '999992' },
  { name: 'PalmPay', code: '999991' },
  // ... other base fintechs
]
*/

const moniepointPhoneNumber = "9012345678";
const moniepointFintechs = getPredictedBanks(moniepointPhoneNumber);
console.log(moniepointFintechs);
/*
Example Output:
[
  { name: 'OPay Digital Services Limited (OPay)', code: '999992' },
  { name: 'PalmPay', code: '999991' },
  { name: 'Moniepoint MFB', code: '50515' }
  // ... other base fintechs
]
*/

Output Structure

The function returns an array of objects. Each object represents a bank or fintech and has the following structure:

{
  name: "Bank Name", // The full name of the bank/fintech
  code: "Bank Code"  // The bank/fintech code
}

Prioritization Logic

When predicting banks for a NUBAN, the library applies the following prioritization:

  1. Moniepoint Specific Prefixes: If the NUBAN starts with certain prefixes (56, 54, 81, 50, 53, 55, 82, 63, 58, 57, 59, 65, 90) and "Moniepoint MFB" is a valid match, it will be moved to the very top of the list.
  2. Popular Banks: After the Moniepoint rule, a predefined list of popular banks (e.g., OPay, Kuda, UBA, Access Bank, Zenith Bank) are moved to the top of the list, maintaining their relative order.
  3. Remaining Banks: Any other banks that mathematically match the NUBAN will follow, in no specific order.

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

This project is licensed under the MIT License.