API Documentation

Dates and datetimes

All dates and datetimes provided by the API are in ISO 8601 format. In case the date is in UTC, it follows the following formats:

  • Dates: YYYY-MM-DD, 2016-04-28
  • Date times YYYY-MM-DDThh:mm:ssZ, 2016-02-16T05:03:57Z

As the local time plays an important role in sleep and activity data, we often expose local times in the API using standrad ISO 8601 notation. For example the above date time is shown in Pacific Standard Time as

  • Date times YYYY-MM-DDThh:mm:ss+ZZ:ZZ, 2016-02-15T21:03:57-08:00

Durations as seconds

We express all durations as seconds. For example amount of REM sleep per night is expressed in seconds.

Classification arrays as strings

Both activity and sleep data contain interval classifications. We have used a string instead of a list to encode phases for a more compact representation.