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

I’m new to the Twitch API and trying to make a discord bot which will make a notification when a streamer is live.

However instead of returning the json object of the specified streamer, it seems to grab the entire front page of Twitch, and it returns 65966 results instead of just 1.

const streamer = 'insertstreamerhere';

const api = `"${streamer}"`;
const announcements = bot.channels.find(`name`, "announcements");

snekfetch.get(api).set('Client-ID', "XXXXXXXXXXXXX").then(r => {
    if ( === null) {
        setInterval(() => {
        }, 30000);
    } else {
        //Do other stuff console.log is temporary

I’m not quite sure what I’m doing wrong, or if I’m misunderstanding the documentation.

Any clarification / insight is appreciated.

Thanks in advance

The reason you’re getting the first page of results from the entire stream list is because you’re effectively sending a request to 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

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${streamer}

Thanks a lot, that’s solved my problem. The ?& was a typo but thanks for the explanation and clarification.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.