I'm using the youtube api to check if a channel is streaming or not, but actualy i reach my limit of quota, i'm using the search method (https://www.googleapis.com/youtube/v3/search) which is awfully expensive.. It cost 100 quota units. Which mean you only get 100 requests per day which is terrible...
I can request an increase in the quota request but that seems like a brute forcing the problem.
I would like to know if there is another simpler method to just check if a channel is streaming or not. ?
My actual php code to check if there is a live stream :
$informationChaine = 'https://www.googleapis.com/youtube/v3/videos?part=snippet&channelId='.$ChannelID.'&type=video&eventType=live&key='.$API_KEY;
$extractInfo = file_get_contents($informationChaine);
$extractInfo = str_replace('},]',"}]",$extractInfo);
$showInfo = json_decode($extractInfo, true);
if($showInfo['pageInfo']['totalResults'] === 0){
?>
<style>
.live > a::before {
content: " ";
animation: blinker 0.5s step-start infinite;
}
@keyframes blinker {
50% {
opacity: 0;
}
}
</style><?php
}
Thanks, Best regards.