Curious about trending repos calculations #163970
-
Select Topic AreaQuestion BodyI am curious how the trending repositories are calculated. Given a specific language, the amount of stars required to reach trending seems kind of random. There are also repos on the list currently that only have 1 star added today. A project I maintain (https://github.com/LizardByte/Sunshine) has received 19 stars today (since midnight) according to the webhooks we get on Discord for that event. That's not too different from the amount we get on a normal basis, but based on these numbers we should be near the top of the list. So I'm curious what else plays into the calculations. Perhaps it's including a difference from the daily average or something along those lines? If that's the case, it would be impossible to hit the trending charts unless you significantly outperform the normal stars added? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
|
Hey @ReenigneArcher! Great question - the trending repos algorithm has always been a bit of a mystery, and you're definitely not alone in wondering about this! From what I've observed and what others in the community have discussed, GitHub's trending algorithm isn't just about raw star count for the day. It seems to be much more nuanced than that. Here's what likely factors into it: What I think influences trending:Stars vs. velocity ratio - Like you mentioned, it probably compares your current star gain against your historical average. A repo that normally gets 2 stars/day getting 10 stars would have a higher "trending score" than a repo that normally gets 50 stars/day getting 60. Engagement beyond stars - Forks, issues opened, PRs, comments, and general activity probably all play a part. GitHub wants to surface repos that are genuinely buzzing with activity, not just getting starred. Time weighting - Stars gained earlier in the day might be weighted differently than recent ones, or there could be some rolling window calculation. Community size normalization - Popular languages like JavaScript might need higher thresholds than niche languages. Repository age/maturity - Newer repos might get a boost, or conversely, established repos might need to show more significant growth. The fact that repos with just 1-2 stars today are trending while your project with 19 stars isn't definitely supports the "deviation from normal" theory. Your project probably has a steady, healthy star growth rate, so 19 stars might not be considered "unusual" enough to trend. GitHub hasn't published the exact algorithm (probably to prevent gaming), but the community has done some interesting analysis on this. You might find some insights in discussions on places like Hacker News or dev.to where people have tracked their trending patterns. Have you noticed any correlation with other activity on your repo when you do hit trending? Like major releases, being mentioned somewhere, or increased fork/issue activity? |
Beta Was this translation helpful? Give feedback.
-
|
yes you can solve it |
Beta Was this translation helpful? Give feedback.
-
|
Its by a project's recent growth in popularity, not just its total number of stars. This means that a project gaining a lot of new stars and engagement in a short period is more likely to trend than an older project with many stars but less recent activity. |
Beta Was this translation helpful? Give feedback.
-
|
The star count needed to trend isn't random, but it's relative to other repos in the same time window and language, not an absolute threshold. So it fluctuates based on what's hot at the moment. |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.

Hey @ReenigneArcher! Great question - the trending repos algorithm has always been a bit of a mystery, and you're definitely not alone in wondering about this!
From what I've observed and what others in the community have discussed, GitHub's trending algorithm isn't just about raw star count for the day. It seems to be much more nuanced than that. Here's what likely factors into it:
What I think influences trending:
Stars vs. velocity ratio - Like you mentioned, it probably compares your current star gain against your historical average. A repo that normally gets 2 stars/day getting 10 stars would have a higher "trending score" than a repo that normally gets 50 stars/day getting 60.
Engag…