Github API v3 doesn't show all user repositories

谁都会走 提交于 2019-12-02 22:34:50
Ian Stapleton Cordasco

The GitHub API uses pagination and defaults to 30 items per page. You will have to use

curl -i https://api.github.com/users/KiCad/repos?per_page=100

100 is the most number of items you can get on a single page. With -i specified you'll see headers printed out and the header you're looking for is the Links header. That will have links to help you navigate the pages. One of those links should look like

https://api.github.com/users/KiCad/repos?per_page=100&page=2

So if you do

curl -i https://api.github.com/users/KiCad/repos?per_page=100&page=2

You'll get repos 101-200. You can continue this until there is no next link in the Links header or until you realize you've received fewer than 100 results.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!