Get current viewer usernames

Hi all,

Maybe I am looking over the part where I can find this, but is there some way to get the current viewers their usernames or just their id’s?

Thanks in advance,
Lars

The only way (i know) to get the viewernames is to use an IRC client.

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

2 Likes

Thanks for your answers!

@Persil Thanks for the url, it’s great for development and I can continue with this.

Only I saw something weird regarding this list. It seems to fill itself only with viewers who have the correct privileges to talk in that channel. I encountered this while watching a stream today and my name didn’t show in the list. Seemed like I needed to connect my FB account to my user (to be able to chat at all on that specific channel). But even after connecting my FB account my account did not show up in the list. Could there be another reason or do we have some docs which actually state what this list contains or when you show up in this list?

Want to know what the impact could be, if this has a discrepancy of like 10% it doesn’t seem very reliable if you want to build a service around this call.

Thanks in advance,
L

You can only get the names of people in the chat, not the names of all viewers, since viewers don’t always have a name. The URL Persil provided does exactly that.

Allright so the only viewers that are filtered out are the not logged in twitch guests?

Exactly.
That link will only provide a list with the users who are logged in.

… And connected to the chat. If viewers are having chat connection troubles or watching an embedded or pop-out stream without being connected to the chat, they won’t show up.

Also note that the chatters API is undocumented (may change without notice), and it may be subject to caching and/or delays.

I’m sorry, but i don’t exactly understand how to implement the use of the website that persil provided, can somebody give me some insight?

The URL returns a JSON. Read up on how you can retrieve and parse them in your language and come back with questions in a new thread.

1 Like

thank you, I was able to figure out what to do with just the information that it returns a json

1 Like

Is this possible to have the cors headers on this endpoint so I can use it from the browser ? Thanks

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

It appears to support JSONP.