On the nutritionix.com website, when you search for and pick a food, you are shown the Nutrition Facts label for that food. How do I get that from the API if I want to show such a label in an app or something? I understand how to get the JSON data but it would be great to be able to directly embed the Nutrition Facts label. Is that possible?
That label is powered by our open source jquery plugin:
Feel free to use that. Thanks!
The Nutrition Facts Label is an easy tool for making quick, informed food choices that contribute to a healthy diet. FDA offers a variety of resources for understanding and using the Nutrition Facts Label.
If I have a recipe that serves four, I get the values back from the natural language V2 parser that returns the total nutrient breakdown (for example cholesterol “821mg” for 4 chicken breasts). A serving size is one chicken breast. How do I set the valueServingUnitQuantity/valueServingSize jquery params so that the Nutrition Facts show 1 serving (the 821mg of cholesterol is rendered as 206mg per serving) I’ve tried: valueServingSize as 0.25, but that doesn’t seem to do it.
If I set valueServingUnitQuantity to 4, it shows the 821mg and I can dial down the servings to 1 and see the proper 1/4 division, but is there a way to show the graphic by default as 1 serving with the proper 1/4 division going on?
Hi, you would need to calculate the values for one serving on the client-side. Our API does not currently process the serving division for you.
how do i use that nutritiona label with the python api
I have cloned from git Hub and included all the script tags in my HTML. But not knowing how to use this and display on my web page.