The list-user-repositories API (V3) doesn't return all the repositories #24396
-
I’m trying to use /v3/repos/#list-user-repositories in one of my open source projects, prahladyeri/gh_announce. The problem is that this API doesn’t seem to return all the repos a user has, but only the first 30! And I couldn’t find this behavior documented anywhere. Here is the offending part of the code:
The API URL I’m trying to fetch data from is https://api.github.com/users/<username>/repos which is exactly as documented here. Why then, the above call returns only 30 repos when I try with my own user as example, when I have 34 repositories in total? Is this a limitation of the API? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @prahladyeri, Thanks for being here! It’s most likely that you are not seeing all your repositories due to pagination. Most calls only return 30 records at a time, this can be increased to 100 via a Give http://developer.github.com/v3/#pagination a read through and see if retrieving subsequent pages works out. I hope this helps! |
Beta Was this translation helpful? Give feedback.
Hi @prahladyeri,
Thanks for being here! It’s most likely that you are not seeing all your repositories due to pagination. Most calls only return 30 records at a time, this can be increased to 100 via a
per_page
attribute, but if you have more than 100 you will need to request every page and store the whole list.Give http://developer.github.com/v3/#pagination a read through and see if retrieving subsequent pages works out. I hope this helps!