The Spanish resident information service you can easily verify the validity of Spanish Identity Cards (DNI/NIE) by providing the document number and the expiration date. The response includes the document type, document number, full name, first name, last name, and an array of names.

Parameters

Name Type ¿Required? Description Example
documentType String True Document type. Allowed parameter: DNIES, NIE. DNIES
documentNumber String True Document number of the person to consult without spaces. 123456789
date String True The date on which the document to be consulted expires. Valid format: DD/MM/YYYY. 17/07/2024

Implementation

Request

import axios from 'axios';

const options = {
  method: 'GET',
  url: '<https://api.verifik.co/v2/es/cedula>',
  params: {
		  documentType: 'DNIES', 
		  documentNumber: '12345678H', 
		  date: '17/07/2024'
				  },
  headers: {
    Accept: 'application/json',
    Authorization: 'jwt <tu_token>'
  }
};

try {
 notFou const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}

Response 200 - (Successful response)

{
    "data": {
        "documentType": "DNIES",
        "documentNumber": "53578667Y",
        "fullName": "CARMEN BEATRIZ ROMERO RODRIGUEZ",
        "firstName": "CARMEN BEATRIZ",
        "lastName": "ROMERO RODRIGUEZ",
        "arrayName": [
            "ROMERO",
            "RODRIGUEZ",
            "CARMEN",
            "BEATRIZ"
        ]
    },
    "signature": {
        "dateTime": "March 12, 2024 9:16 PM",
        "message": "Certified by Verifik.co"
    },
    "id": "UCEJG"
}

Other responses

Code Description Response Body
404 Not Found Information not found. {
"code": "NotFound",
"message": "Record not found.",
"signature": {
"dateTime": "August 31, 2022 3:24 PM",
"message": "Certified by Verifik.co"
}
}
409 Conflict Some parameters are missing. {
"code": "MissingParameter",
"message": "missing documentType\n. missing documentNumber\n"
}
409 Conflict Invalid documentType for this query. {
"code": "MissingParameter",
"message": "documentType must be one of: [DNIES,NIE]"
}
409 Conflict An attempt is being made to query a document that does not match the documentType. {
"code": "MissingParameter",
"message": "Format incorrect: documentNumber"
}
409 Conflict Invalid date format. {
"code": "MissingParameter",
"message": "date format required: DD/MM/YYYY\n"
}