GitHub Search API only return 30 results

走远了吗. 提交于 2019-12-18 05:43:46

问题


https://api.github.com/search/issues?q=stress+test+label:bug+language:python+state:closed

the above query is suppose to return 76 results, and when I try to run it, it only returns 30. I guess GitHub return results in portions when it is over 30. Any idea how I can get the rest of the results?


回答1:


You need to use page parameter, e.g. for next 30 page = 2

https://api.github.com/search/issues?q=stress+test+label:bug+language:python+state:closed&page=2

You can also use per_page parameter to change the default size of 30. It supports max size of 100. Like this:

https://api.github.com/search/issues?q=stress+test+label:bug+language:python+state:closed&per_page=100

More detail can be found here



来源:https://stackoverflow.com/questions/30656761/github-search-api-only-return-30-results

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