false, 'http' => 0, 'why' => 'bad_length']); exit; } $url = "https://api.insee.fr/api-sirene/3.11/siret/$siret"; $ch = curl_init($url); curl_setopt_array($ch, [ CURLOPT_HTTPHEADER => ["X-INSEE-Api-Key-Integration: $API_KEY", "Accept: application/json"], CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10, ]); curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo json_encode(['exists' => ($code === 200), 'http' => $code]);