← all posts site ↗

the health data pipeline problem

i have health data scattered across a decade of devices and apps. whoop for recovery and sleep, macrofactor for food and nutrition, a zepp amazfit band before that, google fit sometimes, and health connect on android tying some of it together. the problem is there's no unified way to query all of this. home assistant can see some aggregate sensors like weight and heart rate through the companion app, but it can't pull individual food entries or workout sessions. i want to be able to ask questions like how does my eating pattern differ on weekends versus weekdays or do i train differently before a trip.

macrofactor was the holy grail because it has detailed food logs and workout data, but they enabled firebase app check which blocks programmatic access. there's a reverse-engineered client that uses the firebase backend, but it can't get past app check without a token from a real device, and even those expire after about a week. the android emulator approach doesn't work because macrofactor's app uses play integrity checks. proxy sniffing is also dead because the app pins its firebase certificates. getting a refresh token once and automating forever is simply not possible right now.

the practical path forward is less elegant but actually works. macrofactor has an official data export for food logs and workouts, which is the cleanest route for exact meal data. whoop has a real oauth api for recovery, sleep, and workouts that just needed one re-auth to fix the token expiration. an existing android app called health data export can dump nutrition records and exercise sessions from health connect to csv, which lets me audit what data is actually available before building anything. if health connect has rich enough data, a thin sync bridge from phone to server makes sense. if not, each source gets its own import path into a postgres database that can be queried directly for cross-factor analysis. the goal is actual historical analysis, not another dashboard.