Parsing influx data to api and paste result back into the database

Hello there!
My problem is probably simple but I cannot get my head around a solution.
In my Influx2.0 database I have two fields containing coordinates (Lng, Lat) which I need to handover to a local running API which gives me elevation- data (just one field containing a number). This result should then be put back in my database into the elevation- field at the same timestamp.
Is there a way to do this with telegram or should I use the python-client? And is there a way to limit the request to certain times? I have coordinatedata every 0.5 seconds, this would be way more dense than I need.

Edit: This is the response I get from the API, simple JSON:

{
“results”: [
{
“dataset”: “eudem25m”,
“elevation”: 13.213644981384277,
“location”: {
“lat”: 53.458991,
“lng”: 9.981662
}
}
],
“status”: “OK”
}

Thank you very much!

Hi @hermann4,

You have a couple of options I can think of:

  1. Use execd processor plugin in Telegraf to send your readings to an external process that will query the elevation data and add it to the reading before it hits the output plugins

  2. Send the data as-is to InfluxDB, and use a Flux task to periodically fetch readings without elevation, call your API to get that data, and write it back to the database