While building https://www.amitmerchant.com/your-first-commit-ever/, I needed to retrieve the oldest commit of a GitHub user. This endpoint along with a few filters through the query parameters would return a response consisting of the oldest 30 commits.
As you can tell, the first query parameter q with author targets the specific GitHub user for whom you want to retrieve the commits.
function fetchUserCommits(user) { $.ajax({ url: "https://api.github.com/search/commits?q=author:" + user + "&order=asc&sort=committer-date", type: "get", headers: { 'Accept': 'application/vnd.github.cloak-preview' }, dataType: 'json', success: function (data) { console.log(data); }, error: function () { console.log('No GitHub user is available of this username.'); }}); }
And from here, you can pick the oldest commit by using data.items and retrieve all the important detail about that commit like commit date, commit repository, commit message, and so on.