Grafana API – Export Graph as png file

1. Create your API Key

– click on the grafana icon at the top left corner and go to Admin (Main Org.) -> API Keys
– add a new key. example: name=export role=viewer
– then you receive your api key (eyJrIjoieDRzbjh6R1__APIKEY__joiZXhwb3J0IiwiaWQiOjF9)

2. get the graph url

– click on the name of the graph which you want to export to a png file

– select share and copy the url of the „direct link rendered image“ link


3. put together your export command

curl -H „Authorization: Bearer eyJrIjoieDRzbjh6R1__APIKEY__joiZXhwb3J0IiwiaWQiOjF9“ „“ > filename.png

now you can execute your own command and your png file is getting saved to your directory

grafana export png


7 Kommentare zu „Grafana API – Export Graph as png file“

    1. I found this request:
      I tried to export the whole dashboard as a png but i couldn’t find the option for it. If you share the panel you can export it as a image, but at the dashboard export options it is exactly the same mask but there is no link to export it as a image. Maybe i should try to update grafana to get the new commit.

  1. curl -H “Authorization: Bearer eyJrIjoieDRzbjh6R1__APIKEY__joiZXhwb3J0IiwiaWQiOjF9” “” > filename.png

    where to execute the above command?

    1. You can delete my last comment. I did not look clearly enough, I now found the correct link. Bottom left there is the „Direct link rendered image“

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.