3-Step Quickstart Guide

Feel like jumping right into making API calls? Get a free Bank Data API account and simply use our 3-Step Quickstart Guide.

Code Examples

Our API supports all major programming languages. Click below to browse through examples in PHP, Python, Node, jQuery and Ruby.

Bank Data API Reference

This API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Just Getting Started?

Check out our development quickstart guide.

Authentication

Bank Data API uses API keys to authenticate requests. You can view and manage your API keys in the Accounts page.

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

All requests made to the API must hold a custom HTTP header named “apikey”. Implementation differs with each programming language. Below are some samples.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Endpoints

GET /all

Get all major banks SWIFT and IBAN codes

Parameters

country (optional)

Country name or code (If not specified, all of the banks from all countries except US will be
shown; If specified, only banks from specified country will be shown (Ex: DE or Germany for Germany, US or
United States for United States))

Location: Query,
Data Type: string

page (optional)

Page offset

Location: Query,
Data Type: string

per_page (optional)

Items per page

Location: Query,
Data Type: string

GET /all
Javascript

var myHeaders = new Headers();
myHeaders.append("apikey", "{API-KEY}");

var requestOptions = {
method: ‘GET’,
redirect: ‘follow’,
headers: myHeaders
};

fetch(“https://api.apilayer.com/bank_data/all?per_page={per_page}&page={page}&country={country}”, requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log(‘error’, error));

GET /all
Python
import requests
        
        url = "https://api.apilayer.com/bank_data/all?per_page={per_page}&page={page}&country={country}"
        
        payload = {}
        headers= {
          "apikey": "{API-KEY}"
        }
        
        response = requests.request("GET", url, headers=headers, data = payload)
        
        status_code = response.status_code
        result = response.text

GET /all
PHP
$curl = curl_init();
        
            curl_setopt_array($curl, array(
              CURLOPT_URL => "https://api.apilayer.com/bank_data/all?per_page={per_page}&page={page}&country={country}",
              CURLOPT_HTTPHEADER => array(
                "Content-Type: text/plain",
                "apikey: {API-KEY}"
              ),
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 0,
              CURLOPT_FOLLOWLOCATION => true,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET"
            ));
            
            $response = curl_exec($curl);
            
            curl_close($curl);
            echo $response;

GET /all
Go
package main
      
            import (
              "fmt"
              "net/http"
              "io/ioutil"
            )
            
            func main() {
              url := "https://api.apilayer.com/bank_data/all?per_page={per_page}&page={page}&country={country}"
            
              client := &http.Client {}
              req, err := http.NewRequest("GET", url, nil)
              req.Header.Set("apikey", "{API-KEY}")
            
              if err != nil {
                fmt.Println(err)
              }
              res, err := client.Do(req)
              if res.Body != nil {
                defer res.Body.Close()
              }
              body, err := ioutil.ReadAll(res.Body)
            
              fmt.Println(string(body))
            }

GET /all
Java
import java.io.*;
              import okhttp3.*;
              
              public class main {
                public static void main(String []args) throws IOException{
                  OkHttpClient client = new OkHttpClient().newBuilder().build();
              
                  Request request = new Request.Builder()
                    .url("https://api.apilayer.com/bank_data/all?per_page={per_page}&page={page}&country={country}")
                    .addHeader("apikey", "{API-KEY}")
                    .method("GET", })
                    .build();
                  Response response = client.newCall(request).execute();
                  System.out.println(response.body().string());
                }
              }

** A word enclosed with curly brackets “{ }” in the code means that it is a parameter and it
should be replaced with your own values when executing. (also overwriting the curly brackets).

Returns

Below is a sample response from the endpoint

{
        "data": [
          {
            "iban_data": {
              "ISO_country_code": "AD",
              "account_number": "200359100100",
              "bank_code": "0001",
              "checksum": "12",
              "iban": "AD1200012030200359100100"
            },
            "swift_data": {
              "address": "",
              "branch": "ANDORRA BANC AGRICOL REIG S.A., LES ESCALDES",
              "city": "LES ESCALDES",
              "country": "Andorra",
              "country_code": "AD",
              "name": "Andorra",
              "swift": "BACAADAD",
              "zip": ""
            }
          },
          {
            "iban_data": {
              "ISO_country_code": "AD",
              "account_number": "200359100100",
              "bank_code": "0001",
              "checksum": "12",
              "iban": "AD1200012030200359100100"
            },
            "swift_data": {
              "address": "",
              "branch": "ANDORRA GESTIO AGRICOL REIG SAU, ESCALDES-ENGORDANY",
              "city": "ESCALDES-ENGORDANY",
              "country": "Andorra",
              "country_code": "AD",
              "name": "Andorra",
              "swift": "AAMAADAD",
              "zip": ""
            }
          },
          {
            "iban_data": {
              "ISO_country_code": "AD",
              "account_number": "200359100100",
              "bank_code": "0001",
              "checksum": "12",
              "iban": "AD1200012030200359100100"
            },
            "swift_data": {
              "address": "",
              "branch": "BANC SABADELL D'ANDORRA S.A., ANDORRA LA VELLA",
              "city": "ANDORRA LA VELLA",
              "country": "Andorra",
              "country_code": "AD",
              "name": "Andorra",
              "swift": "BSANADAD",
              "zip": ""
            }
          }
        ]
      }


If you wish to play around interactively with real values
and run code, see…

GET /all_us

Get all US Routing (or by state)

Parameters

main_bank_id (optional)

Main bank id (show routing numbers for the provided id)

Location: Query,
Data Type: string

page (optional)

Page offset

Location: Query,
Data Type: string

per_page (optional)

Items per page

Location: Query,
Data Type: string

search_term (optional)

Search by bank name

Location: Query,
Data Type: string

state_code (optional)

State code

Location: Query,
Data Type: string

GET /all_us
Javascript
var myHeaders = new Headers();
      myHeaders.append("apikey", "{API-KEY}");
      
      var requestOptions = {
        method: 'GET',
        redirect: 'follow',
        headers: myHeaders
      };
      
      fetch("https://api.apilayer.com/bank_data/all_us?state_code={state_code}&search_term={search_term}&per_page={per_page}&page={page}&main_bank_id={main_bank_id}", requestOptions)
        .then(response => response.text())
        .then(result => console.log(result))
        .catch(error => console.log('error', error));
** A word enclosed with curly brackets “{ }” in the code means that it is a parameter and it should be replaced with your own values when
executing. (also overwriting the curly brackets).

Returns

Below is a sample response from the endpoint

{
      "data": [
        {
          "bank_data": {
            "address": "8001 VILLA PARK DRIVE",
            "city": "HENRICO",
            "name": "BANK OF AMERICA, N.A.",
            "phone": "(800) 446-0135",
            "state": "VA",
            "zip": "23228-0000"
          },
          "new_routing": false,
          "revision_date": "101310",
          "us_routing": "011000138"
        },
        {
          "bank_data": {
            "address": "PO BOX 27025",
            "city": "RICHMOND",
            "name": "BANK OF AMERICA N.A",
            "phone": "(800) 446-0135",
            "state": "VA",
            "zip": "23261-7025"
          },
          "new_routing": false,
          "revision_date": "072505",
          "us_routing": "011000206"
        },
        {
          "bank_data": {
            "address": "PO BOX 27025",
            "city": "RICHMOND",
            "name": "BANK OF AMERICA N.A",
            "phone": "(800) 446-0135",
            "state": "VA",
            "zip": "23261-7025"
          },
          "new_routing": false,
          "revision_date": "072505",
          "us_routing": "011000390"
        }
      ]
    }

If you wish to play around interactively with real values and run code, see…

GET /banks_by_country

Get Banks by country

Parameters

country_code
(required)

Country code (Ex: DE, AT..)

Location: Query,
Data Type: string

page (optional)

Page offset

Location: Query,
Data Type: string

per_page (optional)

Items per page

Location: Query,
Data Type: string

search_term (optional)

Search by bank name

Location: Query,
Data Type: string

GET /banks_by_country
Javascript
var myHeaders = new Headers();
        myHeaders.append("apikey", "{API-KEY}");
        
        var requestOptions = {
          method: 'GET',
          redirect: 'follow',
          headers: myHeaders
        };
        
        fetch("https://api.apilayer.com/bank_data/banks_by_country?country_code={country_code}", requestOptions)
          .then(response => response.text())
          .then(result => console.log(result))
          .catch(error => console.log('error', error));

** A word enclosed with curly brackets “{ }” in the code means that it is a parameter and it should be replaced with your own values when executing. (also overwriting the curly brackets).

Returns

Below is a sample response from the endpoint

[
        {
          "id": 27286,
          "name": "ARCELORMITTAL SKOPJE (CRM)"
        },
        {
          "id": 27287,
          "name": "BRO-DEAL, INC"
        },
        {
          "id": 27288,
          "name": "BROKER HOUSE POSTEL-BROKER A.D"
        }
      ]


If you wish to play around interactively with real values and run code, see…

GET /check_blz_code

Get Banks by country

Parameters

country_code (required)

Country code (Ex: DE, AT..)

Location: Query,
Data Type: string

page (optional)

Page offset

Location: Query,
Data Type: string

per_page (optional)

Items per page

Location: Query,
Data Type: string

search_term (optional)

Search by bank name

Location: Query,
Data Type: string

GET /check_blz_code
Javascript
import java.io.*;
                    import okhttp3.*;
                    
                    public class main {
                      public static void main(String []args) throws IOException{
                        OkHttpClient client = new OkHttpClient().newBuilder().build();
                    
                        Request request = new Request.Builder()
                          .url("https://api.apilayer.com/bank_data/check_blz_code?blz_code={blz_code}")
                          .addHeader("apikey", "{API-KEY}")
                          .method("GET", })
                          .build();
                        Response response = client.newCall(request).execute();
                        System.out.println(response.body().string());
                      }
                    }
** A word enclosed with curly brackets “{ }” in the code means that it is a parameter and it should be replaced with your own values when executing. (also overwriting the curly brackets).

Returns

Below is a sample response from the endpoint

{
                "bank_data": {
                  "bic": "HYVEDEMM488",
                  "city": "BERLIN",
                  "name": "UNICREDIT BANK AG (HYPOVEREINSBANK)",
                  "zip": "10896"
                },
                "blz_code": "10020890",
                "valid": true
              }

If you wish to play around interactively with real values and run code, see…

GET /iban_fields

Get required fields for generating IBAN

Parameters

country (optional)

Country code or name (Ex: DE or Germany)

Location: Query,
Data Type: string

GET /iban_fields
Javascript
import java.io.*;
        import okhttp3.*;
        
        public class main {
          public static void main(String []args) throws IOException{
            OkHttpClient client = new OkHttpClient().newBuilder().build();
        
            Request request = new Request.Builder()
              .url("https://api.apilayer.com/bank_data/iban_fields?country={country}")
              .addHeader("apikey", "{API-KEY}")
              .method("GET", })
              .build();
            Response response = client.newCall(request).execute();
            System.out.println(response.body().string());
          }
        }
** A word enclosed with curly brackets “{ }” in the code means that it is a parameter and it should be replaced with your own values when
executing. (also overwriting the curly brackets).

Returns

Below is a sample response from the endpoint

{
        "country": "Macedonia",
        "country_code": "MK",
        "fields": [
          {
            "field": "bank_code",
            "length": "3",
            "type": "numeric"
          },
          {
            "field": "account_number",
            "length": "10",
            "type": "alpha_num"
          },
          {
            "field": "check_digit",
            "length": "2",
            "type": "numeric"
          }
        ]
      }

If you wish to play around interactively with real values and run code, see…

GET /iban_generate

Generate IBAN number

Parameters

account_number (required)

Account number

Location: Query,
Data Type: string

bank_code (required)

Bank Code

Location: Query,
Data Type: string

country (required)

Country code or name (ex: DE or Germany)

Location: Query,
Data Type: string

account_holder_position (optional)

Account holder position (Required for: Brazil(BR))Location: Query,
Data Type: string

account_type (optional)

Account type (Required for: Brazil(BR), Bulgaria(BG))

Location: Query,
Data Type: string

branch (optional)

Branch code

Location: Query,
Data Type: string

check_digit (optional)

Check digit

Location: Query,
Data Type: string

currency (optional)

Currency code (Required for: Seychelles(SC))

Location: Query,
Data Type: string

identification_number (optional)

Identification number (Required for: Iceland(IS))

Location: Query,
Data Type: string

GET /iban_generate
Javascript
import java.io.*;
        import okhttp3.*;
        
        public class main {
          public static void main(String []args) throws IOException{
            OkHttpClient client = new OkHttpClient().newBuilder().build();
        
            Request request = new Request.Builder()
              .url("https://api.apilayer.com/bank_data/iban_generate?country={country}&bank_code={bank_code}&account_number={account_number}")
              .addHeader("apikey", "{API-KEY}")
              .method("GET", })
              .build();
            Response response = client.newCall(request).execute();
            System.out.println(response.body().string());
          }
        }
** A word enclosed with curly brackets “{ }” in the code means that it is a parameter and it should be replaced with your own values when executing. (also overwriting the curly brackets).

Returns

Below is a sample response from the endpoint

{
        "bank_data": {
          "bank_code": "37040044",
          "bic": "COBADEFFXXX",
          "city": "K\u00c3\u00b6ln",
          "name": "Commerzbank",
          "zip": "50447"
        },
        "country_iban_example": "DE89370400440532013000",
        "iban": "DE89370400440532013000",
        "iban_data": {
          "BBAN": "370400440532013000",
          "account_number": "0532013000",
          "bank_code": "37040044",
          "branch": "",
          "checksum": "89",
          "country": "Germany",
          "country_code": "DE",
          "country_iban_format_as_regex": "^DE(\\d{2})(\\d{8})(\\d{10})$",
          "country_iban_format_as_swift": "DE2!n8!n10!n",
          "national_checksum": "",
          "sepa_country": true
        },
        "valid": true
      }

If you wish to play around interactively with real values and run code, see…

GET /iban_structure

Get IBAN example and structure by country

Parameters

country (optional)

Country code or name (Ex: DE or Germany)

Location: Query,
Data Type: string

GET /iban_structure
Javascript
import java.io.*;
            import okhttp3.*;
            
            public class main {
              public static void main(String []args) throws IOException{
                OkHttpClient client = new OkHttpClient().newBuilder().build();
            
                Request request = new Request.Builder()
                  .url("https://api.apilayer.com/bank_data/iban_structure?country={country}")
                  .addHeader("apikey", "{API-KEY}")
                  .method("GET", })
                  .build();
                Response response = client.newCall(request).execute();
                System.out.println(response.body().string());
              }
            }
** A word enclosed with curly brackets “{ }” in the code means that it is a parameter and it should be replaced with your own values when
executing. (also overwriting the curly brackets).

Returns

Below is a sample response from the endpoint

{
            "country_bankid_start_offset": "0",
            "country_bankid_stop_offset": "7",
            "country_bban_example": "370400440532013000",
            "country_bban_format_as_regex": "^(\\d{8})(\\d{10})$",
            "country_bban_format_as_swift": "8!n10!n",
            "country_bban_length": "18",
            "country_branchid_start_offset": "",
            "country_branchid_stop_offset": "",
            "country_domestic_example": "37040044-532013000",
            "country_iban_format_as_regex": "^DE(\\d{2})(\\d{8})(\\d{10})$",
            "country_iban_format_as_swift": "DE2!n8!n10!n",
            "country_iban_length": "22",
            "country_membership_type": "eu_member",
            "country_name": "Germany",
            "iban_example": "DE89370400440532013000",
            "iban_parts": {
              "account": "0532013000",
              "bank": "37040044",
              "bban": "370400440532013000",
              "branch": "",
              "checksum": "89",
              "country": "DE",
              "nationalchecksum": ""
            },
            "is_eu_member": true,
            "sepa_country": true
          }

If you wish to play around interactively with real values and run code, see…

GET /iban_validate

Validate IBAN number

Parameters

iban_number (required)

IBAN number

Location: Query,
Data Type: string

GET /iban_validate
Javascript
import java.io.*;
            import okhttp3.*;
            
            public class main {
              public static void main(String []args) throws IOException{
                OkHttpClient client = new OkHttpClient().newBuilder().build();
            
                Request request = new Request.Builder()
                  .url("https://api.apilayer.com/bank_data/iban_validate?iban_number={iban_number}")
                  .addHeader("apikey", "{API-KEY}")
                  .method("GET", })
                  .build();
                Response response = client.newCall(request).execute();
                System.out.println(response.body().string());
              }
            }
** A word enclosed with curly brackets “{ }” in the code means that it is a parameter and it should be replaced with your own values when
executing. (also overwriting the curly brackets).

Returns

Below is a sample response from the endpoint

{
            "bank_data": {
              "bank_code": "37040044",
              "bic": "COBADEFFXXX",
              "city": "K\u00c3\u00b6ln",
              "name": "Commerzbank",
              "zip": "50447"
            },
            "country_iban_example": "DE89370400440532013000",
            "iban": "DE89370400440532013000",
            "iban_data": {
              "BBAN": "370400440532013000",
              "account_number": "0532013000",
              "bank_code": "37040044",
              "branch": "",
              "checksum": "89",
              "country": "Germany",
              "country_code": "DE",
              "country_iban_format_as_regex": "^DE(\\d{2})(\\d{8})(\\d{10})$",
              "country_iban_format_as_swift": "DE2!n8!n10!n",
              "national_checksum": "",
              "sepa_country": true
            },
            "valid": true
          }

If you wish to play around interactively with real values and run code, see…

GET /swift_check

Check SWIFT Code

Parameters

swift_code (required)

SWIFT code

Location: Query,
Data Type: string

GET /swift_check
Javascript
import java.io.*;
            import okhttp3.*;
            
            public class main {
              public static void main(String []args) throws IOException{
                OkHttpClient client = new OkHttpClient().newBuilder().build();
            
                Request request = new Request.Builder()
                  .url("https://api.apilayer.com/bank_data/swift_check?swift_code={swift_code}")
                  .addHeader("apikey", "{API-KEY}")
                  .method("GET", })
                  .build();
                Response response = client.newCall(request).execute();
                System.out.println(response.body().string());
              }
            }
** A word enclosed with curly brackets “{ }” in the code means that it is a parameter and it should be replaced with your own values when
executing. (also overwriting the curly brackets).

Returns

Below is a sample response from the endpoint

{
            "bank_data": {
              "address": "",
              "bank_code": "20040050",
              "branch": "COMMERZBANK AG, ANDERNACH",
              "city": "ANDERNACH",
              "country": "Germany",
              "country_code": "DE",
              "name": "COMMERZBANK AG",
              "zip": "20457"
            },
            "swift": "COBADEFF574",
            "swift_data": {
              "bank": "COBA",
              "branch_code": "574",
              "code_status": true,
              "country_code": "DE",
              "location_code": "FF"
            },
            "valid": true
          }

If you wish to play around interactively with real values and run code, see…

GET /us_banks_by_state

Get US Banks by state

Parameters

state_code (required)

State code (Ex: VA)

Location: Query,
Data Type: string

page (optional)

Page offset

Location: Query,
Data Type: string

per_page (optional)

Items per page

Location: Query,
Data Type: string

search_term (optional)

Search by bank name

Location: Query,
Data Type: string

GET /us_banks_by_state
Javascript
import java.io.*;
            import okhttp3.*;
            
            public class main {
              public static void main(String []args) throws IOException{
                OkHttpClient client = new OkHttpClient().newBuilder().build();
            
                Request request = new Request.Builder()
                  .url("https://api.apilayer.com/bank_data/us_banks_by_state?state_code={state_code}")
                  .addHeader("apikey", "{API-KEY}")
                  .method("GET", })
                  .build();
                Response response = client.newCall(request).execute();
                System.out.println(response.body().string());
              }
            }
