Search code examples
github-api

How can I get issues since any number?


var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.github.com/repos/vuejs/vue/issues');
xhr.send();

with above code, I can receive top 30 issues list of vue project. But if I want to get top 30 issues whose issue number is less then 8000, how can I do it?

in the github v3 api doc,there are just a feature that allow you get issues since a time point.


Solution

  • One way using API V3 would be to traverse through the issues and find those that you want. In any case the call to the Issues API returns issues in descending order of the date of creation. Which means you just need to traverse through the issues to find the ones having issue number lower than 8000.

    In the particular case of vuejs/vue; You can increase the number of issues displayed per page to 100 and then find issues having number less than 8000 in the second page :

    https://api.github.com/repos/vuejs/vue/issues?per_page=100&page=2

    I feel this is a better option than using issue Search API (V3), since you do not have to deal with a very low rate limit of Github Search APIs.