Twitch chat, retrieving logged in Users in Chat

What my Scripts/bot do:
Give Viewers points for watching allowing them to do fun stuff with those points (like raffles, leaderboards etc.).

I have an IRC bot sending a WHO request to the irc server to retrieve the logged in users, send that to my webserver to check if the stream is running and award points to the viewers.

The WHO command seems to be quite unreliable and depending on which jtvirc server you are connected to. (I also got different results when sent from mirc or bot). I’m going to rewrite the system to use JOIN/PART and a combination of WHO to minimize the WHO requests, but I’d like to ask if there is a better way to accomplish this.

Thanks in advance, Dobs

This is UNOFFICIAL and could change at any time

https://tmi.twitch.tv/group/user/:channel/chatters

Also, the JSON object will be empty if the stream is not active.

Ty, that is really helpful, i hope this stays in!

thx again.

Just a quick question about this endpoint: When I send an xhr request just trying to do a GET, I get a CORS error. Has something changed with the API or am I supposed to be retrieving the data a different way? Thanks.

CORS is not supported on “non” API endpoints

Is there an API endpoint that allows an application to retrieve total users in chat then? I can’t see to find anything in the docs. Also, what is the appropriate way of using the /chatters endpoint if you are not able to make GET requests to it?

Theres no API endpoint for that.

You can make requests to the TMI url, just you can’t use CORS to do so.

Okay thanks.