Is it possible to programmatically (or in machine-readable form) get location data from an AirTag?
Yes, it is possible to do so via a private API - however it is a bit of a &quot;hack&quot; as this is not officially supported by Apple.
You can find an open source implementation of using the private API here:
https://github.com/seemoo-lab/openhaystack/tree/main/OpenHaystack/OpenHaystackMail
Note that in order to use the private API, you'll need a specific entitlement for your app that is not available to third parties. This can be worked around by disabling GateKeeper, installing the program linked above as a plugin for Mail, enabling the plugin in Mail, and then re-enabling GateKeeper.