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

267
Visualizações
How to find the 'm' oldest forks of a repository using GitHub api

I need to obtain the 'm' oldest forks of a given repository, using the GitHub API. To get the 'm' oldest forks I'm trying to obtain the forks sorted from oldest to newest.

Taking the example of "it-cert-automation-practice" repository of google, I've tried the following APIs:

https://api.github.com/repos/google/it-cert-automation-practice/forks?q=sort:created_at
https://api.github.com/repos/google/it-cert-automation-practice/forks?q=sort:oldest
https://api.github.com/repos/google/it-cert-automation-practice/forks?q=sort:updated_at&fork:true&order:asc
https://api.github.com/repos/google/it-cert-automation-practice/forks?q=sort:created_at&fork:true&order:asc
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can use List forks endpoint, take into account the following:

  • Use sort parameter with value oldest
  • If you want to list more than 100 repositories, you will need to handle pagination using the page parameter.

See a working example using Octokit for getting the oldest 40 forks of Node.js repository.

Get oldest forks of GitHub repository                                                                                 View in Fusebit
const owner = 'nodejs';
const repo = 'node';
const repoInfo = await github.request(`GET /repos/${owner}/${repo}`, {
  owner,
  repo,
});

const {forks_count} = repoInfo.data;

// By default it will return 30 results, you can get up to 100 using per_page parameter.
const searchResult = await github.rest.repos.listForks({
  owner,
  repo,
  sort: 'oldest',
  per_page: 40
});

console.log(searchResult.data.map(repo => `${repo.full_name} created at ${repo.created_at}`), `Found ${searchResult.data.length} of ${forks_count} total forks for ${owner}/${repo} repository`);


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