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

Retrieve Micronutrients via API

ANSWERED

Dear team,

 

as far as I can see, it’s not possible to extract micronutrients via the API. Will this feature ever be implemented?

 

Built an app to track my nutrients and suggest foods to focus on, so this would be very important.

 

thanks a lot!

 

Best,

Floris

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Hi @FlorisR 

 

I don't believe the micronutrients are available for that food id.   See https://dev.fitbit.com/build/reference/web-api/nutrition/get-food/.   I don't know how much micronutrient information was collected when we created the PUBLIC food database.  In my experience, you will see more micronutrient information from foods in the PRIVATE database.

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

View best answer in original post

Best Answer
0 Votes
5 REPLIES 5

Hi @FlorisR 

 

I believe one use to be able to query the micronutrients.   Let me investigate this and get back to you.

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Hi @FlorisR 

 

I was able to extract the micronutrients for a food item using the Get Food endpoint, https://dev.fitbit.com/build/reference/web-api/nutrition/get-food/.  The information will only be returned if it is available in our database.  For this example, I created the food myself.   We might have some of the examples in our documentation mixed up.   I'll try to verify everything in the near future.

 

curl -X GET "https://api.fitbit.com/1/foods/802194989.json"

-H "accept: application/json"

-H "authorization: Bearer <access_token>

 

{
  "food": {
    "accessLevel": "PRIVATE",
    "brand": "Gordon's",
    "calories": 70,
    "creatorEncodedId": "2H2PHF",
    "defaultServingSize": 0.5,
    "defaultUnit": {
      "id": 91,
      "name": "cup",
      "plural": "cups"
    },
    "foodId": 802194989,
    "isGeneric": false,
    "name": "Tomato Soup",
    "nutritionalValues": {
      "biotin": 0,
      "calcium": 0,
      "calories": 70,
      "caloriesFromFat": 0,
      "cholesterol": 0,
      "copper": 0,
      "dietaryFiber": 1,
      "folicAcid": 0,
      "iodine": 0,
      "iron": 0.36,
      "magnesium": 0,
      "niacin": 0,
      "pantothenicAcid": 0,
      "phosphorus": 0,
      "potassium": 600,
      "protein": 2,
      "riboflavin": 0,
      "saturatedFat": 0,
      "sodium": 410,
      "sugars": 8,
      "thiamin": 0,
      "totalCarbohydrate": 16,
      "totalFat": 0,
      "transFat": 0,
      "vitaminA": 0,
      "vitaminB12": 0,
      "vitaminB6": 0,
      "vitaminC": 6,
      "vitaminD": 0,
      "vitaminE": 0,
      "zinc": 0
    },
    "servings": [
      {
        "multiplier": 1,
        "servingSize": 0.5,
        "unit": {
          "id": 91,
          "name": "cup",
          "plural": "cups"
        },
        "unitId": 91
      },
      {
        "multiplier": 4,
        "servingSize": 1,
        "unit": {
          "id": 256,
          "name": "pint",
          "plural": "pints"
        },
        "unitId": 256
      },
      {
        "multiplier": 8,
        "servingSize": 1,
        "unit": {
          "id": 279,
          "name": "quart",
          "plural": "quarts"
        },
        "unitId": 279
      }
    ],
    "units": [
      91,
      256,
      279
    ]
  }
}
 
Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer

Hi @GordonFitbit,

thanks for your reply! I am using the get food endpoint and double checked that my logs don't contain the micros. Here is an example:

 

{
"isFavorite": false,
"logDate": "",
"logId": 29046691088,
"loggedFood": {
"accessLevel": "PUBLIC",
"amount": 40,
"brand": "",
"calories": 152,
"foodId": 537125536,
"locale": "de_DE",
"mealTypeId": 2,
"name": "Brownie",
"unit": {
"id": 147,
"name": "Gramm",
"plural": "Gramm"
},
"units": [
20425,
89,
20443,
226,
180,
147,
389
]
},
"nutritionalValues": {
"calories": 152,
"carbs": 25.01,
"fat": 5.51,
"fiber": 0.82,
"protein": 1.91,
"sodium": 58.82
}
},

 

It's exactly the same for other foods. I might have read somewhere that you can only see the micros for the foods you created yourself, which wouldn't help too much. Could you please confirm, maybe using above id (537125536)?

 

Thanks a lot!

 

Best,

Floris

Best Answer
0 Votes

Hi @FlorisR 

 

I don't believe the micronutrients are available for that food id.   See https://dev.fitbit.com/build/reference/web-api/nutrition/get-food/.   I don't know how much micronutrient information was collected when we created the PUBLIC food database.  In my experience, you will see more micronutrient information from foods in the PRIVATE database.

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Hi @GordonFitbit,

 

that's a pity. Still, thanks for checking!

 

Best,

Floris

Best Answer
0 Votes