Skip to content
This repository was archived by the owner on Apr 16, 2025. It is now read-only.

Wiki documentation claims energy-kcal nutriment info stored as kj #51

Open
Tracked by #1
wu-lee opened this issue Dec 10, 2021 · 0 comments
Open
Tracked by #1

Wiki documentation claims energy-kcal nutriment info stored as kj #51

wu-lee opened this issue Dec 10, 2021 · 0 comments
Labels
good first issue Good for newcomers WRITE

Comments

@wu-lee
Copy link

wu-lee commented Dec 10, 2021

I hope this is the right way to report this.

This page:

https://wiki.openfoodfacts.org/Nutrients_handling_in_Open_Food_Facts

Says of the nutriment fields:

{nutrient-id}: the value converted in the default unit (currently kJ for all energy fields (including energy-kcal), otherwise gram).

Below it adds in "Possible improvements":

Store the energy-kcal values in kcal, without converting them to kJ

However, checking one or two cases from the API suggests that the energy-kcal field is in kcal, not kj, as it is approximately 4.18 times smaller, which would be about the right ratio if they were in kcal/kj, whereas would presumably be a massive discrepancy if they were both in the same units.

Examples:

Also, both fields are missing from:
https://wiki.openfoodfacts.org/API/Full_JSON_example

So I am guessing the API has changed and the wiki is now out of date?

Would you be able to confirm either way? I'm currently writing a diet diary application which would use this information, and I will be assuming that the kcal field is in fact in kcal unless you say (or I discover) otherwise.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers WRITE
Projects
Status: No status
Development

No branches or pull requests

2 participants