UK Bank Account Checker XML API

The API returns a validation code and a validation description for the bank account and sort code provided in XML format.

Usage
Simply do a query at this address with the API parameters described below:
https://www.bankaccountchecker.com/listener.php?key=<your_api_key>&password=<your_password>&output=xml&type=uk&sortcode=123456&bankaccount=12345678
If you don't have an API key yet, just follow this link to register your free API key.

API parameters
Parameter Required Default Value
key Yes guest API key provided with your account. Alternatively, use the 'guest' key but you will be restricted by the number of call per 24 hours.
password Yes guest Passowrd associated with the API key.
output No json json, xml
type Yes N/A uk
sortcode Yes N/A The Sort Code you want to check.
bankaccount Yes N/A The Bank Account you want to check.
Output
This is a sample of the output you will get in XML:
<?xml version="1.0"?>
<bankaccountchecker>
	<resultCode>01</resultCode>
	<resultDescription>Sortcode and Bank Account are valid</resultDescription>
	<accountProperties>
		<institution>BANK OF ENGLAND</institution>
		<branch>LONDON</branch>
		<fast_payment>true</fast_payment>
		<bacs_credit>false</bacs_credit>
		<bacs_direct_debit>true</bacs_direct_debit>
		<chaps>true</chaps>
		<cheque>true</cheque>
	</accountProperties>
</bankaccountchecker>
This is a another sample of the output you will get in XML with the optional Branch Properties set on your account:
<?xml version="1.0"?>
<bankaccountchecker>
	<resultCode>01</resultCode>
	<resultDescription>Sortcode and Bank Account are valid</resultDescription>
	<accountProperties>
		<institution>BANK OF ENGLAND</institution>
		<branch>LONDON</branch>
		<fast_payment>true</fast_payment>
		<bacs_credit>false</bacs_credit>
		<bacs_direct_debit>true</bacs_direct_debit>
		<chaps>true</chaps>
		<cheque>true</cheque>
	</accountProperties>
	<branchProperties>
		<address>National Counties Hse, Church St, Epsom, KT17 4NL, Surrey</address>
		<address_line1>National Counties Hse</address_line1>
		<address_line2>Church St</address_line2>
		<address_line3>Epsom</address_line3>
		<address_line4>KT17 4NL</address_line4>
		<address_line5>Surrey</address_line5>
		<address_line6></address_line6>
		<address_line7/>
        <city>Epsom</city>
        <country>England</country>
        <postcode>KT17 4NL</postcode>
        <latitude>51.329986044209100</latitude>
        <longitude>-0.259857286548163</longitude>
        <phone>01372742211</phone>
	</branchProperties>
</bankaccountchecker>
Why do I need to register?

We are always trying to improve on our services and to do so we need to be able to tell who is querying what data and how often. This will enable us to fully optimize our limited resources to providing a more stable and reliable service to our users.

What is this API key and do I need it?

This API key is just a random string of characters which uniquely identifies each user. This is how we can track your usage and we perform security validation.

How do I get this API key?

This API key is free for everyone. You just have to go to here to register and a unique API key will be sent to your email address.

Php example
In this example, we are running the full test case suite using different type of call (POST and GET). You can download this PHP version of the script as well from our download page.
<?php
 
error_reporting(E_ERROR | E_PARSE);
 
// Define end point URL
$url     = "https://www.bankaccountchecker.com/";
$service = "listener.php";
 
// Define parameters for all tests
$key         = "apiTest";
$password    = "apiTest";
$output      = "xml";
$type        = "uk";
 
