Identity Verification in Spain
Verifik's Identity Verification API helps you authenticate Spanish citizens and residents using official government data. It's designed to streamline your KYC (Know Your Customer) processes, prevent fraud, and ensure you meet all regulatory requirements effortlessly.
We built this integration for businesses that need a fast, secure, and automated way to confirm the true identity of users, employees, or customers.
What does this API validate?
Our API connects directly with official records to validate:
- Full Name & Document Number: Supports Documento Nacional de Identidad (DNI) and Número de Identidad de Extranjero (NIE).
- Identity Match: Confirms that the name provided matches the document number.
- Expiration Date Verification: Validates the document expiration date.
By verifying these details, you can be confident that the person you're dealing with is real and holds a valid document, significantly lowering the risk of impersonation and fraud.
API Reference
Endpoint
https://api.verifik.co/v2/es/cedula
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
documentType | string | Yes | Document type. Allowed values: DNIES, NIE. |
documentNumber | string | Yes | Document number without spaces. |
expirationDate | string | Conditional | Validity/expiration date in DD/MM/YYYY format. Required for DNIES and for NIE numbers that do not start with X, Y, or Z (e.g., M-prefixed NIEs). Not accepted as the only proof for X/Y/Z NIEs. |
supportNumber | string | Conditional | Required for NIE numbers starting with X, Y, or Z. Accepted formats: C + 8 digits (EU registration certificate) or E + 8 digits (TIE residence card). Shorter C or E values (1–7 digits) are zero-padded after the letter, and spaces/hyphens are ignored. |
Request
- Node.js
- Python
import axios from "axios";
// DNIES or non-X/Y/Z NIE (requires expirationDate)
const { data } = await axios.get("https://api.verifik.co/v2/es/cedula", {
params: { documentType: "DNIES", documentNumber: "123456789", expirationDate: "17/07/2024" },
headers: { "Content-Type": "application/json", Authorization: `Bearer ${process.env.VERIFIK_TOKEN}` },
});
console.log(data);
// X/Y/Z NIE (requires supportNumber: C + 8 digits or E + 8 digits)
// params: { documentType: "NIE", documentNumber: "X1234567L", supportNumber: "E25758657" }
import os, requests
url = "https://api.verifik.co/v2/es/cedula"
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {os.getenv('VERIFIK_TOKEN')}"}
# DNIES or non-X/Y/Z NIE (requires expirationDate)
params = {"documentType": "DNIES", "documentNumber": "123456789", "expirationDate": "17/07/2024"}
r = requests.get(url, headers=headers, params=params)
print(r.json())
# X/Y/Z NIE (requires supportNumber: C + 8 digits or E + 8 digits)
# params = {"documentType": "NIE", "documentNumber": "X1234567L", "supportNumber": "E25758657"}
Response
- 200
- 401
- 403
- 404
- 409
{
"data": {
"documentType": "DNIES",
"documentNumber": "123456789",
"fullName": "Juan Pérez",
"names": ["Juan", "Pérez"]
},
"signature": {"message": "Certified by Verifik.co", "dateTime": "January 16, 2024 3:44 PM"},
"id": "ES001"
}
{
"message": "Authentication required",
"code": "UNAUTHORIZED"
}
{
"message": "Access forbidden",
"code": "FORBIDDEN"
}
{
"code": "NotFound",
"message": "Record not found."
}
{
"code": "MissingParameter",
"message": "supportNumber is required for NIE numbers starting with X, Y or Z. Use C followed by 8 digits for the EU registration certificate, or E followed by 8 digits for the TIE. expirationDate is not accepted as proof for this NIE type."
}
{
"code": "InvalidParameter",
"message": "supportNumber must be C or E followed by 8 digits (C + 8 digits for the EU registration certificate, E + 8 digits for the TIE)."
}
{
"code": "MissingParameter",
"message": "expirationDate is required for DNIES"
}
{
"code": "MissingParameter",
"message": "missing documentType\n"
}
{
"code": "MissingParameter",
"message": "missing documentNumber\n"
}
{
"code": "MissingParameter",
"message": "documentType must be one of: [DNIES, NIE]"
}
Notes
expirationDatemust follow the formatDD/MM/YYYYand is required forDNIESand non-X/Y/ZNIEnumbers (e.g.M-prefixed NIEs).NIEnumbers starting withX,Y, orZrequiresupportNumber(C+ 8 digits for the EU registration certificate,E+ 8 digits for the TIE). Missing or invalidsupportNumberreturns an uncharged409.
Common Use Cases
- Fintech & Banking: Verify identities instantly during account opening or loan applications.
- E-commerce & Delivery: Authenticate users and couriers before they become active on your platform.
- HR & Recruitment: Validate candidate documents as part of your hiring workflow.
- Insurance & Healthcare: Confirm identities before issuing policies or providing medical benefits.
Official Sources & Reliability
We connect directly with official Spanish government sources to ensure you receive verified, up-to-the-minute information. Every query is handled with strict adherence to security and regulatory standards.
Key Benefits
- Automated Compliance: Streamline your KYC checks to prevent fraud without adding friction for your users.
- Instant Results: Process verifications in seconds, perfect for real-time digital onboarding.
- Trusted Data: Rely on data sourced directly from official records.
- Easy Integration: Connect easily via our REST API or use our compatible SDKs.
Compliance & Security
We prioritize the safety of your data. Verifik uses advanced encryption (HTTPS/TLS 1.3) and strict privacy management standards to ensure confidentiality. Our service is monitored 24/7 for availability and offers role-based access controls to keep your team's access secure.
About Verifik
Verifik is a leading platform for identity verification, compliance, and fraud prevention across Latin America and Europe. Our APIs automate KYC, KYB, AML, and biometric validation processes, connecting businesses with official data sources in Colombia, Mexico, Peru, Chile, Uruguay, Argentina, Brazil, Spain, and beyond.