Is there any way to access real-time sleep stage data from Apple Watch?

I'm trying to make a watchOS app that uses sleep data to wake users up when they enter lighter sleep stages. Apple has HealthKit, which exposes HKCategoryValueSleepAnalysis to view each stage throughout sleep, but unfortunately, this data is only written after the user wakes up.

I did some research and found that the Apple Watch’s sleep classifier is part of Apple’s private system process, and apps can’t access that model directly or as it’s running. So, there’s no way to “record” my own data stream and match it with Apple’s classification during the night. Has anyone found a way to approximate or access live sleep-stage data in another way?

I’m thinking of combining CoreMotion (for movement) and heart rate data from a HKWorkoutSession to infer stages myself, but I’m wondering if there’s any Apple-approved or more accurate approach for this.

In other words, is there any way to use an Apple Watch to detect sleep stages accurately while the user is still asleep for the purpose of timing an optimal wake-up? Thanks

Just to confirm your comment about sleep analysis in HealthKit – It only exposes HKCategoryValueSleepAnalysis, and the data isn't available in real time. For anything related to sleep analysis other than that, you might consider filing a feedback report.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Is there any way to access real-time sleep stage data from Apple Watch?
 
 
Q