Show online twitch from members on website

I just used some old PHP I had with some changes and created an example of what I think you are looking for.

What I do is query the teams endpoint for all members then use the list of ID’s (v5 only works with _ids, not usernames) on kraken v5 (so I don’t have to manually update an array every time the team adds/removes a new member) to pull data from the /streams/ endpoint, which will only show members who are currently live. This list is then dumped into a table with clickable links to the streamers. I have included the game and current title on the stream as well.

Check it in action at: http://twitch.apiexampl.es/teams-list.php
and you can see the source at http://twitch.apiexampl.es/teams-list.php.txt

Please ensure you use your own client_id as mine is just being used for an example.
You can peek at some of the other examples at http://twitch.apiexampl.es but be aware some might be dated/defunct at this time.

But I do see in your code you have a player showing, so I’m not entirely sure this is what you are looking for but I think the logic used might help you on your journey.

1 Like