I am using these code to fetch zebpay api data. From this API URL - https://www.zebapi.com/api/v1/market/ticker/btc/inr
function get_api($url){
if(!empty($url)){
$api_url=$url;
if (@$_GET['curl']=="yes") {
return(header('HTTP/1.1 503 Service Temporarily Unavailable'));
} else {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$parsed_json = curl_exec($ch);
$parsed_json = json_decode($parsed_json);
return($parsed_json);
curl_close($ch);
}
}
}
$api= get_api('https://www.zebapi.com/api/v1/market/ticker/btc/inr');
echo $api->buy;
I have also try file_get_contents but same problem. I have face this issue in 2 more api's. Note: Once i get the data and use it correctly but today this is not working again.