Template to convert REST API call response to sensor

This Netdata REST API call returns this JSON, but I simply cannot figure out how to extract this with a template.

Can anyone help, please?

http://192.168.70.17:19999/api/v1/data?chart=powersupply_capacity.BAT1&points=2
{
 "labels": ["time", "capacity"],
    "data":
 [
      [ 1615386996, 98]
  ]
}

I guess you are interested in the “capacity” value? Try

{{ value_json.data[0][1] | float }}

Yes, sorry, and that is so obvious now.

Many thanks :grinning:

1 Like