Random HTTP/1.1 503 service Unavailable

This script is randomly throwing a 503 error, is it because of Twitch API or my code/framework (Laravel)?

It works for 10 minutes and then the error pops up and I have to manually refresh it in OBS.
I use CLR Browser to display the Channel Status on my Stream.
The meta refresh is because the plugin does not refresh automatically.

Screenshot:
PHP CODE

public function channelStatus($channel) {
$channelName = htmlspecialchars($channel, ENT_QUOTES);

$clientId = '';
$json_array = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/'.strtolower($channelName).'?client_id='.$clientId), true);
 
if ($json_array['stream'] != NULL) {
    $channelTitle = $json_array['stream']['channel']['display_name'];
    $streamTitle = $json_array['stream']['channel']['status'];
    $currentGame = $json_array['stream']['channel']['game'];
 
    echo "<html><body><center><font color='white'>{$streamTitle}</font></center><meta http-equiv='refresh' content='10'></body></html>";
}

}

First off, your link contains your client id…

To answer your question, this is the API failing intermittently. You can surround the file_get_contents call in a try...catch block to handle API failures.