I have many (up to 2000) repository names. I need to know the number of stars in each of them. How to do this with the least amount of requests to the Github API? Not important version 3 or 4
Asked
Active
Viewed 151 times
1 Answers
0
Each time you seek to minimize the number of API calls, you might want to consider the GraphQL API v4, which is made to replace multiple REST requests with a single call to fetch the data you specify.
Example: hanksudo/githubstars
, which list repository stars and info through Github v4 GraphQL API
In your case, you would need to modify the query to get any repository whose name matches one of your list. See if a filter approach described here would apply.
J. Gerbershagen recommends in the comments to enter as search term "repo:xxx/yyy repo:fff/yyy
".

VonC
- 1,262,500
- 529
- 4,410
- 5,250
-
I can't figure out how to get multiple repositories in one request with their names like xxx/yyy – Андрей Jul 14 '19 at 10:56
-
Can anyone show me query example for getting more than one repo by list of owner/repo names? – Андрей Jul 15 '19 at 08:22
-
@J.Gerbershagen Your comment seems incomplete. Maybe you are still writing it? – VonC Jul 17 '19 at 10:52
-
just enter as search term repo:xxx/yyy repo:fff/yyy – J.Gerbershagen Jul 17 '19 at 10:57
-
@J.Gerbershagen OK. I have edited the answer to include your comment – VonC Jul 17 '19 at 11:11