Requesting stream info with Client ID in Twitch APIv5

I would def recommend using a cURL library like in the example that @DallasNChains recommended. If you don’t want to use cURL directly, there are several good third party libraries out there (Guzzle & Unirest, to name a couple off the top of my head). They will allow you to easily parse headers so you can do quick checks for 200 and 404, rather than just suppressing any errors that come up retrieving the data.

But if you absolutely insist on using file_get_contents, you need to include the API version and client id inline in the URL like this (79462105 is my channel, so don’t copy and paste verbatim):

https://api.twitch.tv/kraken/streams/79462105?client_id=xxxxxxxxxx&api_version=5

And don’t forget to have the api_version=5 in your query parameters as the default is still v3.

Hope this helps