Atul Prasad
Atul Prasad

Reputation: 111

Is there a way to query the list of grafana dashboards

I have a requirement to list down all the dashboards available in the grafana server and list down all of them as a navigational list in my UI application. Is this even possible.

Upvotes: 10

Views: 11005

Answers (2)

Andrii K
Andrii K

Reputation: 21

https://<grafana>/api/search?type=dash-db

Upvotes: 1

CGS
CGS

Reputation: 2872

Grafana exposes a Search API which could be used to retrieve all the dashboards available

http://<HOST>:<PORT>/api/search?query=%

Sample Response:

[
   {
      "id":2,
      "title":"Dashboard1",
      "uri":"db/Dashboard1",
      "type":"dash-db",
      "tags":[

      ],
      "isStarred":false
   },
   {
      "id":1,
      "title":"Service-Dashboard",
      "uri":"db/Service-Dashboard",
      "type":"dash-db",
      "tags":[

      ],
      "isStarred":false
   }
]

The response has a field by name uri which has the relative path from which the dashboard path can be constructed as

 http://<HOST>:<PORT>/dashboard/<uri>

Upvotes: 15

Related Questions