> For the complete documentation index, see [llms.txt](https://diurvan.gitbook.io/apidiurvan/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://diurvan.gitbook.io/apidiurvan/consulta-ruc.md).

# Consulta RUC

### Consideraciones previas

* Este servicio no se conecta con el padrón de SUNAT.
* No almacenamos los resultados de consulta RUC.

## Consulta RUC

<mark style="color:green;">`POST`</mark> `https://diurvanconsultores.com/apidiurvan/api/dniruc`

Consulta de nombres por número de RUC.

#### Headers

| Name          | Type   | Description       |
| ------------- | ------ | ----------------- |
| Authorizarion | string | Bearer {TU TOKEN} |
| Content-Type  | string | application/json  |

#### Request Body

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| documento | string | {TU RUC}    |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "success": true,
    "message": {
        "tipo_documento": "RUC",
        "nro_documento": "EL RUC",
        "nombre_completo": "RAZON SOCIAL EMPRESA",
        "direccion": "DIRECCION DE LA EMPRESA",
        "estado": "ACTIVO",
        "tipo_empresa": "EMPRESA INDIVIDUAL DE RESP. LTDA",
        "fecha_inscripcion": "25/06/2016",
        "fecha_inicio": "25/06/2016",
        "condicion": "HABIDO",
        "actividad_economica": "CONSULTORES  PROG. Y SUMIN. INFORMATIC.",
        "estado_civil": "",
        "ubigeo": "",
        "foto": "soon"
    }
}
```

{% endtab %}
{% endtabs %}

### Ejemplos de uso

{% tabs %}
{% tab title="PHP" %}

```php
$diurvan_api_url = "https://diurvanconsultores.com/apidiurvan/api/dniruc";
$header = array( 
  "Content-Type: application/json", 
  "Authorization: Bearer TU TOKEN" 
);

$data = array(
  'documento' => "12345678901"
);
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => $diurvan_api_url,
  CURLOPT_HTTPHEADER => $header,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => json_encode($data)
));
$dataretorno = curl_exec($curl);
if (curl_errno($curl))
  $retorno = json_decode(curl_error($curl));
else
  $retorno = json_decode($dataretorno);
curl_close($curl);
echo $retorno->message;
```

{% endtab %}
{% endtabs %}

### Visualización en el dashboard

Se visualiza las estadística mensual y también el nro de peticiones por día

![](/files/-Mh39DWPm8z4EUatUNw9)
