We're making some changes to the Google Fit APIs. Learn about how these changes might affect your app. Read our new policy.

Sleep data type

Data type to capture sleep stages.

Sleep

This data type captures the user's length and type of sleep. Each data point represents a time interval for a stage of sleep.

The start time of the data point represents the start of the sleep stage and always needs to be included. The timestamp represents the end of the sleep stage. Time intervals don't need to be continuous but shouldn't overlap.

REST

Namecom.google.sleep.segment
OAuth permission scopes
https://www.googleapis.com/auth/fitness.sleep.read
https://www.googleapis.com/auth/fitness.sleep.write
Fields (format—units) sleep segment type (int—enum)
Values representing different sleep stages and types.

Android

Namecom.google.sleep.segment
Data type objectTYPE_SLEEP_SEGMENT
Fields (format—units) FIELD_SLEEP_SEGMENT_TYPE (int—enum)
Values representing different sleep stages and types.