21

I would like to add a badge that counts the total number of downloads that happen for one of my projects that I have on GitHub. I came across this page that has all the image shields

https://shields.io/

![Github Releases](https://img.shields.io/github/downloads/atom/atom/latest/total.svg?style=plastic)

Any ideas on how I could add this to my project in GitHub?

JJJ
  • 32,902
  • 20
  • 89
  • 102
joesan
  • 13,963
  • 27
  • 95
  • 232

2 Answers2

35

You have to insert it as an image into your README. If your README is markdown (README.md) that should be like:

Syntax:

[![Github All Releases](https://img.shields.io/github/downloads/<-- User Name-->/<-- Your Repo Name-->/total.svg)]()

 Example

[![Github All Releases](https://img.shields.io/github/downloads/atom/atom/total.svg)]()

If you click on the badge on shields.io you can copy-paste markdown syntax you need to insert into README.md

Kishan Donga
  • 2,851
  • 2
  • 23
  • 35
Dmitriy Budnik
  • 1,467
  • 13
  • 22
  • 2
    How does it count the downloads of my project that I have on GitHub? – joesan Aug 14 '17 at 12:02
  • 1
    I did in fact add it to my README, but it shows a total download of 755k which is not true for my project! – joesan Aug 14 '17 at 12:03
  • 6
    oh, sorry, you have to replace `atom/atom` with your username/project_name – Dmitriy Budnik Aug 14 '17 at 12:30
  • 4
    Hi @DmitriyBudnik , My badge show zero downloads, even though people have downloaded it. Any idea why? – rafa.pereira Jul 02 '19 at 13:41
  • 6
    It depends on way you distribute your software. I guess it only counts downloads of packaged releases e.g. .zip files. Please refer to shields.io page: https://shields.io/category/downloads for details – Dmitriy Budnik Jan 07 '20 at 16:30
4

Check out PePy for receiving the download count of your repository and the code for your badge. Here's an example:

https://pepy.tech/project/video2tfrecord

whiletrue
  • 10,500
  • 6
  • 27
  • 47