Unlock your Apple Health data in 15 minutes: export, analyze & ask AI anything about it
Source: Dev.to
Extracting Apple Health Data – The Problem
Apple doesn’t expose a REST API for Health data, so if you want to analyse it (or let LLMs work with it) you basically have two options:
-
Use a third‑party app that leverages HealthKit and then sends the data to a server or cloud storage (Google Drive, Dropbox, …).
Examples: Auto Health Export (usually paid). -
Use Apple’s built‑in export.
- The export can take several minutes, is easy to interrupt, and must be repeated every day to stay up‑to‑date.
Why I Started This Project
I’ve been an Apple Watch user for 7+ years, and the friction of manual exports has always bugged me.
-
A few years ago I built Apple Health MCP with a small team – a proof‑of‑concept that connected wearable data to LLMs. It worked, got attention, but required users to manually export their data, which was too much friction.
-
The pain points above led to the creation of Open Wearables – an open‑source, self‑hosted platform that:
- Lets you export your data automatically.
- Provides backend, storage, and a nice UI to browse the data.
- Offers an AI layer (MCP server) that can connect the data to any LLM client.
It supports Apple Health and many other ecosystems (Garmin, Polar, Whoop, Suunto, …).
Who Is This For?
| Audience | What They Get |
|---|---|
| Developers | A middleware layer that handles provider integration, data normalisation, authentication, etc. |
| Individual users | A single place to store and explore their (or their family’s) wearable data. |
Quick‑Start: Get Your Apple Health Data into Open Wearables (≈ 15 min)
1️⃣ Run an Open Wearables Instance
You have two ways to get the platform up and running.
Option A – Deploy to Railway (easiest)
-
Click the Deploy on Railway button.
-
Wait a couple of minutes – Railway will spin up the backend, frontend, database, Redis, and background workers.
-
An admin account is created on first start‑up:
email: admin@admin.com password: secret123
Note: Railway is a paid SaaS (no permanent free tier). New users receive a one‑time $5 credit for a 30‑day trial; after that the cheapest plan is $5 / month (Hobby).
Option B – Run Locally + Expose with ngrok
# Clone the repo
git clone https://github.com/the-momentum/open-wearables.git
cd open-wearables
# Start everything with Docker
docker compose up -d
Because the mobile app must reach the backend over the internet, expose the local server:
ngrok http 8000
You’ll get a public HTTPS URL like https://abc123.ngrok-free.app. Keep it handy – you’ll need it later.
Tip: For a stable URL that doesn’t change on restart, use a custom domain:
ngrok http 8000 --domain=your-custom-domain.ngrok-free.app
2️⃣ Create a User & Invitation Code
- Open the Open Wearables dashboard (e.g.,
https:///dashboard). - Log in with the admin credentials (or any account you create).
- Create a new user for the mobile app.
- Generate an invitation code for SDK authentication.
- Copy the code – you’ll paste it into the mobile app next.
3️⃣ Get the Open Wearables Mobile App
The app connects to Apple Health on your iPhone and syncs data to your Open Wearables instance.
Option A – Build the App Yourself
# Clone the SDK repo
git clone https://github.com/the-momentum/open_wearables_health_sdk.git
cd open_wearables_health_sdk/example
# Install dependencies
flutter pub get
# Run on a physical iOS device
flutter run
- Open
ios/Runner.xcworkspacein Xcode. - Select your development team.
- Enable the HealthKit capability.
- Important: HealthKit works only on a real device, not the simulator.
Option B – Use a TestFlight Invite
- Join the Open Wearables Discord.
- Request a TestFlight beta invitation.
- Install the pre‑built app (free, App Store release coming soon).
4️⃣ Connect the App to Your Backend
- Open the app on your iPhone.
- Enter the invitation code you generated earlier.
- Enter the API URL (e.g.,
https://api.openwearables.aior your ngrok URL). Do NOT use the dashboard URL. - Grant the requested HealthKit permissions.
- Tap Sync.
Heads‑up: By default the app syncs your entire history. With 7 years of data (~5 M points) the first sync can take ~20 minutes.
5️⃣ Verify the Data in the Dashboard
Return to the Open Wearables dashboard. You should start seeing:
- Steps
- Heart rate
- Sleep
- Workouts
- …and many other time‑series metrics
Explore charts, trends, and raw data – finally you have a place where you can actually work with your Apple Health data.
6️⃣ Talk to Your Data with AI (MCP)
Open Wearables ships with an MCP (Model‑Connector‑Proxy) server that lets you query your wearable data using any LLM client (ChatGPT, Claude, Llama, …).
The next sections of the original guide (not included here) walk you through:
- Setting up the MCP server.
- Creating prompts that ask the LLM to analyse steps, heart‑rate trends, sleep quality, etc.
- Using the built‑in UI to chat with your own data.
TL;DR
- Deploy Open Wearables (Railway or locally).
- Create a user & invitation code.
- Install the mobile app (build yourself or TestFlight).
- Enter the invitation code + API URL → Sync.
- Explore your data on the dashboard.
- Optional: Use the MCP server to ask LLMs questions about your health.
You now have a fully automated pipeline from Apple Health → Open Wearables → AI‑driven insights. Enjoy!
Open Wearables – Quick Overview
Open Wearables comes with an MCP server that lets you connect your health data to any LLM client (Claude, Cursor, etc.). Simply ask questions in natural language, for example:
- “How did my sleep look last week?”
- “Show me my heart‑rate trends during workouts.”
- “Compare my step counts this month vs. last month.”
Why You’ll Love It
- All Open Source – Missing a feature? Build it, open a PR, or fork the repo. No vendor lock‑in, no waiting on a roadmap.
- Vibrant Community – Over 100 members in our Discord are passionate about wearable data. Share ideas, get help at 2 AM, and geek out over HRV graphs. Whether you’re a developer, a health enthusiast, or both, you’ll feel at home.
Get Creative
You can do anything you want with your data. A popular example:
Build an automation in n8n that queries the Open Wearables API, checks your daily activity, and sends a nudge on your favorite messaging app when it’s time to move.
(See my hackathon story for a step‑by‑step walkthrough.)
Resources
- [Open Wearables GitHub repository]
- [Discord community]
- [Open Wearables walkthrough video]
Call to Action
Let us know if you completed the setup in under 15 minutes! We care deeply about a great developer/user experience, so any feedback on how we can improve is greatly appreciated.
Have fun!