Plugin to fetch data from API

Hi, I am new to grafana and i would like to develop a plugin to fetch cost related data using AWS cost explorer endpoint api. Requests (Queries) have to be made to this API in json format. How can i build a plugin to do this? Really appreciate your help here.

Thanks. :slight_smile:

I would suggest to checkout the simple datasource plugin tutorial.

I’m also new to grafana, typescript and react, but i made it to fetch from a corona data platform numbers in json format.

Hi Mudu, did you send a json request (query) to fetch the data ?

Yeah I configured a field for the data source for the city and used that option in a params object to get json data

async doRequest(query: MyQuery) {
const { where } = query;
const result = await getBackendSrv().datasourceRequest({
method: β€˜GET’,
url: someurl as string,
params: {
where: where,
outFields: β€˜*’,
outSR: β€˜4326’,
f: β€˜json’,
},
});
return result;
}

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.