---
title: "Apple Health API Integration | Self-Hosted"
description: "Read Apple Health through the Open Wearables Mobile SDK and keep the data in your own cloud account. Sleep, workouts, vitals and gait, MIT licensed."
canonical_url: "https://openwearables.io/integrations/apple-health"
---

# Apple Health data, in your own cloud

Apple Health integration

HealthKit is where an iPhone keeps health data, and where the apps and devices a user already trusts write theirs. Open Wearables reads it through a mobile SDK in your own app and lands it in the same schema as the rest of your sources, self-hosted under an MIT licence.

[Get started](https://openwearables.io/docs/quickstart) [Book a demo](https://openwearables.io/book)

Built on Open Wearables

- Heart Monitor logo
- Hundred logo
- JustGains logo
- Lifelong logo
- MoveTogether logo
- ROXFIT logo
- Smarter Diagnostics logo
- Suna logo
- Yoboo logo

Data coverage

## Apple Health data we support

HealthKit is the widest data set of any source we connect, and one permission grant reads across everything the user already routes into it.

### The widest set we support

More data types than any other source, down to spirometry and falls.

### Sleep

Stages, efficiency, time in bed, naps and breathing disturbances.

### Heart

Heart rate, resting and recovery, HRV as SDNN, AFib burden.

### Vitals

SpO2, respiratory rate, temperature, glucose and blood pressure.

### Body

Weight, height, BMI, body fat, lean mass and waist.

### Activity

Steps, energy, exercise and stand time, flights and distance.

### Gait and mobility

Walking speed, step length, asymmetry, steadiness and stair speed.

### Performance

VO2 max, power, speed, cadence and Apple's effort scores.

### Environment

Audio exposure, time in daylight, UV and water temperature.

One connection, many devices

## Devices we do not connect directly still arrive here

Most wearables write to Apple Health through their own app, which makes HealthKit a route to hardware with no direct integration. A companion app usually writes a subset of what its own API exposes, so where we connect a provider directly and you need the full depth, connect it directly.

[Browse integrations](https://openwearables.io/integrations)

### Watches and trackers

Sports watches and fitness trackers, each through its own app.

### Rings and bands

Smart rings and recovery bands that sync to Apple Health.

### Sleep and metabolic

Sleep monitors and continuous glucose monitors.

### Medical devices

Blood pressure monitors, ECG devices and body composition scales.

## What working with Open Wearables gives you

Two views of the same deployment. One for the people wiring it in, one for the people signing it off.

### One schema, not one per provider

Apple Health arrives in the same shape as every cloud source, so your code carries no iOS-specific branches and adding a watch integration later does not change the call.

  - Sleep
  - Vitals
  - Activity
  - Gait

### The SDK is the integration

HealthKit has no cloud API, so reading it means code inside your app. That code is written, maintained and open, and your backend mints a short-lived user token, so the app secret never reaches the device.

  - Swift
  - Flutter
  - React Native

### Background sync that survives the OS

HealthKit tells the SDK when new data is written, and a scheduled task covers the rest, so data arrives without the user opening your app. Each sync moves only what is new, from a first-sync depth you choose.

  - Background sync
  - Incremental

### An XML route for migrations

A user's full Apple Health export can be imported directly, which is how you backfill years of history for someone switching to your product. Large files upload straight to your own object storage.

  - XML import
  - Your storage

### Access you control

It runs in your cloud account, under your credentials. When we work on your system, we do it under a DPA you sign.

  - Your credentials
  - Your region

### No developer programme to apply to

HealthKit access is a platform entitlement in your own app, not a partner agreement, so there is no approval queue between you and the data.

  - Your app
  - No approval queue

### Costs you can see

Running it costs your own cloud bill, paid to your provider. Deployment and Integration are one-off services, and modules such as health scores and the health agent are add-ons to Core or included in Enterprise.

  - Your cloud bill
  - One-off services

### No dependency on us

MIT licence, full source, public roadmap and public issues, plus community support on Discord.

  - MIT license
  - Full source
  - Discord

How it works

## From nothing to your first Apple Health query

[Get started](https://openwearables.io/docs/quickstart) [Book a demo](https://openwearables.io/book)

01

### Bring it up

Clone the repository and run it with Docker Compose. First API call in five minutes, before any provider is connected.

Terminal

```
$ git clone https://github.com/the-momentum/open-wearables.git
$ cd open-wearables && docker compose up -d
```

02

### Add the SDK to your iOS app

HealthKit data lives on the device, so this is where the integration happens rather than in a developer portal. Add the SDK, enable the [HealthKit](https://developer.apple.com/documentation/healthkit) capability in Xcode and declare the record types you need.

[iOS SDK integration guide](https://openwearables.io/docs/sdk/ios/integration)

03

### Ask the user for permission

iOS shows its own HealthKit permission sheet, per data type, and the user decides what to share. Your app keeps its existing login, so there is no second account to manage.

04

### Query the user, not the provider

Apple Health data arrives in the same schema as every other source, in your own database, so your application code carries no iOS-specific branches.

[Mobile SDKs](https://openwearables.io/platform/mobile-sdks)

The honest comparison

## Hosted SaaS API, in-house build, or self-hosted

Where each one actually wins. If a hosted API fits your situation, use one.

|  | Hosted SaaS API | Build in-house | Open Wearables, self-hosted |
| --- | --- | --- | --- |
| [01] The mobile SDK | Theirs, in your app | Yours to write and maintain | Open source, in your app, forkable |
| [02] Where HealthKit data goes first | Their cloud | Yours | Your cloud account, your region |
| [03] Permission sheet | Theirs or yours, depending | Yours | Apple's own, inside your app |
| [04] The data model | Theirs, you build against their schema | Yours | Yours, in your database |
| [05] Historical backfill | Whatever window they offer | Yours to build | Full XML export, into your storage |
| [06] HealthKit changes | They absorb them | Your team tracks and adapts | Fixed in a release you pull |
| [07] Cost shape | Scales with monthly active users | Salaries and infrastructure | Fixed, flattens as you grow |

What stays yours

## The deployment, the data and what you build on it stay in your account, whoever runs it

### Sovereignty

Apple Health data goes from the device to your cloud, with no aggregator in between.

### Residency

It stays in the region you chose, provable by pointing at an account.

### Control

What you build on top of Open Wearables is yours, and the schema and the data are in your account.

### Your own reasons

No regulator forcing it. You want the data in your own account anyway.

## Apple Health is one integration in the same API

You query a user rather than a provider, so somebody on an iPhone and somebody wearing a ring you connect through the cloud both come back in one shape. Adding either later does not change your code.

[Browse all integrations](https://openwearables.io/integrations)

- [Garmin integration](https://openwearables.io/integrations/garmin)
- [Whoop integration](https://openwearables.io/integrations/whoop)
- [Oura integration](https://openwearables.io/integrations/oura)
- [Polar integration](https://openwearables.io/integrations/polar)
- [Suunto integration](https://openwearables.io/integrations/suunto)
- [Withings integration](https://openwearables.io/integrations/withings)
- [Strava integration](https://openwearables.io/integrations/strava)
- [Ultrahuman integration](https://openwearables.io/integrations/ultrahuman)
- [SensorBio integration](https://openwearables.io/integrations/sensorbio)
- [Google Health API integration](https://openwearables.io/integrations/google-health)
- [Fitbit integration](https://openwearables.io/integrations/fitbit)
- [Google Health Connect integration](https://openwearables.io/integrations/google-health-connect)
- [Samsung Health integration](https://openwearables.io/integrations/samsung-health)
- [Garmin integration](https://openwearables.io/integrations/garmin)
- [Whoop integration](https://openwearables.io/integrations/whoop)
- [Oura integration](https://openwearables.io/integrations/oura)
- [Polar integration](https://openwearables.io/integrations/polar)
- [Suunto integration](https://openwearables.io/integrations/suunto)
- [Withings integration](https://openwearables.io/integrations/withings)
- [Strava integration](https://openwearables.io/integrations/strava)
- [Ultrahuman integration](https://openwearables.io/integrations/ultrahuman)
- [SensorBio integration](https://openwearables.io/integrations/sensorbio)
- [Google Health API integration](https://openwearables.io/integrations/google-health)
- [Fitbit integration](https://openwearables.io/integrations/fitbit)
- [Google Health Connect integration](https://openwearables.io/integrations/google-health-connect)
- [Samsung Health integration](https://openwearables.io/integrations/samsung-health)

## Deploy Open Wearables in your own cloud

The repository is public and the deployment is yours from the first commit. Start from the source, or bring us in to stand it up in your account with the SDK live in your app and validated on real devices.

[Get started](https://openwearables.io/docs/quickstart) [Book a demo](https://openwearables.io/book)

FAQ

## Do you have more questions?

### What is HealthKit?

Apple's health data store on iPhone and Apple Watch. Apps and devices write what they measured into one place on the device, and other apps read it with the user's permission, so it works as a hub rather than as one more device API.

### Do we need a developer account or an approval?

You need an Apple Developer account to ship any iOS app, and HealthKit is an entitlement you enable on your own app. There is no separate partner programme, no review queue and no agreement to negotiate with Apple for access to the data.

### Do we have to build a mobile app for this?

Not necessarily. HealthKit data never leaves the iPhone on its own, so an app has to read it: our SDK inside your own iOS app, or the [Connect App](https://openwearables.io/platform/connect-app) if you have none. If you only need history rather than continuous sync, a user's XML export can be imported without any app at all.

### Which SDKs are available?

Native iOS in Swift, plus Flutter and React Native wrappers over the same native core. The Android SDK covers Health Connect and Samsung Health on the other platform, so a cross-platform app uses one integration for both.

### How does the data actually get to us?

The SDK reads HealthKit and pushes to your deployment. Two things keep it arriving without the user opening your app: HealthKit notifies the SDK when new data is written, and a background task runs on a schedule to catch the rest. iOS decides how often that task runs, so treat it as regular rather than exact. Each run moves only what is new.

### How far back does the first sync go?

As far as you choose: the last ninety days, the last thirty, or everything HealthKit holds, which is the default. The depth persists, so later syncs follow the same rule.

### Can we import a user's full history?

Yes. Apple Health exports everything to XML, and that file can be imported directly, which is the usual route when someone migrates to your product with years of history behind them. Large exports upload to your own object storage rather than through the API. The [XML import guide](https://openwearables.io/docs/api-reference/guides/apple-xml-import) has the detail.

### Will data from a Garmin or an Oura arrive this way?

Often yes, because most companion apps write to Apple Health. That makes this integration a route to hardware we do not connect directly. One caveat worth planning for: a companion app usually writes a subset of what its own API exposes, so where we have a direct integration and you need full depth, connect it directly.

### How is heart rate variability reported?

As SDNN, typically measured during sleep or rest. That matters if you are comparing against a source that reports RMSSD, because the two are different measures and should not be treated as interchangeable inside one score.

### Is anything missing from sleep?

Stages, duration and time in bed all arrive. Heart rate, heart rate variability and blood oxygen measured during sleep are not yet attached to the sleep record itself, though they arrive as time series you can query across the same window.

### Can we combine Apple Health with other sources?

Yes, and that is the normal case. You query a user rather than a provider, so somebody with an iPhone and a connected ring returns in one shape.
