You need to send a client ID with your requests or else it will return error: bad request; status: 400; message: No client id specified
You can get a client ID by registering an application at https://dev.twitch.tv/dashboard/apps
Also, just a tip. It’s best to use cURL instead of file_get_contents because file_get_contents doesn’t return any errors as cURL would.