Generate BIC number from IBAN Number
Asked Answered
P

1

8

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?

Penelope answered 17/1, 2019 at 6:57 Comment(6)
Can you check this API linkTriton
The only thing that is guaranteed is that the the IBAN has a maximum length of 34, 2 letters country code, 2 check digits and followed by up to 30 characters that are completely country dependent. There was even an idea that if you change your bank within the country that you can keep your IBAN and that BIC and Account number are only used in the transition phase to create the IBAN. As long as this is not the case you can use the list on wikipedia IBAN formats by country to and convert those to a regexp.Strickman
@Triton Yes, it works. But api gives 20 daily request and have to upgrade more request. btw thanksPenelope
yeah I know, but cant get all the things include in BIC from IBAN by converting those to a regexp. The article that you provide will be helped to build module. Thanks @StrickmanPenelope
@SarasaGunawardhana well you could copy the columns containing GBkk bbbb ssss sscc cccc cc create a matcher by counting the number of each group GB, 2x k, 4x b, 6x s, 8x c, and build a regexp out of that for each country code, and then loop over all those regexp to check if there is a match. Should be straightforward given those columns.Strickman
The api you gave in your question is back online openiban.comDanish
D
10

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.
Distributary answered 17/1, 2019 at 7:29 Comment(1)
Yes, Your answer seems right, I am working on it now. Thanks @Distributary :)Penelope

© 2022 - 2024 — McMap. All rights reserved.