The WSPR message from the WSJT-X UDP broadcast has a lot of data. I reprinted the WSPR section below.
There are numerous examples of code available (search with Google) to convert the Grid Square to lat/long and with some math to bearing and distance.
Here is a link to Node-Red, it runs on many platforms: https://nodered.org
Here is a link to the Node-Red WSJT-X decode node: https://flows.nodered.org/node/node-red-contrib-wsjt-x
All of the WSJT messages are decoded and presented as JSON objects. Makes the WSJT-X messages easy to use in other applications.
There are several methods to convert grid square to lat/long. Here is one of many: https://ham.stackexchange.com/questions/6462/how-can-one-convert-from-grid-square-to-lat-long
Here is a link to the math and coding for calculating bearing and distance from two lat/long coordinates: https://www.movable-
Here is a link to a Node-Red based World Map you can plot the results on: https://flows.nodered.org/node/node-red-contrib-web-worldmap
WSPRDecode Out 10 quint32
* Id (unique key) utf8
* New bool
* Time QTime
* snr qint32
* Delta time (S) float (serialized as double)
* Frequency (Hz) quint64
* Drift (Hz) qint32
* Callsign utf8
* Grid utf8
* Power (dBm) qint32* Off air boolUDP message