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.
EDIT: I tried scraping the cache using @neu242’s suggestion. It works on my local machine but it was difficult to get working on a cloud server. I eventually ended up using airpinpoint's API (they make your AirTag data available as an API endpoint).
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.
Disclaimer: You need macOS 14.3.1 or earlier for this to work. Items.data
is encrypted in 14.4 and later.