07-17-2015 14:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-17-2015 14:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Is there a way to get all sleep values, wether it be main or secondary values of sleep but in a time series format ? Im using the current time series but like others im noticing the difference in sleep values.
Answered! Go to the Best Answer.

Accepted Solutions
08-11-2015 15:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



08-11-2015 15:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
@Bonxy wrote:
I joined Fitbit In March 2014 so that's 500+ logs.
I would have to do 500 different requests to get all my sleep data.
When you have over a 1000 users with some who joined Fitbit in 2010 this is an enormous task with the rate limit in place.
I know that backfilling a user's historic Fitbit data is an API request intensive use-case that is not well handled by the current design of the Fitbit API.
Many historic data queries create a burden on the Fitbit API infrastructure. Recent data is heavily cached, as it is the most frequently accessed data. As data ages, it is bumped from our database cache. Retrieving non-cached data creates more overhead for our database, especially if your application has many users. For this reason, we require that applications doing this stay within the standard API rate limit.
We are working on a better long-term solution for this use-case. Unfortunately, I don't have a time frame for this improvement.
08-11-2015 00:46
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-11-2015 00:46
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Well, this is a bummer. When a user authenticates with our application, we want to retrieve the sleep of the last month. When using the time-series, this is really easy to do. But apparantly, this doesn't match the "correct" time the user slept. So we will have to call the API 30 times instead of 1 time.
Returning the main sleep in the time series in my opinion is useless. This night I slept 3 blocks of 3 hours. So in total I really slept 9 hours. But the time series API just returns 3 hours. This might be documented that this is the case, but that value really means nothing to me, nor the users of my application. I couldn't think of a use case where the main sleep value is good enough.

08-11-2015 01:22 - edited 08-11-2015 01:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-11-2015 01:22 - edited 08-11-2015 01:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
I didnt realise the time series only returned the main sleep until I read the docs. I do find it a bit useless.
I joined Fitbit In March 2014 so that's 500+ logs.
I would have to do 500 different requests to get all my sleep data.
When you have over a 1000 users with some who joined Fitbit in 2010 this is an enormous task with the rate limit in place.
08-11-2015 08:41
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-11-2015 08:41
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@Bonxy wrote:
When you have over a 1000 users with some who joined Fitbit in 2010 this is an enormous task with the rate limit in place.
@Bonxy The number of users shouldn't make any difference, the rate limit is per user per app, not per app. (Unless of course you are making non-user calls at the same time which would fall under a per app rate limit.)

08-11-2015 08:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-11-2015 08:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Servers have limits too.

08-11-2015 15:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



08-11-2015 15:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
@Bonxy wrote:
I joined Fitbit In March 2014 so that's 500+ logs.
I would have to do 500 different requests to get all my sleep data.
When you have over a 1000 users with some who joined Fitbit in 2010 this is an enormous task with the rate limit in place.
I know that backfilling a user's historic Fitbit data is an API request intensive use-case that is not well handled by the current design of the Fitbit API.
Many historic data queries create a burden on the Fitbit API infrastructure. Recent data is heavily cached, as it is the most frequently accessed data. As data ages, it is bumped from our database cache. Retrieving non-cached data creates more overhead for our database, especially if your application has many users. For this reason, we require that applications doing this stay within the standard API rate limit.
We are working on a better long-term solution for this use-case. Unfortunately, I don't have a time frame for this improvement.
08-11-2015 22:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-11-2015 22:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I guess I'll manage with the way it is for now. 🙂

