API: Available values for template variable?

I really like Grafana. Not so long ago i had several (~10) dashboards, one for every host and this looked fine.
Also, i’m writing a Telegram bot with Grafana HTTP API integration, getting list of dashboards by /api/search and list of panels by /api/dashboards/db/<host>, and this is also OK.

Our company grows, number of hosts also increases, and i started to use templating and variables. Templating is cool.

But… How can i get list of available values for variable by HTTP API? And also, i use graphite.

In example below (python), i can only get metadata and only current value of variable:

in [54]: list_template = r’http://%grafana%/api/dashboards/db/%dashboard%’
In [55]: req = requests.get(list_template, headers={‘Authorization’: …}).json()
In [56]: req[‘dashboard’][‘templating’]
{‘list’: [{‘allValue’: None,
‘current’: {‘text’: ‘prod-web-1’, ‘value’: ‘prod-web-1’},
‘datasource’: ‘graphite’,
‘hide’: 0,
‘includeAll’: False,
‘label’: ‘’,
‘multi’: False,
‘name’: ‘host’,
‘options’: ,
‘query’: ‘icinga2.*’,
‘refresh’: 1,
‘regex’: ‘/prod.*/’,
‘sort’: 3,
‘tagValuesQuery’: ‘’,
‘tags’: ,
‘tagsQuery’: ‘’,
‘type’: ‘query’,
‘useTags’: False}]}

I’m sorry, if i misposted or topic like that already existed (i tried to find!).

You can do this by executing the same query you specified in the template variable option. There is no api to for this as this query is executed by the frontend (browser).

You mean, send query to graphite-web port directly? Or GET /api/datasources/proxy/:datasourceId/*?

UPD: Ok, i got it, from /datasources/proxy/. At least, this doesn’t require admin-level API key!