How do I get a png of a dashboard graph via the API / render?

  • What Grafana version and what operating system are you using?
    v.7 on Unix

  • What are you trying to achieve?
    I’m trying to use the API to get a rendered PNG image of a dashboard.

  • How are you trying to achieve it?
    I’ve searched through tons of posts to see how to do it with and none of the following has been working:

curl "" > testdemo.png
curl "" > testdemo.png
  • What happened?
    Both download the png file but it is unopenable. I tried on MacOS and Unix. If I try to open the above links through a browser, it returns a failed to render error.

  • What did you expect to happen?
    I expected it to be an image of the dashboard.


Firstly, generate an API KEY since interface admin Grafana then copy the key (also you can define a timelife).
Secondly, try this command for a curl localhost or replace localhost by your ip address;
curl -o NameOfYourDashboard “https://localhost:3000/render/dashboard/db/DashName?orgId=x&width=2000&height=1500&kiosk=tv” -H “accept: application/json” -H “Authorization: Bearer YouAPIKEY”
Replace the orgId=x by your real orgId and play with width and height for the dimension of you dashboard.

Careful this doesn’t work on Grafana 8.

This topic was automatically closed after 365 days. New replies are no longer allowed.