javascriptnode.jsbankingiban

Generate BIC number from IBAN Number


In my past research, I found these questions which were not answered to my liking:

  1. Generate BIC from IBAN bank account number

  2. How to convert BIC & IBAN to account and sortcode

The 1st answer, gave an API which used to provide BIC from IBAN number. But it has been offline for several months (Update 2019/07/25 : Openiban is back online).

The 2nd answer explains how IBAN and BIC are made.

But it seems impossible to get the entire BIC number from the IBAN.

Below I have listed some IBAN numbers and BIC numbers.

**IBAN NUMBERS**               **BIC**
NL 89 NGB 00071128791         INGBNL2A
NL 80 SNSB 0853811245         SNSBNL2A
NL 91 RABO 0143406515         RABONL2U

iban bic composition

As it suggests, you can get BANK CODE and COUNTRY CODE from the IBAN number. But it is not indicated how one can extract the Bank Identifier

Is it possible to extract Bank Identifier from IBAN number? Is there any working API which I can get this BIC number from IBAN number that I can use in javascript?


Solution

  • I don't think this info (BIC/SWIFT code) is always present in an IBAN number. Looking at the IBAN wiki article every country has its own standard, so only the country prefix and checksum are standardized. The trailing and the longest part is always some sort of bank routing/code concatenated with account number. But the problem is that the bank routing/code is for the majority of countries not the SWIFT code, i.e. not what you're looking for. For example, in Germany they use BLZ which is always digit (I think 8 digits) and 640 901 00 maps to VBRTDE6RXXX BIC code, which won't be present in the IBAN.

    What you can do is:

    1. identify the list of the countries you need to support. Perhaps adding more countries later
    2. get the algorithm for every country from the wiki article above
    3. scrape or find and download somewhere the mapping between bank code <-> BIC/SWIFT code for this country. Have a look at this resource
    4. code your algorithm to separate the bank code from the number and map it to the BIC code from step 3.