You can use the Get Streams endpoint to see if a stream is live https://dev.twitch.tv/docs/api/reference#get-streams
As the docs show, you have to specify your client id as a header rather than querystring param, and to specify the channel you would use either the user_id or user_login params (up to 100 channels at a time).
If a channel is live, they’ll be shown in the response, if a channel isn’t in the response then they’re offline.