Github-Ranking
Github-Ranking copied to clipboard
Some repos may be not included in top stars by mistake
So many projects are ignored
Now I use these three API to get most stars or forks repository:
Most stars:
https://api.github.com/search/repositories?q=stars:>0&sort=stars&per_page=100
Most forks:
https://api.github.com/search/repositories?q=forks:>0&sort=forks&per_page=100
Most language stars (e.g., Python):
https://api.github.com/search/repositories?q=language:Python&stars:>0&sort=stars&per_page=100
And freeCodeCamp
is the most stars repo, datasharing
is the most forks repo, system-design-primer
is the most Python stars so far.
Sometimes these apis just not return right repos (some repos may be left out).
For example, now I get most Python stars repo is public-apis
, but when I try again it maybe return right repos (maybe not).
You can try it by yourself to see this issue.
I don't know why this happens so far.
But I will try to fix this issue in the future and update here.
#3 #6 #8
An example of this issue I found is https://github.com/sindresorhus/awesome
Since 2021-08-20 commit I have changed the query method from Github REST API v3
to Github GraphQL API v4
. It seems like this issue doesn't reappear.
Still there are many repos that are not listed in the list. A simple comparison between https://github.com/search?q=stars%3A%3E30000+language%3APython&type=Repositories&ref=advsearch&l=Python&l= and https://github.com/EvanLi/Github-Ranking/blob/master/Top100/Python.md
I find that when I query the GraphQL API, sometimes it just returns the wrong results.
Here is an example, you can try it yourself on GraphQL API Explorer
query{
search(query: "language:Python stars:>0 sort:stars", type: REPOSITORY, first:100) {
pageInfo { endCursor }
edges {
node {
...on Repository {
id
name
url
forkCount
stargazers {
totalCount
}
owner {
login
}
description
pushedAt
primaryLanguage {
name
}
openIssues: issues(states: OPEN) {
totalCount
}
}
}
}
}
}
I tried three times, here are the results:
All three times have different data.
I don't know why this happened yet, and I have no idea how to fix it. If anyone finds the solution, please tell me. Thanks!