Tool that generates a badge showing the download count for a Grafana dashboard

Hey everyone!

I’ve been working on a small project called Grafana Dashboard Badge

It’s a cool way to show off the popularity of your dashboards.

badge

What does it do?

  • The tool lets you input a Grafana username and dashboard name and it scrapes the Grafana website to get the download count.
  • The badge color adjusts depending on how many downloads the dashboard has, with different colors representing different download ranges.

The Issue:

Right now, when trying to access the badge URL, I’m getting an error: “Error retrieving data.” I suspect this might be because Grafana has some sort of bot protection in place, but I’m not sure what’s causing it exactly. If anyone has experience with this or knows how to work around it, I’d really appreciate your thoughts! :thinking:

How You Can Help:

  • If you’ve dealt with this kind of bot protection before or have any ideas on how to get around it, please let me know!
  • You can also try out the tool locally or check out the GitHub repo if you’re interested in contributing.

Here’s the link to the project if you want to give it a go or take a look at the code.

Thanks in advance, and feel free to reach out if you have any questions or feedback!

2 Likes

IMHO you have heavy implementation. You need a dashboard ID and then it is a simple query, e.g. dashboard ID 139:

https://grafana.com/api/dashboards/139

and returns downloads fields.

1 Like

I searched and found no documentation on this thank you! I’ll be able to update.

Works perfectly, thanks again! :partying_face:

That’s not official API = it can be changed anytime.

It works for me - my examples with links:

badge

badge

I think readme needs some cleaning, copy&paste html/markdown examples how it can be used, parameters for customization (text, color) and short time caching (e. g. 5min) to limit abuse of that unofficial API endpoint.

1 Like

Thanks again, I’ve made the updates. I have setup 15 minutes of cache, I don’t think Grafana updates the number of dashboard downloads more often than that anyway.

1 Like

Thank you. It looks better. What if you contribute this code to another bigger project?
IMHO GitHub - badges/shields: Concise, consistent, and legible badges in SVG and raster format is a good candidate. You can mimic options of Docker Pulls | Shields.io

Dashboard Downloads

2 Likes

Good idea!

Custom Grafana Dashboard Badge with Logo