Skip to main content

ibanchecker

Official Python client for the ibanchecker.cash IBAN validation API.

Validate IBANs across 92 countries, validate up to 100 IBANs per request, extract IBANs from free text, look up country format specifications, and resolve SWIFT/BIC codes. No IBAN data is stored or logged; all validation runs in memory at the edge.

Install

pip install ibanchecker

Quick start

from ibanchecker import IbanChecker

client = IbanChecker()  # no API key needed for light use (100 requests/hour per IP)

result = client.validate("DE89 3704 0044 0532 0130 00")
if result:                      # ValidationResult is truthy when valid
    print(result.country_name)  # "Germany"
    print(result.bank_name)     # "Commerzbank AG Cologne"
    print(result.bic)           # "COBADEFFXXX"
else:
    print(result.error)         # human-readable reason
    print(result.error_code)    # e.g. "INVALID_LENGTH"

Authentication

An API key is optional. Without one, requests are limited to 100 per hour per IP. With a key, requests count against your plan quota. Get a free key at ibanchecker.cash/api-docs.

client = IbanChecker("iban_your_api_key")

The client can also be used as a context manager so the underlying HTTP session is closed cleanly:

with IbanChecker("iban_your_api_key") as client:
    result = client.validate("GB29 NWBK 6016 1331 9268 19")

Methods

Method Description
validate(iban) Validate a single IBAN. Returns a ValidationResult.
validate_bulk(ibans) Validate up to 100 IBANs. Returns a BatchResult.
extract(text) Find and validate IBANs in free text (up to 50,000 chars). Returns a BatchResult.
get_format(country) IBAN format spec for an ISO country code. Returns a FormatSpec.
lookup_bic(bic) Resolve an 8 or 11 character BIC. Returns a BankRecord.

Bulk validation

batch = client.validate_bulk([
    "DE89370400440532013000",
    "GB29NWBK60161331926819",
    "XX00",
])
print(batch.valid_count, "of", batch.count, "valid")
for r in batch:                 # iterate results in input order
    print(r.iban, r.valid)

Extract from text

batch = client.extract("Please wire to DE89 3704 0044 0532 0130 00 by Friday.")
for r in batch:
    print(r.iban, r.bank_name)

Country format and BIC lookup

fmt = client.get_format("DE")
print(fmt.length, fmt.example)          # 22 'DE89370400440532013000'

bank = client.lookup_bic("DEUTDEFF")
print(bank.bank_name, bank.city)        # 'Deutsche Bank AG Frankfurt' 'FRANKFURT AM MAIN'

Error handling

A malformed IBAN is not an exception: validate() returns a ValidationResult with valid=False. Exceptions are raised only for transport, authentication, and rate-limit problems:

from ibanchecker import IbanChecker, AuthenticationError, RateLimitError, NotFoundError

client = IbanChecker("iban_your_api_key")
try:
    bank = client.lookup_bic("ZZZZZZZZ")
except NotFoundError:
    print("No bank for that BIC")
except RateLimitError as e:
    print("Slow down:", e.message)
except AuthenticationError:
    print("Check your API key")

All exceptions derive from IbanCheckerError and carry .status, .error_code, and .response.

Links

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ibanchecker-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ibanchecker-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file ibanchecker-0.1.0.tar.gz.

File metadata

  • Download URL: ibanchecker-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ibanchecker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6acc1257677876da90c49d01625f10d50b488019e95f7aaa34b8fd356744936d
MD5 306cff23fc874779a8a01dc22e7165d6
BLAKE2b-256 1ccb782936fb121117e2fa18cc4e3082f76da92e77771a20cd7b45e311a5e45b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ibanchecker-0.1.0.tar.gz:

Publisher: publish.yml on koraykoylu/ibanchecker-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ibanchecker-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ibanchecker-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ibanchecker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7f455a82a5f65759228271a06fb312bccdd9e529f02691c49427e7a9e72d862
MD5 57e61ea6f841bcc6220b1465bdd9a2af
BLAKE2b-256 c9a36dc1638faa727d0dcd63cd2dab628452f42203456c52b9b10142291158d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ibanchecker-0.1.0-py3-none-any.whl:

Publisher: publish.yml on koraykoylu/ibanchecker-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page