04-01-2016 04:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-01-2016 04:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm able to get the weight & body fat for a specific date, but how can I simply get the latest/most recent data?
The documentation says:
"If you need to fetch only the most recent entry, you can use the Get Body Measurements endpoint."
But it then doesn't specify anywhere how to do this (to my knowledge).
Can anybody point me in the right direction?
Answered! Go to the Best Answer.
Accepted Solutions
04-01-2016 11:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



04-01-2016 11:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@Grimster So here's a possible solution using time series:
Weight
https://api.fitbit.com/1/user/-/body/weight/date/today/1d.json
- This will return the last known weight measurement (even if you don't have a weight logged for 'today').
Body Fat
https://api.fitbit.com/1/user/-/body/fat/date/today/7d.json
- This will return the last 7 days with the most recent day being the latest measurement. The reason I have it set to '7d' as opposed to '1d' is because '1d' was returning 0 and not giving the latest measurement (wasn't behaving the same as the weight endpoint).
Hopefully that helps.

04-01-2016 10:24
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



04-01-2016 10:24
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@Grimster Sorry for the confusion, you'll need to specify a date with that endpoint. You won't be able to just pull the most recent measurement.
I usually use this:
https://api.fitbit.com/1/user/-/body/date/today.json
But if you don't have data for 'today' it will return 0.

04-01-2016 10:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-01-2016 10:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Would be a logical thing to have in the app wouldn't it?
Otherwise I will have to cheer dvd today, if it doesn't have it a date range for a week...then a month..etc u until I find it. But that will take up a lot of unnecessary api calls

04-01-2016 10:43
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-01-2016 10:43
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Isn't there another endpoint to get the last logged weight & body fat %?
Would be a logical thing to have in the api wouldn't it?
Otherwise I will have to check the logs for today, if it doesn't have it I will have to check a date range for a week...then a month..etc u until I find it. But that will take up a lot of unnecessary api calls

04-01-2016 11:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



04-01-2016 11:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@Grimster So here's a possible solution using time series:
Weight
https://api.fitbit.com/1/user/-/body/weight/date/today/1d.json
- This will return the last known weight measurement (even if you don't have a weight logged for 'today').
Body Fat
https://api.fitbit.com/1/user/-/body/fat/date/today/7d.json
- This will return the last 7 days with the most recent day being the latest measurement. The reason I have it set to '7d' as opposed to '1d' is because '1d' was returning 0 and not giving the latest measurement (wasn't behaving the same as the weight endpoint).
Hopefully that helps.

04-11-2016 01:27 - edited 04-11-2016 01:29
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-11-2016 01:27 - edited 04-11-2016 01:29
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I tried the following end-points:
Weight
https://api.fitbit.com/1/user/{user-id}/body/weight/date/today/1d.json
Fat
https://api.fitbit.com/1/user/{user-id}/body/fat/date/today/1d.json
Both returned 1 entry with a datestamp of today but with the most recent (last) weight or fat value.
I haven't stepped on my aria for over a week just to test it out
But both worked as you described, so maybe they fixed the fat end-point to match the weight end-point.
Thank you Andrew, you saved the day

