Snekfetch (Node.js) Twitch API calls - Getting if a Streamer is live

The reason you’re getting the first page of results from the entire stream list is because you’re effectively sending a request to https://api.twitch.tv/kraken/streams as your URL has issues.

There’s 3 problems here, first off you’re attempting to use the querystring param user_login which is for the Helix streams endpoint, but you’re requesting the old Kraken endpoint. The endpoint should be https://api.twitch.tv/helix/streams.

Secondly, your querystring is malformed. A question mark ? is used to indicate the start of the querystring, and the ampersand & is used to separate each key/value pair. So you need to remove that ampersand.

Finally, the double quotes around ${streamer} shouldn’t be used as they are not part of the streamers username.

The correct URL would be https://api.twitch.tv/helix/streams?user_login=${streamer}