Skip to content
Constaia
es_nie

Spanish NIE / TIE

Validate the TIE card and NIE number of foreign residents in Spain.

Category
Identity
Country
Spain
Fields it extracts
9 fields
Cost
1 credit
es_niespecimen
NIE number
First name
Last name
Nationality
Date of birth
Expiry date
Permit type
Sex
Mrz

The foreigner identity card (TIE) carries the NIE number and a machine readable zone (MRZ). Constaia validates the NIE letter, the MRZ check digits and the expiry date, and extracts the type of permit.

  • The NIE replaces X, Y or Z with 0, 1 or 2 before calculating the letter.
  • Useful for registrations and licences where DNI, NIE and passports all appear: you can accept all three documents in the same request.

What it checks

  • NIF/NIE check letter. The check character is recomputed (mod 23).
  • MRZ ICAO 9303. Check digits of the machine readable zone.
  • MRZ vs printed data. The MRZ matches the visible data.
  • Validity. Not expired on the reference date.
  • Holder. Name, number or date of birth match what you expect.
  • Age. Minimum or maximum age from the date of birth.

Fields it extracts

  • NIE numbernie_number
  • First namefirst_name
  • Last namelast_name
  • Nationalitynationality
  • Date of birthbirth_date
  • Expiry dateexpiry_date
  • Permit typepermit_type
  • Sexsex
  • Mrzmrz

Where it is used

Sample request

curl https://api.constaia.com/v1/analyze \
  -H "Authorization: Bearer $CONSTAIA_API_KEY" \
  -F "file=@nie.jpg" \
  -F 'options={
    "expect": "es_nie",
    "checks": {
      "not_expired": true
    },
    "storage": "none"
  }'

Try it for free in test mode with the file nie.jpg.

Sample response

Fictitious data. Shortened response.

200 OK · application/json
{
  "id": "an_01J9Z3K8QW4T6Y2B7N5M1R0PXC",
  "object": "analysis",
  "status": "completed",
  "livemode": false,
  "document": {
    "type": "es_nie",
    "label": "Spanish NIE / TIE",
    "confidence": 0.97
  },
  "verdict": {
    "expected": [
      "es_nie"
    ],
    "match": true,
    "status": "valid",
    "reasons": [
      {
        "code": "type_match",
        "severity": "info",
        "message": "The document is: Spanish NIE / TIE."
      }
    ]
  },
  "fields": {
    "nie_number": {
      "value": "X1234567L",
      "confidence": 0.99,
      "validated": true
    },
    "names": {
      "value": "ANA MARIA POPESCU",
      "confidence": 0.98,
      "validated": null
    },
    "nationality": {
      "value": "ROU",
      "confidence": 0.97,
      "validated": null
    },
    "birth_date": {
      "value": "1988-11-02",
      "confidence": 0.96,
      "validated": null
    },
    "expiry_date": {
      "value": "2029-06-30",
      "confidence": 0.99,
      "validated": null
    },
    "permit_type": {
      "value": "RESIDENCIA",
      "confidence": 0.98,
      "validated": null
    }
  },
  "checks": [
    {
      "code": "nie_check_digit",
      "passed": true,
      "message": "The NIE check letter is correct."
    },
    {
      "code": "mrz_checksums",
      "passed": true,
      "message": "The MRZ check digits are correct."
    }
  ],
  "warnings": [],
  "storage": {
    "mode": "none",
    "file_deleted_at": "2026-09-29T10:00:02Z",
    "expires_at": null
  },
  "usage": {
    "credits": 1,
    "pages": 2
  }
}

FAQ

Does Constaia prove that the document is authentic?

No. It checks the type, the consistency of the data and your rules, and flags signals such as a possible edit or a photo of a screen. That does not prove authenticity.

Is a copy of the document kept?

Only if it needs review: it is then kept encrypted until someone decides and for 24 hours after that (configurable). Otherwise it is deleted as soon as the analysis ends. You can choose never to keep it.

Other documents

And for the record…

Create your free account and validate your first document in five minutes. No card required.