// Start callAPI
callAPI("1","Pass modulus 10 check.","01",$key,$password,$output,"uk","089999","66374958");
callAPI("2","Pass modulus 11 check.","01",$key,$password,$output,"uk","107999","88837491");
callAPI("3","Pass modulus 11 and double alternate checks.","01",$key,$password,$output,"uk","202959","63748472");
callAPI("4","Exception 10 & 11 where first check passes and second check fails.","01",$key,$password,$output,"uk","871427","46238510");
callAPI("5","Exception 10 & 11 where first check fails and second check passes.","01",$key,$password,$output,"uk","872427","46238510");
callAPI("6","Exception 10 where in the account number ab=09 and the g=9. The first check passes and second check fails.","01",$key,$password,$output,"uk","871427","09123496");
callAPI("7","Exception 10 where in the account number ab=99 and the g=9. The first check passes and the second check fails.","01",$key,$password,$output,"uk","871427","99123496");
callAPI("8","Exception 3, and the sorting code is the start of a range. As c=6 the second check should be ignored.","01",$key,$password,$output,"uk","820000","73688637");
callAPI("9","Exception 3, and the sorting code is the end of a range. As c=9 the second check should be ignored.","01",$key,$password,$output,"uk","827999","73988638");
callAPI("10","Exception 3. As c6 or 9 perform both checks pass.","01",$key,$password,$output,"uk","827101","28748352");
callAPI("11","Exception 4 where the remainder is equal to the checkdigit.","01",$key,$password,$output,"uk","134020","63849203");
callAPI("12","Exception 1 – ensures that 27 has been added to the accumulated total and passes double alternate modulus check.","01",$key,$password,$output,"uk","118765","64371389");
callAPI("13","Exception 6 where the account fails standard check but is a foreign currency account.","01",$key,$password,$output,"uk","200915","41011166");
callAPI("14","Exception 5 where the check passes.","01",$key,$password,$output,"uk","938611","07806039");
callAPI("15","Exception 5 where the check passes with substitution.","01",$key,$password,$output,"uk","938600","42368003");
callAPI("16","Exception 5 where both checks produce a remainder of 0 and pass.","01",$key,$password,$output,"uk","938063","55065200");
callAPI("17","Exception 7 where passes but would fail the standard check.","01",$key,$password,$output,"uk","772798","99345694");
callAPI("18","Exception 8 where the check passes.","01",$key,$password,$output,"uk","086090","06774744");
callAPI("19","Exception 2 & 9 where the first check passes and second check fails.","01",$key,$password,$output,"uk","309070","02355688");
callAPI("20","Exception 2 & 9 where the first check fails and second check passes with substitution.","01",$key,$password,$output,"uk","309070","12345668");
callAPI("21","Exception 2 & 9 where a?0 and g?9 and passes.","01",$key,$password,$output,"uk","309070","12345677");
callAPI("22","Exception 2 & 9 where a?0 and g=9 and passes.","01",$key,$password,$output,"uk","309070","99345694");
callAPI("23","Exception 5 where the first checkdigit is correct and the second incorrect.","02",$key,$password,$output,"uk","938063","15764273");
callAPI("24","Exception 5 where the first checkdigit is incorrect and the second correct.","02",$key,$password,$output,"uk","938063","15764264");
callAPI("25","Exception 5 where the first checkdigit is incorrect with a remainder of 1.","02",$key,$password,$output,"uk","938063","15763217");
callAPI("26","Exception 1 where it fails double alternate check.","02",$key,$password,$output,"uk","118765","64371388");
callAPI("27","Pass modulus 11 check and fail double alternate check.","02",$key,$password,$output,"uk","203099","66831036");
callAPI("28","Fail modulus 11 check and pass double alternate check.","02",$key,$password,$output,"uk","203099","58716970");
callAPI("29","Fail modulus 10 check.","02",$key,$password,$output,"uk","089999","66374959");
callAPI("30","Fail modulus 11 check.","02",$key,$password,$output,"uk","107999","88837493");
callAPI("31","Exception 12/13 where passes modulus 11 check (in this example, modulus 10 check fails, however, there is no need for it to be performed as the first check passed).","01",$key,$password,$output,"uk","074456","12345112");
callAPI("32","Exception 12/13 where passes the modulus 11check (in this example, modulus 10 check passes as well, however, there is no need for it to be performed as the first check passed).","01",$key,$password,$output,"uk","070116","34012583");
callAPI("33","Exception 12/13 where fails the modulus 11 check, but passes the modulus 10 check.","01",$key,$password,$output,"uk","074456","11104102");
callAPI("34","Exception 14 where the first check fails and the second check passes.","01",$key,$password,$output,"uk","180002","00000190");
callAPI('35',"IBAN Sample AL","01",$key,$password,$output,"iban","","AL47212110090000000235698741");
callAPI('35',"IBAN Sample AD","01",$key,$password,$output,"iban","","AD1200012030200359100100");
callAPI('35',"IBAN Sample AT","01",$key,$password,$output,"iban","","AT611904300234573201");
callAPI('35',"IBAN Sample AZ","01",$key,$password,$output,"iban","","AZ21NABZ00000000137010001944");
callAPI('35',"IBAN Sample BH","01",$key,$password,$output,"iban","","BH67BMAG00001299123456");
callAPI('35',"IBAN Sample BE","01",$key,$password,$output,"iban","","BE68539007547034");
callAPI('35',"IBAN Sample BA","01",$key,$password,$output,"iban","","BA391290079401028494");
callAPI('35',"IBAN Sample BR","01",$key,$password,$output,"iban","","BR9700360305000010009795493P1");
callAPI('35',"IBAN Sample BG","01",$key,$password,$output,"iban","","BG80BNBG96611020345678");
callAPI('35',"IBAN Sample CR","01",$key,$password,$output,"iban","","CR05015202001026284066");
callAPI('35',"IBAN Sample HR","01",$key,$password,$output,"iban","","HR1210010051863000160");
callAPI('35',"IBAN Sample CY","01",$key,$password,$output,"iban","","CY17002001280000001200527600");
callAPI('35',"IBAN Sample CZ","01",$key,$password,$output,"iban","","CZ6508000000192000145399");
callAPI('35',"IBAN Sample DK","01",$key,$password,$output,"iban","","DK5000400440116243");
callAPI('35',"IBAN Sample DO","01",$key,$password,$output,"iban","","DO28BAGR00000001212453611324");
callAPI('35',"IBAN Sample EE","01",$key,$password,$output,"iban","","EE382200221020145685");
callAPI('35',"IBAN Sample FO","01",$key,$password,$output,"iban","","FO6264600001631634");
callAPI('35',"IBAN Sample FI","01",$key,$password,$output,"iban","","FI2112345600000785");
callAPI('35',"IBAN Sample FR","01",$key,$password,$output,"iban","","FR1420041010050500013M02606");
callAPI('35',"IBAN Sample GE","01",$key,$password,$output,"iban","","GE29NB0000000101904917");
callAPI('35',"IBAN Sample DE","01",$key,$password,$output,"iban","","DE89370400440532013000");
callAPI('35',"IBAN Sample GI","01",$key,$password,$output,"iban","","GI75NWBK000000007099453");
callAPI('35',"IBAN Sample GR","01",$key,$password,$output,"iban","","GR1601101250000000012300695");
callAPI('35',"IBAN Sample GL","01",$key,$password,$output,"iban","","GL8964710001000206");
callAPI('35',"IBAN Sample GT","01",$key,$password,$output,"iban","","GT82TRAJ01020000001210029690");
callAPI('35',"IBAN Sample HU","01",$key,$password,$output,"iban","","HU42117730161111101800000000");
callAPI('35',"IBAN Sample IS","01",$key,$password,$output,"iban","","IS140159260076545510730339");
callAPI('35',"IBAN Sample IE","01",$key,$password,$output,"iban","","IE29AIBK93115212345678");
callAPI('35',"IBAN Sample IL","01",$key,$password,$output,"iban","","IL620108000000099999999");
callAPI('35',"IBAN Sample IT","01",$key,$password,$output,"iban","","IT60X0542811101000000123456");
callAPI('35',"IBAN Sample JO","01",$key,$password,$output,"iban","","JO94CBJO0010000000000131000302");
callAPI('35',"IBAN Sample KZ","01",$key,$password,$output,"iban","","KZ86125KZT5004100100");
callAPI('35',"IBAN Sample XK","01",$key,$password,$output,"iban","","XK051212012345678906");
callAPI('35',"IBAN Sample KW","01",$key,$password,$output,"iban","","KW81CBKU0000000000001234560101");
callAPI('35',"IBAN Sample LV","01",$key,$password,$output,"iban","","LV80BANK0000435195001");
callAPI('35',"IBAN Sample LB","01",$key,$password,$output,"iban","","LB62099900000001001901229114");
callAPI('35',"IBAN Sample LI","01",$key,$password,$output,"iban","","LI21088100002324013AA");
callAPI('35',"IBAN Sample LT","01",$key,$password,$output,"iban","","LT121000011101001000");
callAPI('35',"IBAN Sample LU","01",$key,$password,$output,"iban","","LU280019400644750000");
callAPI('35',"IBAN Sample MK","01",$key,$password,$output,"iban","","MK07250120000058984");
callAPI('35',"IBAN Sample MT","01",$key,$password,$output,"iban","","MT84MALT011000012345MTLCAST001S");
callAPI('35',"IBAN Sample MR","01",$key,$password,$output,"iban","","MR1300020001010000123456753");
callAPI('35',"IBAN Sample MU","01",$key,$password,$output,"iban","","MU17BOMM0101101030300200000MUR");
callAPI('35',"IBAN Sample MD","01",$key,$password,$output,"iban","","MD24AG000225100013104168");
callAPI('35',"IBAN Sample MC","01",$key,$password,$output,"iban","","MC5811222000010123456789030");
callAPI('35',"IBAN Sample ME","01",$key,$password,$output,"iban","","ME25505000012345678951");
callAPI('35',"IBAN Sample NO","01",$key,$password,$output,"iban","","NO9386011117947");
callAPI('35',"IBAN Sample PK","01",$key,$password,$output,"iban","","PK36SCBL0000001123456702");
callAPI('35',"IBAN Sample PS","01",$key,$password,$output,"iban","","PS92PALS000000000400123456702");
callAPI('35',"IBAN Sample PL","01",$key,$password,$output,"iban","","PL61109010140000071219812874");
callAPI('35',"IBAN Sample PT","01",$key,$password,$output,"iban","","PT50000201231234567890154");
callAPI('35',"IBAN Sample QA","01",$key,$password,$output,"iban","","QA58DOHB00001234567890ABCDEFG");
callAPI('35',"IBAN Sample RO","01",$key,$password,$output,"iban","","RO49AAAA1B31007593840000");
callAPI('35',"IBAN Sample LC","01",$key,$password,$output,"iban","","LC62HEMM000100010012001200023015");
callAPI('35',"IBAN Sample SM","01",$key,$password,$output,"iban","","SM86U0322509800000000270100");
callAPI('35',"IBAN Sample ST","01",$key,$password,$output,"iban","","ST68000100010051845310112");
callAPI('35',"IBAN Sample SA","01",$key,$password,$output,"iban","","SA0380000000608010167519");
callAPI('35',"IBAN Sample RS","01",$key,$password,$output,"iban","","RS35260005601001611379");
callAPI('35',"IBAN Sample SK","01",$key,$password,$output,"iban","","SK3112000000198742637541");
callAPI('35',"IBAN Sample SI","01",$key,$password,$output,"iban","","SI56263300012039086");
callAPI('35',"IBAN Sample ES","01",$key,$password,$output,"iban","","ES9121000418450200051332");
callAPI('35',"IBAN Sample SE","01",$key,$password,$output,"iban","","SE4550000000058398257466");
callAPI('35',"IBAN Sample CH","01",$key,$password,$output,"iban","","CH9300762011623852957");
callAPI('35',"IBAN Sample NL","01",$key,$password,$output,"iban","","NL91ABNA0417164300");
callAPI('35',"IBAN Sample TL","01",$key,$password,$output,"iban","","TL380080012345678910157");
callAPI('35',"IBAN Sample TN","01",$key,$password,$output,"iban","","TN5910006035183598478831");
callAPI('35',"IBAN Sample TR","01",$key,$password,$output,"iban","","TR330006100519786457841326");
callAPI('35',"IBAN Sample AE","01",$key,$password,$output,"iban","","AE070331234567890123456");
callAPI('35',"IBAN Sample GB","01",$key,$password,$output,"iban","","GB29NWBK60161331926819");
callAPI('35',"IBAN Sample VG","01",$key,$password,$output,"iban","","VG96VPVG0000012345678901");
 
// End callAPI
 
function callAPI($testId,$testDescription,$expectedResult,$key,$password,$output,$type,$sortcode,$bankaccount) {
 
global $url,$service;
 
// Output Test details
echo "====================================================================\r\n";
echo "Test ID : $testId\r\n";
echo "Sort code : $sortcode\r\n";
echo "Bank account : $bankaccount\r\n";
echo "Test Description : $testDescription\r\n";
echo "Expected Result : $expectedResult\r\n\r\n";
 
// Call with Post with url encoded string post parameters
$ch = curl_init() ;
curl_setopt($ch, CURLOPT_URL,$url . $service);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "key=$key&password=$password&output=$output&type=$type&sortcode=$sortcode&bankaccount=$bankaccount");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
 
$result = curl_exec($ch);
 
if (curl_errno($ch)) {
    echo 'Curl error: ' . curl_error($ch) . "\r\n";
    $info = curl_getinfo($ch);
    print_r($info);
    curl_close($ch);
    return;
}
 
curl_close($ch);
 
echo "Call with POST with url encoded string\r\nResult:\r\n";
echo $result . "\r\n";
 
 
// Analyse result
switch($output) {
    case "xml" :
        $resultXml = simplexml_load_string($result);
        if ($resultXml === false) {
            $resultCode = "XX";
            $resultDescription = "Invalid xml returned";
        }
        else {
            $resultCode = $resultXml->resultCode;
            $resultDescription = $resultXml->resultDescription;
        }
        break;
}
 
// Display Result
echo "Result Code : " . $resultCode . "\r\n";
echo "Result Dewscription : " . $resultDescription . "\r\n";
if ($expectedResult != $resultXml->resultCode) {
    echo "*** ERROR ***\r\n";
}
echo "\r\n";
 
//=====================================================================
// Call with Post with post parameters in array
$ch = curl_init() ;
curl_setopt($ch, CURLOPT_URL,$url . $service);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('key' => $key , 'password' => $password , 'output' => $output , 'type' => $type , 'sortcode' => $sortcode , 'bankaccount' => $bankaccount ));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Required to remove "Expect: 100-continue" from the header sent
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
 
$result = curl_exec($ch);
 
if (curl_errno($ch)) {
    echo 'Curl error: ' . curl_error($ch) . "\r\n";
    $info = curl_getinfo($ch);
    print_r($info);
    curl_close($ch);
    return;
}
 
curl_close($ch);
 
echo "Call with POST with array\r\nResult:\r\n";
echo $result . "\r\n";
 
// Analyse result
switch($output) {
    case "xml" :
        $resultXml = simplexml_load_string($result);
        if ($resultXml === false) {
            $resultCode = "XX";
            $resultDescription = "Invalid xml returned";
        }
        else {
            $resultCode = $resultXml->resultCode;
            $resultDescription = $resultXml->resultDescription;
        }
        break;
}
 
