Reputation: 3377
What is the GitHub API endpoint that provides the info on the TOTAL number of repositories a user has access to?
I don't just mean repos that the user owns, or repos the user has as public, I mean ALL repos. Basically, the same list that user would see when browsing the repos on GitHub.com when logged in.
I know how to get a list of those, but that's limited to 100 at a time. Is there an API endpoint that would simply return the TOTAL number of them, without my having to retrieve all of them and count?
Upvotes: 5
Views: 2952
Reputation: 1329092
Only the GraphQL API v4 would allow such a query with a "total number" request.
You can test queries in developer.github.com.
The query using repositories is only for repos accessible by a user, not for all GitHub repos. (RepositoryConnection
)
query {
viewer {
repositories(isFork: false) {
totalCount
}
}
}
But for all repositories, you would need to use Google BigQuery GitHub Data, which you can start exploring though dataset/bigquery-public-data:github_repos
.
Upvotes: 5