Skip to content
Constaia
es_driving_license

Spanish driving licence

Extract the categories and expiry date of a Spanish driving licence and validate the NIF.

Category
Identity
Country
Spain
Fields it extracts
7 fields
Cost
1 credit
es_driving_licensespecimen
Number
First name
Last name
Date of birth
Issue date
Expiry date
Categories

The Spanish driving licence uses the DNI number as the licence number. Constaia validates the letter, extracts the categories and checks the expiry date.

  • If you need a specific category, ask for the licence categories to be extracted and check them in your system.

What it checks

  • NIF/NIE check letter. The check character is recomputed (mod 23).
  • 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

  • Numbernumber
  • First namefirst_name
  • Last namelast_name
  • Date of birthbirth_date
  • Issue dateissue_date
  • Expiry dateexpiry_date
  • Categoriescategories

Where it is used

Sample request

curl https://api.constaia.com/v1/analyze \
  -H "Authorization: Bearer $CONSTAIA_API_KEY" \
  -F "file=@document.pdf" \
  -F 'options={
    "expect": "es_driving_license",
    "checks": {
      "not_expired": true,
      "require_fields": [
        "categories"
      ]
    },
    "storage": "none"
  }'

Sample response

Fictitious data. Shortened response.

200 OK · application/json
{
  "id": "an_01J9Z3K8QW4T6Y2B7N5M1R0PXC",
  "object": "analysis",
  "status": "completed",
  "livemode": false,
  "document": {
    "type": "es_driving_license",
    "label": "Spanish driving licence",
    "confidence": 0.97
  },
  "verdict": {
    "expected": [
      "es_driving_license"
    ],
    "match": true,
    "status": "valid",
    "reasons": [
      {
        "code": "type_match",
        "severity": "info",
        "message": "The document is: Spanish driving licence."
      }
    ]
  },
  "fields": {
    "number": {
      "value": "12345678Z",
      "confidence": 0.99,
      "validated": true
    },
    "names": {
      "value": "MARÍA GARCÍA LÓPEZ",
      "confidence": 0.98,
      "validated": null
    },
    "birth_date": {
      "value": "1990-04-18",
      "confidence": 0.97,
      "validated": null
    },
    "expiry_date": {
      "value": "2033-05-02",
      "confidence": 0.96,
      "validated": null
    },
    "categories": {
      "value": "AM, A1, B",
      "confidence": 0.99,
      "validated": null
    }
  },
  "checks": [
    {
      "code": "nif_check_digit",
      "passed": true,
      "message": "The NIF check letter is 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.