Sign in | Sign up

Percentage Units for 2.0 API

Tagged:

Currently contains 3 posts

Avatar

January 12, 2015 17:30

chug2k

Still playing around with yogurt: https://apibeta.nutritionix.com/v2/item/51c3ffe997c3e6dfa4df3270

The “unit” field has “mg”, but really this is percentage. I think name should be “Calcium”, and unit should be “pct”, or something to that effect. My code otherwise is going to have to search for “%” in the “name”, and then conditionally disregard the “unit” field. This seems wrong.

As a suggestion, you could just add another field called “usda_pct”, as sometimes I’m guessing you have access to both forms of information.

{ “attr_id”: 301, “value”: 30, “unit”: “mg”, “name”: “Calcium %”, “usda_tag”: “CA” },

Avatar

January 12, 2015 18:24

chug2k

Sorry – just realized that the client has to look up USDA percentages for fat, carbs, saturated fat, etc. anyway.

Avatar

January 27, 2015 06:33

menupages112

Each type of analysis has its own endpoint and methods. Please note, the format parameter at this time is required and only supports json as a value at this time.

Reply to thread