Skip to content
KNSG edited this page Sep 6, 2019 · 2 revisions

Summary

  • Sleep data by fitbit
  • File name starts with sleep-****.json
  • File format: JSON

Data Specification(Presumption)

[{
  "logId" : 10404382903,
  "dateOfSleep" : "2015-12-25",
  "startTime" : "2015-12-25T18:19:10.000",
  "endTime" : "2015-12-25T18:54:12.000",
  "duration" : 2100000,
  "minutesToFallAsleep" : 16,
  "minutesAsleep" : 19,
  "minutesAwake" : 0,
  "minutesAfterWakeup" : 0,
  "timeInBed" : 35,
  "efficiency" : 100,
  "type" : "classic",
  "infoCode" : 0,
  "levels" : {
    "summary" : {
      "restless" : {
        "count" : 1,
        "minutes" : 16
      },
      "awake" : {
        "count" : 0,
        "minutes" : 0
      },
      "asleep" : {
        "count" : 0,
        "minutes" : 19
      }
    },
    "data" : [{
      "dateTime" : "2015-12-25T18:19:10.000",
      "level" : "restless",
      "seconds" : 960
    },{
      "dateTime" : "2015-12-25T18:35:10.000",
      "level" : "asleep",
      "seconds" : 1140
    }]
  }
}]
  • logId (int) : Unique ID for log data
  • dateOfSleep (string) : date of Sleep data. format (yyyy-MM-dd)
  • startTime (string) : start time of sleep. format (yyyy-MM-dd'T'HH:mm:ss.SSS)
  • endTime (string) : end time of sleep. format (yyyy-MM-dd'T'HH:mm:ss.SSS)
  • duration (int) : time duration(msec) of approximate sleep time (same as timeInBed ?)
  • minutesToFallAsleep (int) : time duration(min) to fall asleep
  • minutesAsleep (int) : time duration(min) of asleep
  • minutesAwake (int) : time duration(min) of awake
  • minutesAfterWakeup (int) : time duration(min) of waking up
  • timeInBed (int) : time duration(min) in bed
  • efficiency (int) : ???
  • type (string) : ??? (classic/...)
  • infoCode (int) : ???
  • levels (object) : detailed data of sleep
    • summary (object) : sleep summary of each level(restless/awake/asleep)
      • count (int) : the number of indicated sleep level
      • minutes (int) : time duration of indicated sleep level
    • data (array) : detailed data of sleeps
      • dateTime (string) : start time(?) of indicated sleep level
      • level (string) : level of sleep (restless/awake/asleep)
      • seconds (int) : time duration(sec) of indicated sleep level

Clone this wiki locally