Is there a way to access your own AirTag data via API?

16.2k Views Asked by At

I'm wondering if there's a way to query your own AirTags directly from a server. In other words, you could ask for the current location of your items outside of the Find My app (or any other iOS app).

The use case is to build an automated reminder system to tell me when to move my car for street cleaning (I live in Brooklyn). There's an AirTag in the car, and the idea would be to notify me anytime it's parked somewhere where street cleaning will start soon.

2

There are 2 best solutions below

0
Michael Hulet On BEST ANSWER

There currently is not for Apple's AirTags, and my understanding is that there isn't one coming, though if you have a dev kit that supports BTLE and Ultrawide hardware, you can use it with CoreLocation and/or the Nearby Interaction framework

3
neu242 On

If you have a mac running macOS Monterey and have FindMy.app open, it will update its cache with the position in $HOME/Library/Caches/com.apple.findmy.fmipcore/Items.data. Here's a snippet to fetch latitude, longitude and time using jq:

jq -r '.[] | select(.name == "YourTagName") | .location | "\(.latitude) \(.longitude) \(.altitude) \(.timeStamp/1000 | todate)"' \
   $HOME/Library/Caches/com.apple.findmy.fmipcore/Items.data

Here's how I convert that to GPX: https://gist.github.com/henrik242/1da3a252ca66fb7d17bca5509a67937f

You'll still need to match that with street cleaning positions and generate an alert somehow, though.