Finding the download count of GitHub releases

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

5 thoughts on “Finding the download count of GitHub releases”

  1. 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…. :-)

  2. 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 !

  3. 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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.