SWIFT Code Validation

SWIFT code, also known as BIC (Bank Identifier Code) is the standard international format used by banks and financial institutions globally when transferring money between banks. It’s kind of like each bank’s international code or ID.

A SWIFT code consists of 8-11 alphanumeric characters and contains the bank code (4 letters), the country code (2 letters), the location code (2 characters) and the branch code (3 characters). Note, when the branch code is omitted or shown as “XXX”, the SWIFT code represents the bank’s head office.

For example, SWIFT code NATAAU33033:

When you send money using an invalid SWIFT code, the bank should reverse the transaction and return the money, but this might take some time and your bank may charge you a fee. Using our flexible and fast RESTful API you can validate a SWIFT code and receive all possible information about it - see whether it's valid and which country, bank and branch it belongs to, as well as branch city, address and postcode.

How to validate a SWIFT code

To start using our SWIFT codes API sign up here and create your API key. Pass this key either via x-api-key HTTP header or via api_key query param.

To validate a SWIFT code call /v1/swifts/{swift_code} endpoint using HTTP client of your preference, i.e.:

curl 'https://swiftcodesapi.com/v1/swifts/NATAAU33033' \
    --header 'X-Api-Key: your-api-key-here' \
    --header 'Accept: application/json'
# INSTALLATION
$ composer require guzzlehttp/guzzle
# REQUEST
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://swiftcodesapi.com/v1/swifts/NATAAU33033', [
    'headers' => [
        'Accept' => 'application/json',
        'X-Api-Key' => 'your-api-key-here',
    ],
]);

echo $response->getBody();
# INSTALLATION
$ python -m pip install requests
# REQUEST
import requests

url = "https://swiftcodesapi.com/v1/swifts/NATAAU33033"

headers = {
    "Accept": "application/json",
    "X-Api-Key": "your-api-key-here"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
# INSTALLATION
$ npm install node-fetch --save
// REQUEST
const fetch = require('node-fetch');

const url = 'https://swiftcodesapi.com/v1/swifts/NATAAU33033';
const options = {method: 'GET', headers: {'Accept': 'application/json', 'X-Api-Key': 'your-api-key-here'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));)
const options = {method: 'GET', headers: {'Accept': 'application/json', 'X-Api-Key': 'your-api-key-here'}};

fetch('https://swiftcodesapi.com/v1/swifts/NATAAU33033', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));

The response should be:

{
    "success": true,
    "data": {
        "id": "NATAAU33033",
        "address": "500 BOURKE STREET, FLOOR 24",
        "postcode": "3000",
        "branch_name": "(HEAD OFFICE)",
        "branch_code": "033",
        "country": {
            "id": "AU",
            "name": "Australia"
        },
        "city": {
            "id": "3d2859b1-aa63-46dd-90d2-9ded52bbce22",
            "country_id": "AU",
            "name": "Melbourne"
        },
        "bank": {
            "id": "d7744803-1288-4955-9f53-05eb26bbef8e",
            "country_id": "AU",
            "code": "NATA",
            "name": "NATIONAL AUSTRALIA BANK LIMITED"
        }
    }
}

You can find full documentation here.