UK IBAN to BBAN API: Sort Code and Account Number as JSON

UK IBAN to BBAN API: Sort Code and Account Number as JSON

A UK IBAN BBAN API splits an International Bank Account Number into country, check digits, and BBAN. On BankDataStack that is POST https://www.bankdatastack.com/api/v1/iban/validate with header X-API-Key. Official sample: GB82WEST12345698765432.

Starter is $49.99/mo (1,000 calls, then $0.002) with a 7-day trial. This payload is a checksum + parse — not a live bank-name lookup. Docs: bankdatastack.com/docs.

Request: official UK WEST

curl -X POST https://www.bankdatastack.com/api/v1/iban/validate \
  -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
  -d '{"iban": "GB82WEST12345698765432"}' 

Response: official /docs sample

{
  "status": "success",
  "data": {
    "iban": "GB82WEST12345698765432",
    "valid": true,
    "countryCode": "GB",
    "checkDigits": "82",
    "bban": "WEST12345698765432"
  }
}

bban is everything after the check digits. Format errors return 422; a bad checksum returns 400.

PHP: read the BBAN

$ch = curl_init("https://www.bankdatastack.com/api/v1/iban/validate");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ["X-API-Key: YOUR_API_KEY", "Content-Type: application/json"],
    CURLOPT_POSTFIELDS => json_encode(["iban" => "GB82WEST12345698765432"]),
]);
$bban = json_decode(curl_exec($ch), true)["data"]["bban"] ?? null;

Go live

1. Register — 7-day trial.

2. Copy X-API-Key.

3. POST the official IBAN.

4. Store countryCode / checkDigits / bban.

Parse a UK IBAN →

Ready to get started?

Get your API key and start validating bank data in minutes.

Get API Key