Using JSON data in Traccar

WhitbyRog8 years ago

Hi Anton

This is really working well and we are looking to extend it's abilities using public JSON data.

As part of the local Mountain Rescue Team it would be great to know when our local Medical Helicopters were nearby or approaching. I have been trying to get the latitude and longitude of our helicopter by using the following url https://public-api.adsbexchange.com/VirtualRadar/AircraftList.json?fRegQ=G-YAAC this works well when G-YAAC is in the air. I then parse the data and format another url like this, http://*****.**********.net:5055/?id=GYAAC&lat=" + data.acList[0].Lat + "&lon=" + data.acList[0].Long + "&altitude=" + data.acList[0].Alt + "&speed=" + data.acList[0].Spd This then moves an icon in Traccar with identifier GYAAC.

I'm trying to understand how this works and it comes to me that I might be making a big job of it. My way had a couple of bugs which are harder to fix and it meant running it in a browser which is not really any good.

Is there a betterr way of doing this inside Traccar or do I have to find a better way outside of Traccar?

Kind regards Roger

Anton Tananaev8 years ago

Traccar doesn't have a way to request the data, so your approach seems like the easiest option to import data into Traccara system.