IBAN Validation API in Python: GB82WEST as JSON

IBAN Validation API in Python: GB82WEST as JSON

An IBAN validation API in Python posts an International Bank Account Number and reads the MOD-97 checksum. On BankDataStack that is POST /api/v1/iban/validate with header X-API-Key. Official sample: GB82WEST12345698765432.

Starter is $49.99/mo (1,000 then $0.002) with a 7-day trial. This payload is a checksum + parse — not a live bank-name lookup. No live MCP (DNS for mcp.bankdatastack.com failed 17/9). 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"}}

Python

import json, os, urllib.request
req = urllib.request.Request(
"https://www.bankdatastack.com/api/v1/iban/validate",
data=json.dumps({"iban": "GB82WEST12345698765432"}).encode(),
headers={"X-API-Key": os.environ["BANKDATA_KEY"], "Content-Type": "application/json"},
)
print(urllib.request.urlopen(req).read().decode())

Response: official /docs sample

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

Format errors return 422. A bad checksum returns 400. This is not a “CC checker”.

Go live

1. Register — 7-day trial.

2. Copy X-API-Key (not Bearer).

3. POST {"iban":"GB82WEST12345698765432"}.

4. Read data.valid and data.bban.

Validate an IBAN in Python →

Ready to get started?

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

Get API Key

Related posts