Generate BIC from IBAN bank account number

I do not think such library exists (at least for free).

The only reliable way to do this is by using the SWIFT IBAN Plus Directory (formely known as the SWIFT BICplusIBAN Directory.

This directory is provided by SWIFT, which is the IBAN registrar. With it you can match IBAN to various institutions information (including BIC).

The SWIFT IBAN Plus Directory is regularly updated by SWIFT with the latest data, is accessible as a file or via WebService APIs, and unfortunately is not available for free.


Found solution for all IBAN accounts (I think):

https://openiban.com/validate/IBAN_NUMBER?getBIC=true

If you make a CURL call for example to that URL, you will get the Account bank info for free. Replace IBAN_NUMBER with your IBAN account.

Example:

`https://openiban.com/validate/DE89370400440532013000?getBIC=true`

Result:

{
  "valid": true,
  "messages": [],
  "iban": "DE89370400440532013000",
  "bankData": {
    "bankCode": "37040044",
    "name": "Commerzbank",
    "zip": "50447",
    "city": "Köln",
    "bic": "COBADEFFXXX"
  },
  "checkResults": {}
}

Important Update

OpenIBAN has shut down it's API service due to the GDPR regulations posing unknown risks on the service provider. See the statement on openIBAN.com. There is also a link to a self-hosting guide included, see this github page.

Update (2019/07/25)

Openiban is back online.

Tags:

Php

Iban