Search code examples
node.jsrequestbatch-processinggithub-api

Is it possible to make batch requests on the github api?


I want to be able to get an array of users for a series of repositories. As far as I know, the only way to achieve that is to loop through the repositories and make a request for each. Unfortunately, this eats up my api-hit-count, which is limited to 5000/hour. Is there a way that I can pass up an array of repositories, and get an 2d array of JSON?

Note: I'm writing this using node.js

Current situation

for( var iRepo=0; iRepo<repos.length; ++iRepo )
    request(repo.stargazers_url, parseUserCallback )

I want to do

request( batchEndpoint, {repos:repos}, parseRepoUserMapCallback )

This seems like something that could be solved with a simple google search, but searching for anything with "GitHub" in it just brings up various repositories.


Solution

  • Sadly, GitHub's API documentation has no signs of any form of batch operations for this endpoint.

    So you might want to do caching or figure out something else.