Generate Random IBAN

Documentazione dell’API

L’API di Generate Random IBAN permette di generare e validare in modo programmatico IBAN di test strutturalmente validi (ISO 13616 / MOD-97). Tutte le risposte sono in JSON. Gli IBAN generati servono solo per i test e non corrispondono mai a conti bancari reali.

URL di base

https://generaterandomiban.com/api/v1

Autenticazione

Tutti gli endpoint, tranne l’indice del servizio, richiedono una chiave API. Inviala nell’header X-API-Key (funziona anche un token Authorization: Bearer). Mantieni segreta la tua chiave e non esporla mai nel codice lato client.

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

Le chiavi API vengono rilasciate manualmente. Per richiederne una, scrivici con una breve descrizione del tuo caso d’uso e ti risponderemo con la tua chiave.

apis[at]GenerateRandomiban.com

Limiti di utilizzo

Le richieste sono limitate per chiave — 60 richieste al minuto per impostazione predefinita, oppure un limite personalizzato assegnato alla tua chiave. Il superamento del limite restituisce HTTP 429 (Too Many Requests).

Endpoint

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/it/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 }
}

Errori e codici di stato

Gli errori restituiscono un codice di stato HTTP standard e un corpo JSON con un oggetto error contenente un code e un message. Stati tipici: 401 (chiave mancante o non valida), 404 (paese o endpoint sconosciuto), 422 (parametri non validi) e 429 (limite superato).

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