NIF / NIE
GET/v0/es/nif
Validates Spanish tax identification numbers: NIF (Número de Identificación Fiscal) for citizens (DNI format: 8 digits + control letter) and NIE (Número de Identidad de Extranjero) for foreign residents (X/Y/Z + 7 digits + control letter). The control letter is verified using the standard modulus-23 lookup table. Spaces, hyphens, and dots are stripped automatically.
Try it
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| value | string | Yes | DNI (e.g. 12345678Z) or NIE (e.g. X1234567L) |
Example Request
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.isvalid.dev/v0/es/nif?value=12345678Z"
Response Fields
| Field | Type | Description |
|---|---|---|
| valid | boolean | Whether the NIF/NIE passed control letter validation |
| type | string | DNI (citizen) or NIE (foreign resident) |
| number | string | The numeric part (8 digits for DNI, prefix + 7 digits for NIE) |
| letter | string | The control letter |
Example Response — DNI
{
"valid": true,
"type": "DNI",
"number": "12345678",
"letter": "Z"
}Example Response — NIE
{
"valid": true,
"type": "NIE",
"number": "X1234567",
"letter": "L"
}Example Response — invalid
{
"valid": false
}