Sign in | Sign up

Percentage Units for 2.0 API


Currently contains 3 posts


January 12, 2015 17:30


Still playing around with yogurt:

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” },


January 12, 2015 18:24


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


January 27, 2015 06:33


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