Extract any data from dashboard though api

Hello,

I want to check if it is possible to get any data from any dashboard through the http api of grafana.

Currently, I can get all the metadata json for a dashboard with a curl :

curl -k -H "Content-Type: application/json" -H "Authorization: Bearer ${GRAFANA_TOKEN}" -X GET https://${GRAFANA_URL}/api/dashboards/uid/${DASHBOARD_UID}

But I need to apply a timerange to this dashboard and just check there is any data.

I can’t use the grafana interface, because I need to automate this test. Do you know how it is possible ?

Thanks !

That API gives you only dashboard model (not data), so you need to parse that model find which datasources are used, build the queries and then you can run those queries via datasource api:

OK, thanks ! So I will do as you say, thank you.