3

Is there a way to get clone statistics of a github repository for any given month?

We have a Clones tab with stats for last 14 days https://help.github.com/articles/about-repository-graphs/#traffic but it would be interesting to look at the historical data.

hellpanderr
  • 5,581
  • 3
  • 33
  • 43

3 Answers3

4

No. Neither the GitHub UI (https://github.com) nor the GitHub API (https://api.github.com) expose that data currently.

jasonrudolph
  • 573
  • 3
  • 8
3

Yes you can get your clone statistics about a GitHub repository for a given month, but you need to download the statistics before they are no longer available on GitHub.

I wrote a couple of scripts that you can find: https://github.com/BradleyA/Linux-admin/tree/master/github-repository-traffic#github-repository-traffic------------- It is a very simple shell script that uses crontab to schedule the download of GitHub traffic statistics in plain text from your GitHub repositories. Another script gives you the text lines to add to crontab and sets up the directories for GitHub traffic statistics. It takes minutes to setup but weeks to get enough data. At this point you can process the data with any tools you wish. I created a third script that parses the GitHub traffic and creates two markdown tables (clone, Views).

It solves my challenge. It may help you.

Bradley Allen
  • 596
  • 5
  • 5
1

These days the github api does allow downloading traffic data. It is located under the metrics section.

Bart
  • 1,405
  • 6
  • 32
  • I navigate to the URL you linked and it says, _"Get the total number of clones and breakdown per day or week for the last 14 days."_ – jubilatious1 May 15 '23 at 14:14
  • @jubilatious1 Yes that is the data you can download. If you do that with a script every day you can get a full view your self. This is how I collected over two years' worth of data instead of just 14 days. – Bart May 16 '23 at 09:44
  • Okay, so nothing has changed from @BradleyAllen's 2020 post, since that user _also_ pulls data from `api.github.com`. Thank you. – jubilatious1 May 16 '23 at 19:13