/* $json = file_get_contents('https://feiertage-api.de/api/?jahr=2019'); $obj = json_decode($json); echo $obj->access_token; */ $url = "https://feiertage-api.de/api/?jahr=2019"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true ); // This is what solved the issue (Accepting gzip encoding) //curl_setopt($ch, CURLOPT_ENCODING, "gzip,deflate"); $response = curl_exec($ch); curl_close($ch); echo $response;