Query data from Grafana's api "/api/ds/query"

Hi I am trying my luck in here if someone already implemented to query data from the grafana’s api?

/api/ds/query

I found in the forum someone already ask this on how to use it, unfortunately nothing answered it right. The documentation itself is pretty plain and don’t know how to use it. I’ve managed to send a POST request on the specific API however I get the ff error:

An error occurred within the plugin

On which I saw on the other forums, they have the same error too.
I hope someone here in the community had successfully query data using the api?

Datasource: Infuxdb
Grafana: v9.2.2

Thanks in Advance.

Thanks for bringing this up.

So from the Network console it uses the
http://ipaddress:port/api/datasources/proxy{datasourceId}

where datasourceId is the id of the datasource in grafana.

What it does it simply proxy the API endpoint of any datasource.
I don’t know why the /api/ds/query still doesn’t work. But the proxy thing does the job I want.

If you take a look at those calls made in the browser, there’s a cookie with authentication IDs. If you want to make that call from an external application, you’ll need to authenticate the user first. Luckily it looks like the Grafana HTTP API supports requesting a bearer token which can be used to make calls like this

Take a look at the Grafana HTTP API docs: