-
Notifications
You must be signed in to change notification settings - Fork 5
Twitch
Giorgio edited this page Oct 14, 2021
·
2 revisions
Twitch lets you see if your friends are currently streaming, or if they are watching someone else's stream.
To get the list of online friends and their current activity, twitch uses a Graphql API.
You can see a list of things twitch uses GQL for by opening the Network tab of the Chrome DevTools and opening any twitch stream.
For online friends specifically, here is the endpoint the plugin uses:
POST https://gql.twitch.tv/gql
Headers:
Client-Id: kimne78kx3ncx6brgo4mv6wki5h1ko
Authorization: OAuth <auth code>
Body:
'[{"operationName":"OnlineFriends","variables":{},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4fecfced6ce413ffa2eee3c6ce09cddd8fb251763c594c26fba5108cf2b92e69"}}}]'
That being said, twitch presences tend to have a huge delay. During testing I've had twitch say that I was still watching a stream 10 minutes after I had closed the tab.