Finding the download count of GitHub releases
October 16, 2015 [Programming, Tech]You can use the GitHub API to find out how many times the files in your releases have been downloaded.
For example, to find out how many downloads there have been of my Rabbit Escape project you can do:
curl -s https://api.github.com/repos/andybalaam/rabbit-escape/releases | egrep '"name"|"download_count"'
Or you can look through the information manually by visiting a URL like https://api.github.com/repos/andybalaam/rabbit-escape/releases in your browser.
To get the total I came up with this beautiful incantation:
curl -s https://api.github.com/repos/andybalaam/rabbit-escape/releases | egrep 'download_count' | cut '-d:' -f 2 | sed 's/,/+/' | xargs echo | xargs -I N echo N 0 | bc
Comments
Andy Balaam 2017-04-10
Zmn, thanks – it looks useful, but I would definitely like the projects to be sorted in descending order of downloads – I have a lot of zeroes…. :–)
Zmn 2017-04-10
Great, It’s nice you find it useful. I’m planning to improve usability and add some features… I’m working on it, stay tuned !
Sarita 2021-04-20
Hi. I’m trying to use your total command on osx but I get an error:
(standard_in) 1: illegal character: N.
Any suggestion? thanks
Andy Balaam 2021-04-20
Hi Sarita, it looks like xargs works differently on your platform. I’m afraid I don’t know what to do to fix it.
Daniel 2025-08-13
Have a look at the following website, it shows detailed Github release stats: https://github-release-stats.ghostbyte.dev/
Zmn 2017-04-01
Can I suggest this app to list all stats about your repository? http://github-analytics.apphb.com/
Disclaimer: I’m the owner of the application. Please share your opinion about it.