Extranjeros
curl --request POST \
--url https://api.verifica.id/v2/consulta/extranjeros \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_number": "<string>",
"birthdate": "<string>"
}
'import requests
url = "https://api.verifica.id/v2/consulta/extranjeros"
payload = {
"document_number": "<string>",
"birthdate": "<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({document_number: '<string>', birthdate: '<string>'})
};
fetch('https://api.verifica.id/v2/consulta/extranjeros', 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/extranjeros",
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([
'document_number' => '<string>',
'birthdate' => '<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/extranjeros"
payload := strings.NewReader("{\n \"document_number\": \"<string>\",\n \"birthdate\": \"<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/extranjeros")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_number\": \"<string>\",\n \"birthdate\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verifica.id/v2/consulta/extranjeros")
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 \"document_number\": \"<string>\",\n \"birthdate\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"status": 123,
"message": "<string>",
"data": {
"numero_de_documento": "<string>",
"calidad_migratoria": "<string>",
"nombres": "<string>",
"nacionalidad": "<string>",
"apellido_paterno": "<string>",
"apellido_materno": "<string>",
"fecha_nacimiento": "<string>",
"fecha_expiracion_residencia": "<string>",
"fecha_expiracion_carnet": "<string>",
"fecha_ultima_emision_carnet": "<string>"
}
}Validación de Datos
Extranjeros
Valida los datos de un extranjero consultando su número de documento
POST
/
v2
/
consulta
/
extranjeros
Extranjeros
curl --request POST \
--url https://api.verifica.id/v2/consulta/extranjeros \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_number": "<string>",
"birthdate": "<string>"
}
'import requests
url = "https://api.verifica.id/v2/consulta/extranjeros"
payload = {
"document_number": "<string>",
"birthdate": "<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({document_number: '<string>', birthdate: '<string>'})
};
fetch('https://api.verifica.id/v2/consulta/extranjeros', 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/extranjeros",
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([
'document_number' => '<string>',
'birthdate' => '<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/extranjeros"
payload := strings.NewReader("{\n \"document_number\": \"<string>\",\n \"birthdate\": \"<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/extranjeros")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_number\": \"<string>\",\n \"birthdate\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verifica.id/v2/consulta/extranjeros")
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 \"document_number\": \"<string>\",\n \"birthdate\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"status": 123,
"message": "<string>",
"data": {
"numero_de_documento": "<string>",
"calidad_migratoria": "<string>",
"nombres": "<string>",
"nacionalidad": "<string>",
"apellido_paterno": "<string>",
"apellido_materno": "<string>",
"fecha_nacimiento": "<string>",
"fecha_expiracion_residencia": "<string>",
"fecha_expiracion_carnet": "<string>",
"fecha_ultima_emision_carnet": "<string>"
}
}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 documento, Carnet de Extranjería, a validar
Fecha de nacimiento del titular del documento 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 del extranjero validado
Show propiedades de data
Show propiedades de data
Número de documento consultado
Calidad migratoria del titular (ej: “ESPECIAL”)
Nombres del titular
Nacionalidad del titular
Apellido paterno
Apellido materno
Fecha de nacimiento (formato YYYY-MM-DD)
Fecha de expiración de la residencia (formato YYYY-MM-DD)
Fecha de expiración del carnet (formato YYYY-MM-DD)
Fecha de la última emisión del carnet (formato YYYY-MM-DD)
Ejemplo de Solicitud
curl https://api.verifica.id/v2/consulta/extranjeros \
-H "Authorization: Bearer {TU-API-KEY}" \
-d document_number=003278330 \
-d birthdate=1990-01-31
Ejemplo de Respuesta Exitosa
{
"type": "result",
"status": 200,
"message": "Se ha validado la información correctamente.",
"data": {
"numero_de_documento": "012093887",
"calidad_migratoria": "ESPECIAL",
"nombres": "MIGUEL ADRIANO",
"nacionalidad": "VENEZOLANA",
"apellido_paterno": "CUBAS",
"apellido_materno": "QUEVEDO",
"fecha_nacimiento": "1990-01-31",
"fecha_expiracion_residencia": "2026-01-30",
"fecha_expiracion_carnet": "2026-01-24",
"fecha_ultima_emision_carnet": "2023-02-02"
}
}
Códigos de Error
| Código | Descripción |
|---|---|
| 400 | Solicitud inválida - los campos document_number y birthdate son requeridos o tienen 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