Personas
curl --request POST \
--url https://api.verifica.id/v2/consulta/personas \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dni": "<string>"
}
'import requests
url = "https://api.verifica.id/v2/consulta/personas"
payload = { "dni": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({dni: '<string>'})
};
fetch('https://api.verifica.id/v2/consulta/personas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.verifica.id/v2/consulta/personas",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dni' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.verifica.id/v2/consulta/personas"
payload := strings.NewReader("{\n \"dni\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.verifica.id/v2/consulta/personas")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dni\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verifica.id/v2/consulta/personas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dni\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"status": 123,
"message": "<string>",
"data": {
"dni": "<string>",
"nombres": "<string>",
"apellido_paterno": "<string>",
"apellido_materno": "<string>",
"caracter_verificacion": "<string>",
"caracter_verificacion_anterior": {}
}
}Validación de Datos
Personas
Valida los datos de una persona consultando su número de DNI
POST
/
v2
/
consulta
/
personas
Personas
curl --request POST \
--url https://api.verifica.id/v2/consulta/personas \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dni": "<string>"
}
'import requests
url = "https://api.verifica.id/v2/consulta/personas"
payload = { "dni": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({dni: '<string>'})
};
fetch('https://api.verifica.id/v2/consulta/personas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.verifica.id/v2/consulta/personas",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dni' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.verifica.id/v2/consulta/personas"
payload := strings.NewReader("{\n \"dni\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.verifica.id/v2/consulta/personas")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dni\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verifica.id/v2/consulta/personas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dni\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"status": 123,
"message": "<string>",
"data": {
"dni": "<string>",
"nombres": "<string>",
"apellido_paterno": "<string>",
"apellido_materno": "<string>",
"caracter_verificacion": "<string>",
"caracter_verificacion_anterior": {}
}
}Autenticación
Este endpoint requiere autenticación Bearer. Incluye tu API key en el header Authorization (si aún no sabes cómo obtener y usar tu API key, consulta la página de Autenticación):Authorization: Bearer YOUR_API_KEY
Atributos Requeridos
Número de DNI a validar
Respuesta
Tipo de respuesta (ej: “result”)
Código de estado HTTP de la respuesta (ej: 200)
Mensaje descriptivo del resultado de la validación
Datos de la persona validada
Show propiedades de data
Show propiedades de data
Número de DNI consultado
Nombres de la persona
Apellido paterno
Apellido materno
Carácter de verificación (dígito verificador) del DNI
Carácter de verificación anterior del DNI;
null si no aplicaEjemplo de Solicitud
curl --request POST \
--url https://api.verifica.id/v2/consulta/personas \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {TU-API-KEY}' \
--header 'content-type: multipart/form-data' \
--form dni=45678912
Ejemplo de Respuesta Exitosa
{
"type": "result",
"status": 200,
"message": "Se ha validado la información correctamente.",
"data": {
"dni": "45678912",
"nombres": "JUANA MARIA",
"apellido_paterno": "TORRES",
"apellido_materno": "RAMIREZ",
"caracter_verificacion": "9",
"caracter_verificacion_anterior": null
}
}
Códigos de Error
| Código | Descripción |
|---|---|
| 400 | Solicitud inválida - el campo dni es requerido o tiene un formato incorrecto |
| 401 | Token de autenticación inválido o faltante |
| 429 | Demasiadas solicitudes - se ha excedido el límite de rate |
| 500 | Error interno del servidor |
⌘I