Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some repos may be not included in top stars by mistake #9

Open
Giancarlo-Ma opened this issue Apr 27, 2021 · 5 comments
Open

Some repos may be not included in top stars by mistake #9

Giancarlo-Ma opened this issue Apr 27, 2021 · 5 comments

Comments

@Giancarlo-Ma
Copy link

Giancarlo-Ma commented Apr 27, 2021

So many projects are ignored

@EvanLi
Copy link
Owner

EvanLi commented May 6, 2021

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

@EvanLi EvanLi changed the title Not complete? Some repos may be not included in top stars by mistake May 17, 2021
@Wouterr0
Copy link

An example of this issue I found is https://github.com/sindresorhus/awesome

@EvanLi
Copy link
Owner

EvanLi commented Aug 21, 2021

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.

@m-yosefpor
Copy link

m-yosefpor commented Feb 1, 2023

@EvanLi
Copy link
Owner

EvanLi commented Feb 14, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants