Generate Random IBAN

API Documentation

The Generate Random IBAN API lets you generate and validate structurally valid (ISO 13616 / MOD-97) test IBANs programmatically. All responses are JSON. Generated IBANs are for testing only and never correspond to real bank accounts.

Base URL

https://generaterandomiban.com/api/v1

Authentication

Every endpoint except the service index requires an API key. Send it in the X-API-Key request header (an Authorization: Bearer token also works). Keep your key secret and never expose it in client-side code.

curl -H "X-API-Key: YOUR_KEY" https://generaterandomiban.com/api/v1/countries

API keys are issued manually. To request one, email us with a short description of your use case and we will reply with your key.

apis[at]GenerateRandomiban.com

Rate limits

Requests are rate limited per key — 60 requests per minute by default, or a custom limit assigned to your key. Exceeding the limit returns HTTP 429 (Too Many Requests).

Endpoints

GET /api/v1 public

Public service index: metadata and the list of endpoints. No API key required.

Example request
curl https://generaterandomiban.com/api/v1
Example response
{
  "name": "Generate Random IBAN API",
  "version": "v1",
  "documentation": "https://generaterandomiban.com/en/apis/docs",
  "authentication": { "type": "api_key", "header": "X-API-Key" }
}
GET /api/v1/countries

List every supported country with its IBAN format.

Example request
curl -H "X-API-Key: YOUR_KEY" https://generaterandomiban.com/api/v1/countries
Example response
{
  "count": 45,
  "countries": [
    {
      "code": "DE",
      "name": "Germany",
      "slug": "germany",
      "iban_length": 22,
      "bban_length": 18,
      "bban_format": "8n10n",
      "structure": "DEkk bbbb bbbb cccc cccc cc",
      "example": "DE89370400440532013000"
    }
  ]
}
GET /api/v1/countries/{code}

Get the IBAN format for a single country.

Parameter In Description
code path ISO 3166-1 alpha-2 country code (e.g. DE, FR, IT).
Example request
curl -H "X-API-Key: YOUR_KEY" https://generaterandomiban.com/api/v1/countries/DE
Example response
{
  "country": {
    "code": "DE",
    "name": "Germany",
    "iban_length": 22,
    "bban_format": "8n10n",
    "example": "DE89370400440532013000"
  }
}
GET /api/v1/generate/{country}

Generate one or more random, valid IBANs for a country.

Parameter In Description
country path ISO 3166-1 alpha-2 country code.
count query How many IBANs to return, 1–100 (default 1).
Example request
curl -H "X-API-Key: YOUR_KEY" "https://generaterandomiban.com/api/v1/generate/DE?count=2"
Example response
{
  "country": { "code": "DE", "name": "Germany", "iban_length": 22 },
  "count": 2,
  "ibans": [
    {
      "iban": "DE89370400440532013000",
      "formatted": "DE89 3704 0044 0532 0130 00",
      "country": "DE",
      "check_digits": "89",
      "bban": "370400440532013000",
      "length": 22,
      "valid": true
    }
  ]
}
POST /api/v1/generate

Generate IBANs from a JSON body.

Parameter In Description
country body ISO 3166-1 alpha-2 country code (required).
count body How many IBANs to return, 1–100 (default 1).
Example request
curl -X POST -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"country":"FR","count":3}' https://generaterandomiban.com/api/v1/generate
Example response
{
  "country": { "code": "FR", "name": "France", "iban_length": 27 },
  "count": 3,
  "ibans": [ /* … */ ]
}
GET /api/v1/validate/{iban}

Validate an IBAN passed in the URL (spaces removed).

Parameter In Description
iban path The IBAN to validate (letters and digits only).
Example request
curl -H "X-API-Key: YOUR_KEY" https://generaterandomiban.com/api/v1/validate/DE89370400440532013000
Example response
{
  "iban": "DE89370400440532013000",
  "valid": true,
  "country_code": "DE",
  "country_supported": true,
  "check_digits": "89",
  "bban": "370400440532013000",
  "length": 22,
  "expected_length": 22,
  "checks": { "mod97": true, "length": true, "format": true, "country_supported": true }
}
POST /api/v1/validate

Validate an IBAN from a JSON body.

Parameter In Description
iban body The IBAN to validate (required).
Example request
curl -X POST -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"iban":"DE89 3704 0044 0532 0130 00"}' https://generaterandomiban.com/api/v1/validate
Example response
{
  "iban": "DE89370400440532013000",
  "valid": true,
  "country_code": "DE",
  "checks": { "mod97": true, "length": true, "format": true, "country_supported": true }
}

Errors and status codes

Errors return a standard HTTP status code and a JSON body with an error object containing a code and a message. Typical statuses: 401 (missing or invalid key), 404 (unknown country or endpoint), 422 (invalid parameters) and 429 (rate limit exceeded).

{
  "error": {
    "code": "invalid_request",
    "message": "The \"count\" parameter must be an integer between 1 and 100."
  }
}
Request an API key