Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

121
Visualizações
Github API returns inconsistent results for top 3 starred repositories

I am trying to get the top 10 repositories based on their stars using this API query:

https://api.github.com/search/repositories?q=stars:>0&sort=stars&per_page=3

The result is not consistent.

The first time I call the top 3 repositories, I get:

  1. freeCodeCamp/freeCodeCamp 342K
  2. EbookFoundation/free-programming-books 225K
  3. vuejs/vue 194K

After 1 minute, I get totally different results:

  1. freeCodeCamp/freeCodeCamp 342K
  2. 996icu/996.ICU 261K
  3. jwasham/coding-interview-university 212K

Why does it differ? Is there anything wrong with my API endpoint?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

First of all, you are using the right endpoint, see https://docs.github.com/en/rest/reference/search#search-repositories

The API docs page says:

The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results.

The GitHub website lists the top repositories under https://github.com/search?q=stars:%3E1&s=stars&type=Repositories as:

  1. freeCodeCamp/freeCodeCamp
  2. 996icu/996.ICU
  3. EbookFoundation/free-programming-books

I get the same result when I use the parameters and run the following query in the browser, using the same parameters as on the website above:

https://api.github.com/search/repositories?q=stars:%3E1&s=stars

Note: I am not sure about the s parameter. Either s is short for sort or it is not used at all, as the result may already be sorted.

I cannot answer why the API returns different results for you.

about 4 years ago · Juan Pablo Isaza Relatório

0

I modified the api little bit ,

https://api.github.com/search/repositories?q=stars:>=10000&sort=stars&order=desc

and I am getting consistent results like this;

1.freeCodeCamp/freeCodeCamp 
2. 996icu/996.ICU
3. free-programming-books
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda