Jump to content

API/Read/Product: Difference between revisions

no edit summary
(→‎General structure: Adding missing word)
Tags: Mobile edit Mobile web edit
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[Category:Developer]] [[Category:API]]
[[Category:Developer]] [[Category:API]]
<Back to [[API/Read]](Required reading)
<Back to [[API/Read]](Required reading)
'''IMPORTANT NOTE: this page might not be up-to-date, please refer to [https://openfoodfacts.github.io/openfoodfacts-server/api/ OFFICIAL DOCUMENTATION]'''




Line 332: Line 334:


Notes:  
Notes:  
* the API returns all values in grams. This applies to both the key_100g and key_serving values.
* The API returns all values in grams. This applies to both the key_100g and key_serving values.
* the API always returns the energy values in kJ by default. Multiply the value by 0.23900573614 to convert it to Calories.
* The API always returns the energy values in kJ by default. Multiply the value by 0.23900573614 to convert it to Calories.
* any nutriments submitted to OFF as % DV values are converted to grams before being stored in the database. The conversion is done based on the values [https://github.com/openfoodfacts/openfoodfacts-server/blob/master/lib/ProductOpener/Food.pm here]. Thus, the conversion rates can be used again to change the nutriment values from grams back to % DV.
* Any nutriments submitted to OFF as % DV values are converted to grams before being stored in the database. The conversion is done based on the values [https://github.com/openfoodfacts/openfoodfacts-server/blob/master/lib/ProductOpener/Food.pm here]. Thus, the conversion rates can be used again to change the nutriment values from grams back to % DV.


====== List of nutrition keys ======
====== List of nutrition keys ======
212

edits