Skip to content
This repository was archived by the owner on Apr 16, 2025. It is now read-only.
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

Description

@wu-lee

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!

Metadata

Metadata

Assignees

No one assigned

    Fields

    No fields configured for ✅ Task.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions