| Field Name | Length | Type | Description |
|---|---|---|---|
| bic | Max 11 | String | The BIC/SWIFT code sent to our system for validation. |
| api_key | 128 | String | Your personal API key. |
| format | 5 | String | Format of the response XML and JSON supported. |
curl "https://api.iban.com/clients/api/swiftv2/bic/" \
-X POST \
-d format=json \
-d api_key=[YOUR_API_KEY] \
-d bic=BARCGB22XXX
<?php
$curl = curl_init();
$post = [
'format' => 'json',
'api_key' => '[YOUR_API_KEY]',
'bic' => 'BARCGB22XXX'
];
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.iban.com/clients/api/swiftv2/bic/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $post
));
$output = curl_exec($curl);
$result = json_decode($output);
print_r($result);
curl_close($curl);
?>
require 'net/http'
uri = URI('https://api.iban.com/clients/api/swiftv2/bic/')
res = Net::HTTP.post_form(uri, "format" => "json", "api_key" => "[YOUR_API_KEY]","bic" => "BARCGB22XXX")
puts res.body
import requests
post_data = {'format':'json', 'api_key':'[YOUR_API_KEY]','bic':'BARCGB22XXX'}
response = requests.post('https://api.iban.com/clients/api/swiftv2/bic/',post_data)
print(response.text)
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $server_endpoint = "https://api.iban.com/clients/api/swiftv2/bic/";
my $format = 'json';
my $api_key = '[YOUR_API_KEY]';
my $bic = 'BARCGB22XXX';
my $req = HTTP::Request->new( POST => $server_endpoint );
$req->content_type('application/x-www-form-urlencoded');
my $post_data = 'format=' . $format . '&api_key=' . $api_key . '&bic=' . $bic;
$req->content($post_data);
my $resp = $ua->request($req);
if ( $resp->is_success ) {
my $message = $resp->decoded_content;
print $message;
}
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import org.json.simple.JSONObject;
import org.json.simple.JSONArray;
import org.json.simple.parser.ParseException;
import org.json.simple.parser.JSONParser;
public class ibanapi {
private final String USER_AGENT = "API Client/1.0";
public static void main(String[] args) throws Exception {
ibanapi http = new ibanapi();
System.out.println("\nTesting API - Send API POST request");
http.sendPost();
}
// HTTP POST request
private void sendPost() throws Exception {
String url = "https://api.iban.com/clients/api/swiftv2/bic/";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
//add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String urlParameters = "api_key=[YOUR_API_KEY]&format=json&bic=BARCGB22XXX";
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("\nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + urlParameters);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
//print result
System.out.println(response.toString());
}
}
public static void Main(string[] args)
{
var request = (HttpWebRequest)WebRequest.Create("https://api.iban.com/clients/api/swiftv2/bic/");
var postData = "api_key=[YOUR_API_KEY]";
postData += "&format=json";
postData += "&bic=BARCGB22XXX";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Console.WriteLine(responseString);
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
var request = require('request');
var headers = {
'User-Agent': 'IBAN API Client/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'https://api.iban.com/clients/api/swiftv2/bic/',
method: 'POST',
headers: headers,
form: {'api_key': '[YOUR_API_KEY]', 'format': 'json', 'bic': 'BARCGB22XXX'}
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
var data = JSON.parse(body);
console.log(data.error);
console.log("Query Status: " + data.success);
console.log("BIC Code Valid: " + data.bic_valid);
console.log("Bank Name: " + data.directory_results.institution);
console.log("Bank BIC: " + data.directory_results.bic);
}
})
| Object | Type | Description |
|---|---|---|
| QUERY | Array | Contains the user supplied input parameters. |
| SUCCESS | Boolean | Indicates a true or false indicating if the query succeeded |
| BIC_VALID | Boolean | True or False. Indicates if the BIC/SWIFT code supplied has passed all validations |
| BIC_ACTIVE | Boolean | True or False. Indicates if the BIC code is connected and active in the SWIFT network. |
| DIRECTORY_RESULTS | Array | This object contains the data retrieved from the BIC directory for the respective BIC code. You may find a detailed description of this object in Section 7 Data Field Definitions |
| SERVICES | Array | This object contains the data retrieved from the BIC directory regarding the supported payment schemas. You may find a detailed description of this object in Section 7 Data Field Definitions |
| ERROR | Object | Provides error code and description if an error occurs. For descriptions, please refer to Section 4.2 BIC Endpoint Errors |
{
"query": {
"bic": "BARCGB22XXX",
"success": true
},
"bic_valid": true,
"bic_active": true,
"directory_results": {
"bic": "BARCGB22XXX",
"bic8": "BARCGB22",
"bic_branch": "XXX",
"institution": "FINANCIAL",
"name": "BARCLAYS BANK PLC",
"branch_name": "ALL U.K. OFFICES",
"office": "HEAD OFFICE",
"address": "1 CHURCHILL PLACE",
"city": "LONDON",
"zip": "E14 5HP",
"country_name": "UNITED KINGDOM",
"iso_country_code": "GB"
},
"services": [
{
"code": "FIN",
"description": "MANY-TO-MANY FIN PAYMENT SERVICE"
},
{
"code": "SCO",
"description": "SCORE FIN"
},
{
"code": "STG",
"description": "CHAPS STERLING (RTGS)"
}
],
"error": {}
}
| Error Code | HTTP Status Code | Type | Message |
|---|---|---|---|
| 301 | 403 | Query failed | API Key is invalid |
| 305 | 403 | Query failed | IP Address not allowed |
| 304 | 403 | Query failed | You have no access to this API |
| 302 | 403 | Query failed | Subscription expired |
| 303 | 403 | Query failed | No queries available |
| 306 | 400 | Query failed | Bad Request. Required minimum parameters: api_key; format; iso; bic |
| 806 | 400 | Query failed | Invalid value for 'limit' parameter |
| 500 | 500 | Query failed | Internal Server Error |
| 801 | 200 | Validation failed | Invalid Characters in BIC |
| 802 | 200 | Validation failed | Incorrect BIC Length. Accepted BIC length 8 or 11 characters |
| 803 | 200 | Validation failed | BIC Code not found in directory. |
| Field Name | Length | Type | Description |
|---|---|---|---|
| bank_name | Max 125 | String | The BIC sent to our system for validation and identification. |
| country | Max 2 | String | The 2 letter ISO country code to narrow the search. |
| limit | Integer | The 2 letter ISO country code to narrow the search. | |
| api_key | 128 | String | Your personal API key. |
| format | 5 | String | Format of the response XML and JSON supported. |
curl "https://api.iban.com/clients/api/swiftv2/bank/" \
-X POST \
-d format=json \
-d api_key=[YOUR_API_KEY] \
-d country=US
-d bank_name=natwest
<?php
$curl = curl_init();
$post = [
'format' => 'json',
'api_key' => '[YOUR_API_KEY]',
'country' => US
'bank_name' => 'natwest'
];
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.iban.com/clients/api/swiftv2/bank/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $post
));
$output = curl_exec($curl);
$result = json_decode($output);
print_r($result);
curl_close($curl);
?>
require 'net/http'
uri = URI('https://api.iban.com/clients/api/swiftv2/bank/')
res = Net::HTTP.post_form(uri, "format" => "json", "api_key" => "[YOUR_API_KEY]","country" => "US", "bank_name" => "natwest")
puts res.body
import requests
post_data = {'format':'json', 'api_key':'[YOUR_API_KEY]','country':'US', 'bank_name':'natwest'}
response = requests.post('https://api.iban.com/clients/api/swiftv2/bank/',post_data)
print(response.text)
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $server_endpoint = "https://api.iban.com/clients/api/swiftv2/bank/";
my $format = 'json';
my $api_key = '[YOUR_API_KEY]';
my $country = 'US';
my $bank_name = 'natwest';
my $req = HTTP::Request->new( POST => $server_endpoint );
$req->content_type('application/x-www-form-urlencoded');
my $post_data = 'format=' . $format . '&api_key=' . $api_key . '&country=' . $country . '&bank_name' . $bank_name;
$req->content($post_data);
my $resp = $ua->request($req);
if ( $resp->is_success ) {
my $message = $resp->decoded_content;
print $message;
}
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import org.json.simple.JSONObject;
import org.json.simple.JSONArray;
import org.json.simple.parser.ParseException;
import org.json.simple.parser.JSONParser;
public class ibanapi {
private final String USER_AGENT = "API Client/1.0";
public static void main(String[] args) throws Exception {
ibanapi http = new ibanapi();
System.out.println("\nTesting API - Send API POST request");
http.sendPost();
}
// HTTP POST request
private void sendPost() throws Exception {
String url = "https://api.iban.com/clients/api/swiftv2/bank/";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
//add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String urlParameters = "api_key=[YOUR_API_KEY]&format=json&country=US&bank_name=natwest";
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("\nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + urlParameters);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
//print result
System.out.println(response.toString());
}
}
public static void Main(string[] args)
{
var request = (HttpWebRequest)WebRequest.Create("https://api.iban.com/clients/api/swiftv2/bank/");
var postData = "api_key=[YOUR_API_KEY]";
postData += "&format=json";
postData += "&country=US";
postData += "&bank_name=natwest";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Console.WriteLine(responseString);
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
var request = require('request');
var headers = {
'User-Agent': 'IBAN API Client/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'https://api.iban.com/clients/api/swiftv2/bank/',
method: 'POST',
headers: headers,
form: {'api_key': '[YOUR_API_KEY]', 'format': 'json', 'country': 'US', 'bank_name': 'natwest'}
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
var data = JSON.parse(body);
console.log(data.error);
console.log("Query Status: " + data.success);
console.log("BIC Code Valid: " + data.bic_valid);
console.log("Bank Name: " + data.directory_results.institution);
console.log("Bank BIC: " + data.directory_results.bic);
}
})
| Object | Type | Description |
|---|---|---|
| QUERY | Object | Contains the user supplied input parameters. |
| RECORDS_FOUND | Integer | Indicates the number of records found in the bank directory. If more than one, you may use the 'limit' parameter to retrieve multiple records for the same bank code |
| RECORDS_DISPLAYED | Integer | Indicates the number of records displayed in the 'directory_results' object. By default we display one record. With the 'limit' parameter, you can retrieve multiple |
| DIRECTORY_RESULTS | Array | This object contains the data retrieved from our bank directory for the respective bank code. You may find a detailed description of this object in Section 7 Data Field Definitions |
| ERROR | Object | Provides error code and description if an error occurs. For descriptions, please refer to Section 5.2 Bank Endpoint Errors |
{
"query": {
"country": "US",
"bank_name": "natwest",
"success": true
},
"records_found": 2,
"records_displayed": 3,
"directory_results": [
{
"bic": "GRNWUS33XXX",
"bic8": "GRNWUS33",
"bic_branch": "XXX",
"institution": "FINANCIAL",
"name": "NATWEST MARKETS SECURITIES INC.",
"branch_name": "",
"bic_active": true,
"office": "HEAD OFFICE",
"address": "600 WASHINGTON BLVD",
"city": "STAMFORD,CT",
"zip": "06901",
"country_name": "UNITED STATES OF AMERICA",
"iso_country_code": "US",
"services": []
},
{
"bic": "GRNWUS3EXXX",
"bic8": "GRNWUS3E",
"bic_branch": "XXX",
"institution": "FINANCIAL",
"name": "NATWEST MARKETS SECURITIES INC.",
"branch_name": "",
"bic_active": true,
"office": "HEAD OFFICE",
"address": "600 WASHINGTON BLVD",
"city": "STAMFORD,CT",
"zip": "06901",
"country_name": "UNITED STATES OF AMERICA",
"iso_country_code": "US",
"services": []
}
],
"error": {}
}
| Error Code | HTTP Status Code | Type | Message |
|---|---|---|---|
| 301 | 403 | Query failed | API Key is invalid |
| 305 | 403 | Query failed | IP Address not allowed |
| 304 | 403 | Query failed | You have no access to this API |
| 302 | 403 | Query failed | Subscription expired |
| 303 | 403 | Query failed | No queries available |
| 306 | 400 | Query failed | Bad Request. Required minimum parameters: api_key; format; iso; bank_name, country |
| 806 | 400 | Query failed | Invalid value for 'limit' parameter |
| 500 | 500 | Query failed | Internal Server Error |
| 806 | 200 | Validation failed | Bank Name Invalid! Bank search should be minimum of 4 characters. Allowed characters a-z, A-Z, 0-9, space! |
| 807 | 200 | Validation failed | Country code incorrect! Allowed is 2 letter country code. Example: UK, DE, FR |
| 808 | 200 | Validation failed | No records found in directory. |
| Name | Type | Max length | Description |
|---|---|---|---|
| code | Numeric | 3 | Unique error code assigned to the specific error. |
| message | Any | 125 | Text describing the reason for the error. |
| Name | Type | Max length | Description |
|---|---|---|---|
| bic | Any | 11 | Full BIC code send by the client for validation |
| success | boolean | 5 | Indicates whether the query was successfully parsed by our system. Possible values: true/false |
| Name | Type | Max length | Description |
|---|---|---|---|
| country | Alphabetic | 2 | The country code sent for validation. |
| bank_name | Any | 125 | Full BIC code send by the client for validation |
| success | boolean | 5 | Indicates whether the query was successfully parsed by our system. Possible values: true/false |
| Name | Type | Max length | Description |
|---|---|---|---|
| bic | Any | 11 | Full BIC code |
| bic8 | Any | 8 | Head office part of the BIC code |
| bic_branch | Any | 3 | Branch part of the BIC code |
| institution | Any | 12 | Type of institution. Possible values are: NONFINANCIAL or FINANCIAL |
| name | Any | 125 | The full name of the bank or financial institution |
| branch_name | Any | 125 | The name of the specific branch of the respective BIC |
| bic_active | boolean | 5 | Marker specifying whether the BIC code is connected and active in the SWIFT network. Possible values: true/false |
| office | Alphabetic | 11 | The type of office: branch or head office |
| address | Alphabetic | 125 | The street address of the bank/branch |
| city | Alphabetic | 2 | The name of the city of the branch address |
| zip | Alphabetic | 2 | The ZIP/Postal code of the branch address |
| country_name | Alphabetic | 2 | The full name of the country in which the bank/branch is localized. |
| iso_country_code | Alphabetic | 2 | The ISO 3166-1 alpha-2 code of the country of the institution/branch |
| services | Array | variable | A list of payment services the BIC code participates in. |