** A word enclosed with curly brackets “{ }” in the code means that it is a parameter and it should be replaced with your own values when
executing. (also overwriting the curly brackets).

Returns

Below is a sample response from the endpoint

{
            "data": [
              {
                "id": 13025,
                "main_us_bank_id": 7035,
                "name": "1ST ADVANTAGE FEDERAL CREDIT UNION"
              },
              {
                "id": 13563,
                "main_us_bank_id": 7439,
                "name": "A B & W CREDIT UNION INC"
              },
              {
                "id": 13051,
                "main_us_bank_id": 7058,
                "name": "ABNB FEDERAL CREDIT UNION"
              }
            ]
          }

If you wish to play around interactively with real values and run code, see…

GET /us_routing

Check US routing number

Parameters

us_routing (required)

US routing number

Location: Query,
Data Type: string

GET /us_routing
Javascript
import java.io.*;
            import okhttp3.*;
            
            public class main {
              public static void main(String []args) throws IOException{
                OkHttpClient client = new OkHttpClient().newBuilder().build();
            
                Request request = new Request.Builder()
                  .url("https://api.apilayer.com/bank_data/us_routing?us_routing={us_routing}")
                  .addHeader("apikey", "{API-KEY}")
                  .method("GET", })
                  .build();
                Response response = client.newCall(request).execute();
                System.out.println(response.body().string());
              }
            }

** A word enclosed with curly brackets “{ }” in the code means that it is a parameter and it should be replaced with your own values when
executing. (also overwriting the curly brackets).

Returns

Below is a sample response from the endpoint

{
            "bank_data": {
              "address": "31 SUTTON AVENUE",
              "city": "OXFORD",
              "name": "HOMETOWN BANK",
              "phone": "(508) 987-1200",
              "state": "MA",
              "zip": "01540-0000"
            },
            "new_routing": "211371926",
            "revision_date": "112116",
            "us_routing": "011102133",
            "valid": true
          }


If you wish to play around interactively with real values and run code, see…

Rate Limiting

Each subscription has its own rate limit. When you become a member, you start by choosing a rate limit that suits your usage needs. Do not worry; You can upgrade or downgrade your plan at any time. For this reason, instead of starting with a larger plan that you do not need, we can offer you to upgrade your plan after you start with “free” or “gold plan” options and start using the API.

When you reach a rate limit (both daily and monthly), the service will stop responding and returning the HTTP 429 response status code (Too many requests) for each request with the following JSON string body text.

{
"message":"You have exceeded your daily\/monthly API rate limit. Please review and upgrade your subscription plan at https:\/\/apilayer.com\/subscriptions to continue."
}
A reminder email will be sent to you when your API usage reaches both 80% and 90%, so that you can take immediate actions such as upgrading your plan in order to prevent your application using the API from being interrupted.
You can also programmatically check your rate limit yourself. As a result of each request made to the APILayer, the following 4 fields provide you with all the necessary information within the HTTP Headers.

x-ratelimit-limit-month: Request limit per month
x-ratelimit-remaining-month: Request limit remaining this month
x-ratelimit-limit-day: Request limit per day
x-ratelimit-remaining-day: Request limit remaining today
You can contact our support unit if you need any assistance with your application regarding to handle the returned result by looking at the header information.

Error Codes

APILayer uses standard HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate a clientside error, which means that failed given the information provided (e.g., a missing parameter, unauthorized access etc.). Codes in the 5xx range indicate an error with APILayer’s servers (normally this should’nt happen at all).

If the response code is not 200, it means the operation failed somehow and you may need to take an action accordingly. You can check the response (which will be in JSON format) for a field called ‘message’ that briefly explains the error reported.

Status Code Explanation
400 - Bad Request The request was unacceptable, often due to missing a required parameter.
401 - Unauthorized No valid API key provided
404 - Not Found The requested resource doesn't exist.
429 - Too many requests API request limit exceeded. See section Rate Limiting for more info.
5xx - Server Error We have failed to process your request. (You can contact us anytime)

You can always contact for support and ask for more assistance. We’ll be glad to assist you with building your product.