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

Get food logs: Nutrition values units?

Hi,

 

The nutrition values in the get-food-log API has some decimal values. How do I know the units for each of the keys. URL :https://dev.fitbit.com/docs/food-logging/#get-food-logs.

Example:carbs, protein etc. I need to know the units of these keys.

Can anybody help here?

 

 

{
    "foods":[
        {
            "isFavorite":true,
            "logDate":"2011-06-29",
            "logId":1820,
            "loggedFood":{
                "accessLevel":"PUBLIC",
                "amount":132.57,
                "brand":"",
                "calories":752,
                "foodId":18828,
                "mealTypeId":4,
                "locale":"en_US",
                "name":"Chocolate, Milk",
                "unit":{
                    "id":147,
                    "name":"gram",
                    "plural":"grams"
                },
                "units":[226,180,147,389]
            },
            "nutritionalValues":{
                "calories":752,
                "carbs":66.5,
                "fat":49,
                "fiber":0.5,
                "protein":12.5,
                "sodium":186
            }
        }
    ],
    "summary":{
        "calories":752,
        "carbs":66.5,
        "fat":49,
        "fiber":0.5,
        "protein":12.5,
        "sodium":186,
        "water":0
    },
    "goals":{
        "calories": 2286
    }
}

 

Best Answer
0 Votes
3 REPLIES 3

@mchutani By default, here's what the units are:

 

Grams: carbs, fat, fiber, protein

Milligrams: sodium

Milliliters: water

 

If you set Accept-Language to "en_US", then water will be in ounces.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer

Thanks @AndrewFitbit. Could you please point me to the url where I can find this information?

Best Answer
0 Votes

@mchutani You can find documentation for units here, however, grams/milligrams are not documented. Units for food will always be returned in grams (milligrams for sodium), which is how it will appear on the food log of the Fitbit.com dashboard.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes