SumNeuron
SumNeuron

Reputation: 5188

GitHub Api: list of all repos with a given language

Yes, there is this question:

Github API: How to get all repositories written in a given language

however the answer provided only returns 100 results.

So how can I get the list of ALL repositories for a given language,

e.g. for Mathematica

curl https://api.github.com/search/repositories?q=language:mathematica

says there are 8000+ items that I should get, but this returns only top 30...

I have tried since

Upvotes: 0

Views: 688

Answers (1)

SumNeuron
SumNeuron

Reputation: 5188

As suggested by @Bertrand Martel adding

&page=<page>&per_page=100

works.

You just have to request page 1 with 1 result per page to get total results, and then iterate over pages as needed.

Upvotes: 1

Related Questions