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
Answered! Go to the Best Answer.
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
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
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Hi @FlorisR
I believe one use to be able to query the micronutrients. Let me investigate this and get back to you.
Gordon
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
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
]
}
}
Hi @Gordon-C,
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
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
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
Best Answer