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 🙏

© 2026 – Pkg Stats / Ryan Hefner

naija-banks-branches-sortcode

v1.0.0

Published

Lightweight NPM package for Nigerian banks, branches and sort-codes.

Readme

Nigerian Banks Branches and Sort Codes

Lightweight NPM package for Nigerian banks, branches, and sort codes. This package provides comprehensive data about Nigerian banks including their branches across different states and local government areas.

🏠 Homepage

Features

  • ✅ Get all Nigerian banks with their sort codes and USSD codes
  • ✅ Search banks by name, code, abbreviation, or USSD
  • ✅ Get all branches in a specific state
  • ✅ Get branches for a specific bank in a specific state
  • NEW: Search branches by Local Government Area (LGA)
  • NEW: Get all banks available in a specific state
  • NEW: Enhanced search functionality with better error handling

Installation

npm install naija-banks-branches-sortcode

Usage

Basic Usage

const Naijabanks = require('naija-banks-branches-sortcode');

// Get all banks
const allBanks = Naijabanks.all();

// Search bank by name
const ubaBank = Naijabanks.banks('UBA');

// Search bank by sort code
const bankByCode = Naijabanks.bankCodes('033');

// Search bank by abbreviation
const bankByAbb = Naijabanks.bankAbb('UBA');

// Search bank by USSD code
const bankByUssd = Naijabanks.bankUssd('*919#');

State-based Searches

// Get all banks in a specific state
const osunBanks = Naijabanks.getAllBanksInState('Osun');

// Get all branches in a state
const osunBranches = Naijabanks.getBranchesByState('Osun');

// Get branches for a specific bank in a state
const ubaOsunBranches = Naijabanks.getBranchesByBankAndState('UBA', 'Osun');

Local Government Area (LGA) Search

This is the main feature you requested - searching for branches by Local Government Area:

// Search for UBA branches in Ilesha East LGA, Osun State
const ubaIleshaBranches = Naijabanks.searchBranchesByLGA('UBA', 'Osun', 'Ilesha');

// Example: Find UBA branches in Ilesha East LGA
if (ubaIleshaBranches.length > 0) {
    ubaIleshaBranches.forEach(branch => {
        console.log(`Branch: ${branch.branch}`);
        console.log(`Code: ${branch.branchcode}`);
        console.log(`Address: ${branch.branchaddress}`);
    });
} else {
    console.log('No UBA branches found in Ilesha East LGA');
}

API Reference

Core Functions

  • all() - Get all banks in the database
  • banks(bankName) - Search bank by name
  • bankCodes(code) - Search bank by sort code
  • bankAbb(abbreviation) - Search bank by abbreviation
  • bankUssd(ussdCode) - Search bank by USSD code

State-based Functions

  • getAllBanksInState(state) - Get all banks available in a specific state
  • getBranchesByState(state) - Get all branches in a specific state
  • getBranchesByBankAndState(bank, state) - Get branches for a specific bank in a state

LGA Search Function

  • searchBranchesByLGA(bank, state, lga) - Search for branches by Local Government Area

Examples

Example 1: Find UBA branches in Ilesha East LGA

const Naijabanks = require('naija-banks-branches-sortcode');

// You're in Osun State, Ilesha East LGA and want to find UBA branches
const ubaBranches = Naijabanks.searchBranchesByLGA('UBA', 'Osun', 'Ilesha');

console.log(`Found ${ubaBranches.length} UBA branches in Ilesha East LGA:`);
ubaBranches.forEach(branch => {
    console.log(`- ${branch.branch} (${branch.branchcode})`);
    console.log(`  Address: ${branch.branchaddress}`);
});

Example 2: Get all banks in Osun State

const osunBanks = Naijabanks.getAllBanksInState('Osun');
console.log('Banks available in Osun State:');
osunBanks.forEach(bank => {
    console.log(`- ${bank.bank} (${bank.code}): ${bank.branchCount} branches`);
});

Example 3: Search for branches in different LGAs

const searchExamples = [
    { bank: 'UBA', state: 'Osun', lga: 'Ilesha' },
    { bank: 'First Bank', state: 'Osun', lga: 'Oshogbo' },
    { bank: 'Zenith', state: 'Osun', lga: 'Ile Ife' }
];

searchExamples.forEach(example => {
    const results = Naijabanks.searchBranchesByLGA(
        example.bank, 
        example.state, 
        example.lga
    );
    console.log(`${example.bank} branches in ${example.lga}: ${results.length} found`);
});

Data Structure

Each bank object contains:

{
    "bank": "UNITED BANK FOR AFRICA PLC",
    "code": "033",
    "abb": "UBA",
    "ussd": "*919#",
    "state": {
        "Osun": [
            {
                "branch": "ILESHA BRANCH",
                "branchcode": "164",
                "branchaddress": "107A, ORINKIRAN STREET, OSHOGBO ROAD, ILESHA,OSUN STATE."
            }
        ]
    }
}

Supported Banks

  • Access Bank (Diamond Bank)
  • Citibank Nigeria PLC
  • Ecobank Nigeria PLC
  • Fidelity Bank PLC
  • First Bank Nigeria Limited
  • First City Monument Bank PLC
  • Guaranty Trust Bank PLC
  • Heritage Bank PLC
  • Polaris Bank Limited
  • Providus Bank Limited
  • Stanbic IBTC Bank Ltd
  • Standard Chartered Bank Nigeria Ltd
  • Sterling Bank PLC
  • Union Bank of Nigeria PLC
  • United Bank for Africa PLC
  • Wema Bank PLC
  • Zenith Bank PLC

Running Examples

# Run the main example
npm run example

# Or run specific examples
node examples/index.js
node examples/search-by-lga.js
node examples/bank-info.js

Prerequisites

  • npm 6.0.0+
  • node 14.0.0+

Install

npm install

Run tests

npm run test

Node.js Version Compatibility

This package now supports Node.js versions 14.0.0 and above, and npm versions 6.0.0 and above.

Author

👤 Oludare Dominic

🤝 Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2021 Oludare Dominic. This project is ISC licensed.

Issues

If you encounter any issues, please report them on the GitHub issues page.


This README was generated with ❤️ by readme-md-generator