For Helix you need to send the client ID has a header, it cannot be passed as part of the URL. Most libraries can do that easily though.
jQuery example:
jQuery.ajax({
type: 'GET',
url: 'https://api.twitch.tv/helix/streams?user_login=lirik',
headers: {
'Client-ID': 'YOUR-CLIENT-ID'
},
success: function(c){
//data array is empty when queried channel is offline
if (c.data.length > 0) {
//Stream is online
} else {
//Stream is offline
}
}
});