Consulta RUC SUNAT
Igual que Consultar RUC, pero priorizando siempre la fuente oficial de SUNAT.
Consideraciones
- Disponible en el plan gratuito. Consume 1 consulta de tu plan.
Devuelve la ficha del contribuyente forzando la fuente SUNAT oficial,
con respaldo en Nubefact. Incluye más detalle que /ruc (actividades económicas,
comprobantes autorizados, emisión electrónica).
Headers
| Name | Type | Description |
|---|---|---|
| Accept | String | application/json |
| Content-Type | string | application/json |
| Authorization | string | Bearer <token>. Genéralo desde tu panel, en Api Tokens. |
Body
| Name | Type | Description |
|---|---|---|
| ruc* | string | Número de RUC de 11 dígitos. Ejemplo: 20131312955. |
Ejemplo de solicitud
Copiar
curl -X POST https://api.apiperu.dev/ruc-sunat \
-H "Accept: application/json" \
-H "Authorization: Bearer TU_TOKEN" \
-H "Content-Type: application/json" \
-d '{"ruc":"20131312955"}' Copiar
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.apiperu.dev/ruc-sunat',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
'ruc' => '20131312955',
]),
CURLOPT_HTTPHEADER => [
'Accept: application/json',
'Authorization: Bearer TU_TOKEN',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response; Copiar
const response = await fetch('https://api.apiperu.dev/ruc-sunat', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer TU_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
ruc: '20131312955',
}),
});
const data = await response.json();
console.log(data); Copiar
import requests
response = requests.post(
'https://api.apiperu.dev/ruc-sunat',
headers={
'Accept': 'application/json',
'Authorization': 'Bearer TU_TOKEN',
'Content-Type': 'application/json',
},
json={
'ruc': '20131312955',
},
)
print(response.json()) Respuesta
200 OK application/json
{
"success": true,
"data": {
"ruc": "20131312955",
"nombre_o_razon_social": "SUPERINTENDENCIA NACIONAL DE ADUANAS Y DE ADMINISTRACION TRIBUTARIA",
"estado": "ACTIVO",
"condicion": "HABIDO",
"direccion_completa": "AV. GARCILASO DE LA VEGA NRO. 1472 - LIMA - LIMA - LIMA",
"tipo_contribuyente": "INSTITUCION PUBLICA",
"fecha_inscripcion": "1993-05-24",
"actividades_economicas": ["ACTIVIDADES DE LA ADMINISTRACION PUBLICA EN GENERAL"]
},
"time": 0.9
}