 




    <?php

if (isset($_GET['bin'])) {
    $bin = $_GET['bin'];

$curl = curl_init();

curl_setopt_array($curl, [
	CURLOPT_URL => "https://bin-ip-checker.p.rapidapi.com/?bin=$bin",
	CURLOPT_RETURNTRANSFER => true,
	CURLOPT_ENCODING => "",
	CURLOPT_MAXREDIRS => 10,
	CURLOPT_TIMEOUT => 30,
	CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
	CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_SSL_VERIFYPEER => false,
	CURLOPT_POSTFIELDS => json_encode([
		'bin' => $bin
	]),
	CURLOPT_HTTPHEADER => [
		"Content-Type: application/json",
		"x-rapidapi-host: bin-ip-checker.p.rapidapi.com",
		"x-rapidapi-key: a8c5ba03f8mshc739b69d5913cf3p1a6e71jsnee301e891d5c"
	],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
	echo "cURL Error #:" . $err;
} else {
	 
 
    // Afficher les données en format JSON
    header('Content-Type: application/json');
    echo json_encode($response, JSON_PRETTY_PRINT);
}


    

}   

?>