wiedehopf / tar1090

Provides an improved webinterface for use with ADS-B decoders readsb / dump1090-fa
Other
1.28k stars 240 forks source link

API for JSON data? #115

Closed lance closed 3 years ago

lance commented 3 years ago

Hi - this is not really an issue, per se. But I have a feed running that I would like to pull data from. I looked around on this repo and did not find anything that looks like API documentation. What is the best way to access the JSON data feeding the app? Thanks.

wiedehopf commented 3 years ago

This does not produce any data, it works with dump1090-fa or readsb.

Example readme for readsb: https://github.com/wiedehopf/readsb/blob/dev/README-json.md

Or are you asking how to get an URL? Just check your browser which json files it's loading in the dev console network tab.

virtadpt commented 3 years ago

You can get data from http://your-sensor-host/tar1090/data/aircraft.json.

lance commented 3 years ago

Thanks!

2ashishs commented 2 years ago

Is there a way to save the aircraft.json data? I want to save the data displayed in web-ui of tar1090. With dump1090-fa I was using the -write-json option. I haven't been able to figure out the same with readsb or tar1090.

wiedehopf commented 2 years ago

tar1090 is only a web interface .... typically used with decoders readsb / dump1090-fa. readsb has the --write-json option just the same as dump1090-fa. Anyhow it'll keep overriding the same file so it's limited in usefulness ....

I'm not quite sure what you want, locally the aircraft.json is located in /run/readsb/aircraft.json ... no need to change that from the default service settings.

virtadpt commented 2 years ago

That data can be pulled via HTTP from http://your-ADSBx-node/tar1090/data/aircraft.json

No need to write code to access it locally.

2ashishs commented 2 years ago

@wiedehopf / @virtadpt, basically I want to create a database of planes flying over my location.

Earlier, using dump1090-fa with --write-json "target-dir" option, I got historyN.json files in the "target-dir".

Now with readsb, I would like to save historyN.json files and combine that data with the aircraft info (aircraft-type, country of origin, etc), available in the tar1090 UI.

I tried adding --write-json option in _JSONOPTIONS of /etc/default/readsb, but that did not work.

Thanks.

wiedehopf commented 2 years ago

The historyN.json aren't useful, they get overwritten constantly after half an hour i believe. Not sure what you want with them.

Anyhow ... something like that is better solved in whatever script / program your using. You can build with dpkg-buildpackage -b --build-profiles=rtlsdr,history --no-sign -d if you really need those history files ....

virtadpt commented 2 years ago

Poll the aircraft.json file once a minute or so, deduplicate entries, and add them to your database. That's what I do.

2ashishs commented 2 years ago

Thanks @wiedehopf and @virtadpt !