04-01-2016 04:08
04-01-2016 04:08
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.
04-01-2016 11:03
04-01-2016 11:03
@Grimster So here's a possible solution using time series:
Weight
https://api.fitbit.com/1/user/-/body/weight/date/today/1d.json
Body Fat
https://api.fitbit.com/1/user/-/body/fat/date/today/7d.json
Hopefully that helps.
04-01-2016 10:24
04-01-2016 10:24
@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
04-01-2016 10:28
04-01-2016 10:43
04-01-2016 10:43
04-01-2016 11:03
04-01-2016 11:03
@Grimster So here's a possible solution using time series:
Weight
https://api.fitbit.com/1/user/-/body/weight/date/today/1d.json
Body Fat
https://api.fitbit.com/1/user/-/body/fat/date/today/7d.json
Hopefully that helps.
04-11-2016 01:27 - edited 04-11-2016 01:29
04-11-2016 01:27 - edited 04-11-2016 01:29
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