Twitch Community Detection & Lead Generation

Riadh

Riadh

Twitch Community Detection & Lead Generation

When viewing a Twitch channel, you likely came across a "Viewers Also Watch" section on the left sidebar. It's a feature that displays a list of live channels that share a significant viewerbase with the one you are currently watching.
"Viewers Also Watch" section of the Rivenzi channel.
"Viewers Also Watch" section of the Rivenzi channel.
On top of that, Twitch users have the option to showcase other channels they think their community would enjoy by adding them to their "Suggested Channels" list under their profile.
"Suggested Channels" section of the Rivenzi channel.
"Suggested Channels" section of the Rivenzi channel.
Both of these features provide a way for viewers to discover new content and for streamers to promote channels they believe their audience would appreciate. Now, this begs the question: Can we leverage these features to map out a network of interconnected channels based on their viewership overlap and recommendations? Well, the answer is yes!
It turns out that, under the hood, Twitch provides a private GraphQL API endpoint that serves data needed by the web client whenever requested. By analyzing the requests made by the client, we can identify four specific persisted queries: MwebChannelAboutPage_Query, ChannelLayout, PersonalSections, and HomeShelfUsers. Respectively, these queries fetch information about a channel's about page (including social media links and panels), the channel layout (including featured channels), similar channels, and other metadata.
After intercepting the session authentication headers required for the subsequent GraphQL requests.
SESSION_HEADERS = {
"User-Agent",
"Client-Id",
"Client-Version",
"Client-Session-Id",
"X-Device-Id",
}

BASE_HEADERS = {
"Host": "gql.twitch.tv",
"Referer": "https://www.twitch.tv/",
...
}
We can recursively fetch neighborhoods of channels starting from a given origin channel while making sure to gather all the necessary information about each one along the way. This includes their login names, IDs, display names, descriptions, follower counts, social media links, and panels.
Once the network is built, standard community detection methods can be applied to identify clusters of related channels. In my case, I used the Clauset-Newman-Moore greedy modularity maximization algorithm, which was already implemented courtesy of NetworkX.
The result can then be visualized using tools like VisJS to gain insights into the relationships between different Twitch channels and their communities.
Network visualization. Gray edges for similar viewership, red edges for featured channels.
Network visualization. Gray edges for similar viewership, red edges for featured channels.
These pre-identified clusters can be invaluable for various purposes, such as targeted marketing campaigns, content recommendations, and community engagement strategies.
Like this project

Posted Oct 25, 2025

Built a large network of Twitch channels based on viewership overlap and recommendations for community detection and social analysis.

Likes

0

Views

0

Timeline

Oct 2, 2025 - Oct 4, 2025