03-17-2021 07:47
03-17-2021 07:47
It should be clear from the documentation but in reality, it is not. This is the observed and tested behavior of the Web API.
Problem statement: Get ALL Weight and Fat percentage data for a user given the smallest amount of API request possible. (Both for rate-limiting reasons and also I do not want to hammer FitBit API if I don't have to).
The first intuition would be to use the "Get Body Time Series" API. It allows getting data for an arbitrary duration. However, data from this API is inconsistent with data you get from "Get Body Fat Logs" or "Get Weight Logs" APIs. The latter 2 APIs will return nothing for dates when there is no measurement taken that day. The "Get Body Time Series" will on the other hand in such case return the last recorded measurement and will repeat this value every day until a new measurement is taken.
This behavior seems VERY odd to me for several reasons.
As a result, I am forced to use "Get * Logs" APIs, that have a maximal time range of 31 days and therefore might multiply the number of required API calls by about 30 on average for my users.
At the same time, I see several possible solutions to this issue that could be implemented on the FitBit side:
Right now I am at the point that I have to use 30+ API calls for an issue I think FitBit would like me to solve with 1 call. Maybe I have missed something, does anybody see any other option to achieve the result I am seeking other than the solution I have proposed?
03-19-2021 17:59
03-19-2021 17:59
Hi @patrickkus,
This is a very good observation, and just recently have I worked a case where I needed to explain that the Get Weight/Fat Logs endpoints will return actual weigh-ins versus the time series endpoints.
I have not yet tested to see what the expected behavior is if for example I perform multiple weigh-ins a day and what response I am expected to see from the time series endpoints. I'll need a few days to test this out and get back to you.
If I can confirm that this is in fact a challenging experience for developers, I'll go ahead and file a ticket to improve the experience.
Again, thanks for bringing this up and I'll post back here after some tests.
12-07-2021 05:24
12-07-2021 05:24
Any update on this?