orcasgit / python-fitbit

Fitbit API Python Client Implementation
Other
619 stars 329 forks source link

unable to get sleep summary data using time_series('sleep') #147

Open t0560r91 opened 5 years ago

t0560r91 commented 5 years ago

When I make a API request using

   auth_client.time_series('sleep', base_date=start_date, end_date=end_date)

, I do not get sleep summary data that contains

   'summary': {'stages': {'deep': 84, 'light': 263, 'rem': 104, 'wake': 59},
   'totalMinutesAsleep': 463,
   'totalSleepRecords': 1,
   'totalTimeInBed': 510}}

I was able to get the full sleep data including summary data using just auth_client.sleep() but not using auth_client.time_series('sleep')

salvador-moreno commented 5 years ago

I do not think that is an issue, the 'time_series' method is indicated to retrieve only the sleep data in a finer detail,. If you want to get the summary AND the time series you can always use the client's 'sleep' method.

jakemiller13 commented 4 years ago

Tracking Sleep Habits Using Your Fitbit

I'm working on a project that does exactly what you are looking for. It returns the summary as part of a json object, so you just need to pull it out of that.