Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Not getting Nutritional Information for all foods with api call

I have logged the following lunch foods:

FoodLogged.png

I'm using this api call to get the data.
https://api.fitbit.com/1/user/-/foods/log/date/<date>.json

 

I get all of the food items, but not all of the nutritionalValues in the JSON.  There's Calories, Fat, Fiber, Carbs, Sodium & Protein for the Chicken Burrito, but not for the other two.  Why?  Should I use a different api call?  Is it just not available?  Is there a bug?

Best Answer
0 Votes
22 REPLIES 22

@GordonFitbit Hi there!  Hope you had a great summer!  Checking in to see if there's any update on this issue?  Thanks much!

Best Answer
0 Votes

@GordonFitbit 

Not sure if it provides any additional context but there does appear to be a difference in response data over curl depending on the authorization header used.

For example when using the authorization token for the Swagger API I get this data

"loggedFood": {"accessLevel": "PUBLIC", "amount": 1, "brand": "Del Monte", "calories": 30,
"foodId": 14725566, "locale": "en_US", "mealTypeId": 1, "name": "Pears, Diced",
"unit": {"id": 91, "name": "cup", "plural": "cups"},
"units": [305, 91, 256, 279, 226, 180, 147, 389]},
"nutritionalValues": {
"calories": 30,
"carbs": 8,
"fat": 0,
"fiber": 1,
"protein": 0,
"sodium": 0}},

But when using the token from my app I do not get the Nutritional Information

"loggedFood": {"accessLevel": "PUBLIC", "amount": 1, "brand": "Del Monte", "calories": 30,
"foodId": 14725566, "locale": "en_US", "mealTypeId": 1, "name": "Pears, Diced",
"unit": {"id": 91, "name": "cup", "plural": "cups"},
"units": [305, 91, 256, 279, 226, 180, 147, 389]}},

May also be worth noting that custom foods which have "accessLevel": "PRIVATE" do return their nutritionalValues.

 

Best Answer
0 Votes

That's very interesting.  I'll have to look into it.  Thanks very much!

Best Answer
0 Votes