title: How to use GitHub V3 API to get commit count for a repo?
body: <p>I am trying to count commits for many large github <strong>repos</strong> using the API, so I would like to avoid getting the entire list of commits (this way as an example: api.github.com/repos/jasonrudolph/keyboard/commits ) and counting them.</p>
  
  <p>If I had the hash of the first (initial) commit , I could <a href="http://blog.notfoss.com/posts/get-total-number-of-commits-for-a-repository-using-the-github-api/" rel="noreferrer">use this technique to compare the first commit to the latest</a> and it happily reports the total_commits in between (so I'd need to add one) that way. Unfortunately, I cannot see how to elegantly get the first commit using the API.</p>
  
  <p>The base repo URL does give me the created_at (this url is an example: api.github.com/repos/jasonrudolph/keyboard ), so I could get a reduced commit set by limiting the commits to be until the create date (this url is an example: api.github.com/repos/jasonrudolph/keyboard/commits?until=2013-03-30T16:01:43Z) and using the earliest one (always listed last?) or maybe the one with an empty parent (not sure about if forked projects have initial parent commits).</p>
  
  <p>Any better way to get the first commit hash for a repo?</p>
  
  <p>Better yet, this whole thing seems convoluted for a simple statistic, and I wonder if I'm missing something. Any better ideas for using the API to get the repo commit count?</p>
  
  <p>Edit: This <a href="https://stackoverflow.com/questions/15919539/github-api-how-to-efficiently-find-the-number-of-commits-for-a-repository">somewhat similar question</a> is trying to filter by certain files (" and within them to specific files."), so has a different answer.</p>