As you may know, extracting data from Apple Health is not straightforward. Apple doesn't expose a REST API, so if you want access to your data - say, to run some analysis or let LLMs work with it - you basically have two options:
Use a third-party app that leverages HealthKit to access your data and then sends it to a server or cloud storage like Google Drive / Dropbox. Apps like Auto Health Export exist, but they're usually paid.
Use Apple's built-in export - if you have a lot of data and you've tried this before, you know how painful this process is. The export takes several long minutes and is easy to interrupt. On top of that, if you want up-to-date data, you'd need to repeat this every single day. Good luck keeping that habit!
I've been interested in wearable data for quite some time now. As a 7+ year Apple Watch user, this problem has been bothering me for a while.
Some time ago with small team I worked on a project called Apple Health MCP. It was our first experiment with connecting wearable data to LLMs. It worked pretty well and the project got quite a bit of attention, but it remained mostly a curiosity - asking users to manually export their data was simply too much friction.
All these problems and the journey of exploring available tools led to building an ecosystem - a platform that not only lets you export your data, but also provides a backend & storage, a pretty nice UI to browse that data, and an AI layer that, through an MCP server, lets you connect your data to whatever LLM client you're using. This project is called Open Wearables - an open-source, self-hosted platform for wearable data. And it's not just Apple Health - it supports a bunch of other integrations too (Garmin, Polar, Whoop, Suunto and more).
What's interesting is that the solution could appeal to two very different audiences:
- developers building applications around wearables - who would benefit from it as a middleware layer handling the complexities of provider integration, data normalisation, and so on
- also individual users looking for a single place to store and access their own (or their family's) wearable data.
How to get your Apple Health data back - step by step
Let me show you how to actually get this done. The whole process takes about 15 minutes and you'll have your Apple Health data flowing into a platform where you can actually do things with it.
1. Spin up Open Wearables
First things first - you need a running instance of Open Wearables. There are basically two ways to get it running:
Option A: Deploy to Railway (easiest)
This is the fastest route. Railway gives you a one-click deploy that sets up everything - the backend, frontend, database, Redis, background workers - all pre-configured and ready to go.
Hit the link, wait a couple of minutes, and you've got a production instance running. An admin account is created automatically on first startup (admin@admin.com / secret123) - you can customize these credentials before deploying.
Keep in mind that Railway is a paid SaaS - there's no permanent free tier. New users get a one-time $5 credit for a 30-day trial, and after that the minimum cost is $5/month (Hobby plan).
Option B: Run locally + expose with ngrok
If you prefer to keep things on your machine (or just want to poke around the code), you can run it locally:
git clone https://github.com/the-momentum/open-wearables.git
cd open-wearables
docker compose up -d
Since the mobile app needs to reach your backend over the internet, you'll need to expose it using ngrok:
ngrok http 8000
This gives you a public HTTPS URL like https://abc123.ngrok-free.app that points to your local backend. Keep this URL handy - you'll need it in a moment.
Tip: For a consistent URL that doesn't change on restart, you can set a custom domain:
ngrok http 8000 --domain=your-custom-domain.ngrok-free.app
2. Create a user invitation code in the dashboard
Now that your platform is running, head to the Open Wearables dashboard. You need to create a user and generate an invitation code that the mobile app will use to authenticate.
Here's the flow:
Log in to the dashboard
Create a new user
Generate an
invitation codefor SDK authenticationCopy that code - you'll paste it into the mobile app in the next step.
3. Get the Open Wearables app on your phone
This is where the 'magic' happens. The app connects to Apple Health on your device and syncs data to your Open Wearables instance in the background. Two ways to get it:
Option A: Build it yourself
The SDK repository includes a fully functional example app. If you're a developer and want to see how things work under the hood:
git clone https://github.com/the-momentum/open_wearables_health_sdk.git
cd open_wearables_health_sdk/example
flutter pub get
flutter run
You'll need to open ios/Runner.xcworkspace in Xcode, select your development team, and make sure the HealthKit capability is enabled. And remember - run on a physical device, HealthKit doesn't work in the simulator.
Option B: Get a TestFlight invite
Don't want to deal with building the app? Totally fair. Join our Discord and ask for a TestFlight beta invitation - we'll get you set up.
And the app should be available in the App Store soon - completely free!
Once you have the app running, enter the invitation code and your API URL (e.g. https://api.openwearables.ai or your ngrok URL if running locally), grant HealthKit permissions, and hit sync.
Heads up: Make sure you enter the API URL, not the dashboard URL. If you're running locally, use the ngrok URL.
By default, the app syncs your entire history. If you have a lot of data - like me, with 7 years and ~5 million data points - the full sync can take around 20 minutes.
4. Browse your data in the dashboard
Once the sync kicks in, head back to the dashboard. Your health data should start appearing - steps, heart rate, sleep, workouts, and more. You can explore timeseries data, check trends, and just generally geek out over your own numbers. It's You have finally a place where you can actually work with it.
5. Talk to your data with AI (MCP)
Here's where it gets really fun. Open Wearables comes with an MCP server that lets you connect your health data to any LLM client - Claude, Cursor, or whatever you're using. Just ask questions in natural language: "How did my sleep look last week?", "Show me my heart rate trends during workouts", "Compare my step counts this month vs last month".
To get it running, you'll need your Open Wearables API key (grab it from the dashboard) and add the MCP server configuration to your LLM client. The full setup guide for Claude is available at docs, but the gist is:
- Get your API key from the Open Wearables dashboard
- Add the MCP server config to your client (Claude Desktop, ChatGPT)
- Start chatting with your data
Have fun!
The best part? There's more than one.
But if I had to highlight a few things:
- It's all Open Source. If something is missing, if you want a feature that doesn't exist yet - you can build it. Open a PR, propose changes, contribute to the project. Or just fork it and make it your own. No vendor lock-in, no waiting for someone else to prioritize your use case.
- The community. We have over 100 fantastic people in our Discord, and every single one of them is passionate about wearable data. It's the kind of place where you'll find inspiration, share ideas, help each other debug things at 2 AM, and geek out over heart rate variability graphs. Whether you're a developer, a health enthusiast, or both - you'll feel at home. Come say hi.
- You can do whatever you want with your data. Get creative and have fun! For example, you could build an automation in N8N that queries the Open Wearables API, checks your daily activity, and sends you a nudge on your favourite messaging app when it's time to get moving! (you can take a look at my hackathon story where I built exactly that kind of automation)
I hope this tutorial has been helpful and gets you closer to accessing your data!
Here are the links for reference:
PS Let me know if you were able to complete the setup in under 15 minutes! We care deeply about a great developer / user experience, so if there's anything we can improve, we'd love to hear your feedback!
Top comments (2)
I'm currently comparing mine and my wifes sleep :)
who sleeps more (or better)?! haha