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

impossible to find more than 1000 repositories #186

Open
yegor256 opened this issue Mar 4, 2024 · 3 comments
Open

impossible to find more than 1000 repositories #186

yegor256 opened this issue Mar 4, 2024 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@yegor256
Copy link
Owner

yegor256 commented Mar 4, 2024

At the moment, there is a limitation in GitHub API: "search" can only retrieve up to 1000 repositories. Let's find a workaround, so that we can find more than 1000. See https://stackoverflow.com/questions/37602893/github-search-limit-results

@yegor256 yegor256 added the bug Something isn't working label Mar 4, 2024
@howcanunot
Copy link
Contributor

I would suggest adding the created={year}-01-01-01..{year}-12-31 parameter to the api query.
and starting from the current year (in descending order) make requests to the api
for example:

curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer {token}" \
  "https://api.github.com/search/repositories?q=language:Java+is:public+mirror:false+created:2021-01-01..2021-12-31+stars:400..10000" | grep 'total_count'

we will get "total_count": 203 which < 1000
Eventually, iterating by year and then by page we can get >1000 repos

@howcanunot
Copy link
Contributor

@yegor256 can i try to code this, please?

@yegor256
Copy link
Owner Author

@howcanunot sure, go ahead!

@yegor256 yegor256 added the help wanted Extra attention is needed label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants