Consulta RUC de la SUNAT Y DNI Usando cualquier lenguaje de programación
curl --location --request POST 'https://buscaruc.com/api/v1/ruc' \
--header 'Content-Type: application/json' \
--data-raw '{
"ruc": "20788757225",
"token": "YOUR_TOKEN"
}'
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://buscaruc.com/api/v1/ruc',
'headers': {
'Content-Type': 'application/json'
},
body: JSON.stringify({"ruc":"20788757225","token":"YOUR_TOKEN"})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
require "uri"
require "net/http"
url = URI("https://buscaruc.com/api/v1/ruc")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = "{\r\n \"ruc\": \"20788757225\",\r\n \"token\": \"YOUR_TOKEN\"\r\n}"
response = http.request(request)
puts response.read_body
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://buscaruc.com/api/v1/ruc',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"ruc": "20788757225",
"token": "YOUR_TOKEN"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;