Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

261
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!