Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

269
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda