Twitch Viewer No Longer Works [JS]

Ideally you also need to move off v5/kraken as kraken is depreacted

(If you are sticking with kraken you also need to convert the usernames to userID’s first)

For Helix this means you’ll need to use

and

To get the data you are after, and you can look up all the users in a single request.
But this also means you need an oAuth token as all of Helix requires a token.

A token cannot easily be used/obtained in the front end, which means you won’t be using getJSON unless you logged the user in to your program first.

I anticipate this tool you have is for displaying status on a website, which means the website should be doing the lookup on the backend via “server code”, which won’t be jQuery’s getJSON doing the call.

If that is the case then you’d probably also want to look at Webhooks instead

https://dev.twitch.tv/docs/api/webhooks-guide

So that Twitch will tell you when a stream starts/stops and you can store that in your database, and your website displays from the database instead