// Display Result
echo "Result Code : " . $resultCode . "\r\n";
echo "Result Dewscription : " . $resultDescription . "\r\n";
if ($expectedResult != $resultXml->resultCode) {
    echo "*** ERROR ***\r\n";
}
echo "\r\n";
 
//=====================================================================
// Call with Get
$ch = curl_init() ;
curl_setopt($ch, CURLOPT_URL,$url . $service . "?key=$key&password=$password&output=$output&type=$type&sortcode=$sortcode&bankaccount=$bankaccount");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
 
$result = curl_exec($ch);
 
if (curl_errno($ch)) {
    echo 'Curl error: ' . curl_error($ch) . "\r\n";
    $info = curl_getinfo($ch);
    print_r($info);
    curl_close($ch);
    return;
}
 
curl_close($ch);
 
echo "Call with GET\r\nResult:\r\n";
echo $result . "\r\n";
 
// Analyse result
switch($output) {
    case "xml" :
        $resultXml = simplexml_load_string($result);
        if ($resultXml === false) {
            $resultCode = "XX";
            $resultDescription = "Invalid xml returned";
        }
        else {
            $resultCode = $resultXml->resultCode;
            $resultDescription = $resultXml->resultDescription;
        }
        break;
}
 
// Display Result
echo "Result Code : " . $resultCode . "\r\n";
echo "Result Dewscription : " . $resultDescription . "\r\n";
if ($expectedResult != $resultXml->resultCode) {
    echo "*** ERROR ***\r\n";
}
echo "\r\n";
 
}
?>