Product-Nutriscore Schema

Schema definition for the Product-Nutriscore object in product data

Product-Nutriscore Schema

This is a data schema, not an API endpoint. The Product-Nutriscore object describes the shape of data returned inside product records by the Product Opener API.

{
  "title": "ProductNutriscore",
  "type": "object",
  "properties": {
    "nutriscore": {
      "title": "Nutriscores",
      "type": "object",
      "properties": {
        "2021": {
          "title": "Nutriscore2021",
          "allOf": [
            {
              "type": "object",
              "properties": {
                "category_available": {
                  "type": "integer",
                  "enum": [
                    0,
                    1
                  ],
                  "examples": [
                    1
                  ]
                },
                "grade": {
                  "examples": [
                    "d"
                  ],
                  "description": "Nutri-Score for the product as a letter.\n\nSee https://world.openfoodfacts.org/nutriscore.\n",
                  "type": "string",
                  "enum": [
                    "a",
                    "b",
                    "c",
                    "d",
                    "e"
                  ]
                },
                "nutrients_available": {
                  "type": "integer",
                  "enum": [
                    0,
                    1
                  ],
                  "examples": [
                    1
                  ]
                },
                "nutriscore_applicable": {
                  "type": "integer",
                  "enum": [
                    0,
                    1
                  ],
                  "examples": [
                    1
                  ]
                },
                "nutriscore_computed": {
                  "type": "integer",
                  "enum": [
                    0,
                    1
                  ],
                  "examples": [
                    1
                  ]
                },
                "score": {
                  "type": "integer",
                  "examples": [
                    13,
                    18
                  ]
                }
              }
            },
            {
              "type": "object",
              "properties": {
                "data": {
                  "title": "Nutriscore2021Data",
                  "allOf": [
                    {
                      "title": "Nutriscore2021InnerData",
                      "allOf": [
                        {
                          "type": "object",
                          "properties": {
                            "is_beverage": {
                              "type": "integer",
                              "enum": [
                                0,
                                1
                              ],
                              "examples": [
                                0
                              ]
                            },
                            "is_cheese": {
                              "type": "integer",
                              "enum": [
                                0,
                                1
                              ],
                              "examples": [
                                0
                              ]
                            },
                            "is_water": {
                              "type": "integer",
                              "enum": [
                                0,
                                1
                              ],
                              "examples": [
                                0
                              ]
                            }
                          }
                        },
                        {
                          "properties": {
                            "is_fat": {
                              "type": "integer",
                              "enum": [
                                0,
                                1
                              ],
                              "examples": [
                                0
                              ]
                            },
                            "energy": {
                              "type": "integer",
                              "examples": [
                                1996
                              ]
                            },
                            "energy_points": {
                              "type": "integer",
                              "examples": [
                                5
                              ]
                            },
                            "energy_value": {
                              "type": "integer",
                              "examples": [
                                1996
                              ]
                            },
                            "fiber": {
                              "type": "number",
                              "format": "float",
                              "examples": [
                                3.8
                              ]
                            },
                            "fiber_points": {
                              "type": "integer",
                              "examples": [
                                4
                              ]
                            },
                            "fiber_value": {
                              "type": "number",
                              "format": "float",
                              "examples": [
                                3.8
                              ]
                            },
                            "fruits_vegetables_nuts_colza_walnut_olive_oils": {
                              "type": "number",
                              "format": "float",
                              "examples": [
                                0
                              ]
                            },
                            "fruits_vegetables_nuts_colza_walnut_olive_oils_points": {
                              "type": "integer",
                              "examples": [
                                0
                              ]
                            },
                            "fruits_vegetables_nuts_colza_walnut_olive_oils_value": {
                              "type": "number",
                              "format": "float",
                              "examples": [
                                0
                              ]
                            },
                            "proteins": {
                              "type": "number",
                              "format": "float",
                              "examples": [
                                6.6
                              ]
                            },
                            "proteins_points": {
                              "type": "integer",
                              "examples": [
                                4
                              ]
                            },
                            "proteins_value": {
                              "type": "number",
                              "format": "float",
                              "examples": [
                                6.6
                              ]
                            },
                            "saturated_fat": {
                              "type": "number",
                              "format": "float",
                              "examples": [
                                6.2
                              ]
                            },
                            "saturated_fat_points": {
                              "type": "integer",
                              "examples": [
                                6
                              ]
                            },
                            "saturated_fat_value": {
                              "type": "number",
                              "format": "float",
                              "examples": [
                                6.2
                              ]
                            },
                            "sodium": {
                              "type": "number",
                              "format": "float",
                              "examples": [
                                210
                              ]
                            },
                            "sodium_points": {
                              "type": "integer",
                              "examples": [
                                2
                              ]
                            },
                            "sodium_value": {
                              "type": "number",
                              "format": "float",
                              "examples": [
                                210
                              ]
                            },
                            "sugars": {
                              "type": "number",
                              "format": "float",
                              "examples": [
                                21.5
                              ]
                            },
                            "sugars_points": {
                              "type": "integer",
                              "examples": [
                                4
                              ]
                            },
                            "sugars_value": {
                              "type": "number",
                              "format": "float",
                              "examples": [
                                21.5
                              ]
                            },
                            "negative_points": {
                              "type": "integer",
                              "examples": [
                                17
                              ]
                            },
                            "positive_points": {
                              "type": "integer",
                              "examples": [
                                4
                              ]
                            }
                          }
                        }
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "grade": {
                          "examples": [
                            "d"
                          ],
                          "description": "Nutri-Score for the product as a letter.\n\nSee https://world.openfoodfacts.org/nutriscore.\n",
                          "type": "string",
                          "enum": [
                            "a",
                            "b",
                            "c",
                            "d",
                            "e"
                          ]
                        },
                        "score": {
                          "type": "integer",
                          "examples": [
                            13
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          ]
        },
        "2023": {
          "title": "Nutriscore2023",
          "allOf": [
            {
              "type": "object",
              "properties": {
                "category_available": {
                  "type": "integer",
                  "enum": [
                    0,
                    1
                  ],
                  "examples": [
                    1
                  ]
                },
                "grade": {
                  "examples": [
                    "d"
                  ],
                  "description": "Nutri-Score for the product as a letter.\n\nSee https://world.openfoodfacts.org/nutriscore.\n",
                  "type": "string",
                  "enum": [
                    "a",
                    "b",
                    "c",
                    "d",
                    "e"
                  ]
                },
                "nutrients_available": {
                  "type": "integer",
                  "enum": [
                    0,
                    1
                  ],
                  "examples": [
                    1
                  ]
                },
                "nutriscore_applicable": {
                  "type": "integer",
                  "enum": [
                    0,
                    1
                  ],
                  "examples": [
                    1
                  ]
                },
                "nutriscore_computed": {
                  "type": "integer",
                  "enum": [
                    0,
                    1
                  ],
                  "examples": [
                    1
                  ]
                },
                "score": {
                  "type": "integer",
                  "examples": [
                    13,
                    18
                  ]
                }
              }
            },
            {
              "type": "object",
              "properties": {
                "data": {
                  "title": "Nutriscore2023Data",
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "is_beverage": {
                          "type": "integer",
                          "enum": [
                            0,
                            1
                          ],
                          "examples": [
                            0
                          ]
                        },
                        "is_cheese": {
                          "type": "integer",
                          "enum": [
                            0,
                            1
                          ],
                          "examples": [
                            0
                          ]
                        },
                        "is_water": {
                          "type": "integer",
                          "enum": [
                            0,
                            1
                          ],
                          "examples": [
                            0
                          ]
                        }
                      }
                    },
                    {
                      "properties": {
                        "is_fat_oil_nuts_seeds": {
                          "type": "integer",
                          "enum": [
                            0,
                            1
                          ],
                          "examples": [
                            0
                          ]
                        },
                        "is_red_meat_product": {
                          "type": "integer",
                          "enum": [
                            0,
                            1
                          ],
                          "examples": [
                            0
                          ]
                        },
                        "components": {
                          "title": "Nutriscore2023DataComponents",
                          "type": "object",
                          "properties": {
                            "negative": {
                              "type": "array",
                              "items": {
                                "title": "NutriscoreComponent",
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "examples": [
                                      "energy",
                                      "sugars",
                                      "saturated_fat",
                                      "salt",
                                      "fiber",
                                      "fruits_vegetables_legumes"
                                    ]
                                  },
                                  "points": {
                                    "type": "integer",
                                    "examples": [
                                      5,
                                      6,
                                      7,
                                      2,
                                      1,
                                      0
                                    ]
                                  },
                                  "points_max": {
                                    "type": "integer",
                                    "examples": [
                                      10,
                                      15,
                                      20,
                                      25,
                                      5,
                                      5
                                    ]
                                  },
                                  "unit": {
                                    "type": "string",
                                    "examples": [
                                      "kJ",
                                      "g",
                                      "%"
                                    ]
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "number"
                                    ],
                                    "format": "float",
                                    "examples": [
                                      21.5,
                                      6.2,
                                      0.53,
                                      3.8,
                                      0
                                    ]
                                  }
                                }
                              }
                            },
                            "positive": {
                              "type": "array",
                              "items": {
                                "title": "NutriscoreComponent",
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "examples": [
                                      "energy",
                                      "sugars",
                                      "saturated_fat",
                                      "salt",
                                      "fiber",
                                      "fruits_vegetables_legumes"
                                    ]
                                  },
                                  "points": {
                                    "type": "integer",
                                    "examples": [
                                      5,
                                      6,
                                      7,
                                      2,
                                      1,
                                      0
                                    ]
                                  },
                                  "points_max": {
                                    "type": "integer",
                                    "examples": [
                                      10,
                                      15,
                                      20,
                                      25,
                                      5,
                                      5
                                    ]
                                  },
                                  "unit": {
                                    "type": "string",
                                    "examples": [
                                      "kJ",
                                      "g",
                                      "%"
                                    ]
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "number"
                                    ],
                                    "format": "float",
                                    "examples": [
                                      21.5,
                                      6.2,
                                      0.53,
                                      3.8,
                                      0
                                    ]
                                  }
                                }
                              }
                            }
                          }
                        },
                        "count_proteins": {
                          "type": "number",
                          "format": "float",
                          "examples": [
                            0
                          ]
                        },
                        "count_proteins_reason": {
                          "type": "string",
                          "examples": [
                            "negative_points_greater_than_or_equal_to_11"
                          ]
                        },
                        "negative_points": {
                          "type": "integer",
                          "examples": [
                            19
                          ]
                        },
                        "positive_points": {
                          "type": "integer",
                          "examples": [
                            1
                          ]
                        },
                        "negative_points_max": {
                          "type": "integer",
                          "examples": [
                            55
                          ]
                        },
                        "positive_points_max": {
                          "type": "integer",
                          "examples": [
                            10
                          ]
                        },
                        "positive_nutrients": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "examples": [
                            [
                              "fiber",
                              "fruits_vegetables_legumes"
                            ]
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          ]
        }
      }
    },
    "nutriscore_2021_tags": {
      "type": "array",
      "items": {
        "description": "Nutri-Score for the product as a letter.\n\nSee https://world.openfoodfacts.org/nutriscore.\n",
        "type": "string",
        "enum": [
          "a",
          "b",
          "c",
          "d",
          "e"
        ]
      },
      "examples": [
        [
          "d"
        ]
      ]
    },
    "nutriscore_2023_tags": {
      "type": "array",
      "items": {
        "description": "Nutri-Score for the product as a letter.\n\nSee https://world.openfoodfacts.org/nutriscore.\n",
        "type": "string",
        "enum": [
          "a",
          "b",
          "c",
          "d",
          "e"
        ]
      },
      "examples": [
        [
          "d"
        ]
      ]
    },
    "nutriscore_data": {
      "title": "Nutriscore2021Data",
      "allOf": [
        {
          "title": "Nutriscore2021InnerData",
          "allOf": [
            {
              "type": "object",
              "properties": {
                "is_beverage": {
                  "type": "integer",
                  "enum": [
                    0,
                    1
                  ],
                  "examples": [
                    0
                  ]
                },
                "is_cheese": {
                  "type": "integer",
                  "enum": [
                    0,
                    1
                  ],
                  "examples": [
                    0
                  ]
                },
                "is_water": {
                  "type": "integer",
                  "enum": [
                    0,
                    1
                  ],
                  "examples": [
                    0
                  ]
                }
              }
            },
            {
              "properties": {
                "is_fat": {
                  "type": "integer",
                  "enum": [
                    0,
                    1
                  ],
                  "examples": [
                    0
                  ]
                },
                "energy": {
                  "type": "integer",
                  "examples": [
                    1996
                  ]
                },
                "energy_points": {
                  "type": "integer",
                  "examples": [
                    5
                  ]
                },
                "energy_value": {
                  "type": "integer",
                  "examples": [
                    1996
                  ]
                },
                "fiber": {
                  "type": "number",
                  "format": "float",
                  "examples": [
                    3.8
                  ]
                },
                "fiber_points": {
                  "type": "integer",
                  "examples": [
                    4
                  ]
                },
                "fiber_value": {
                  "type": "number",
                  "format": "float",
                  "examples": [
                    3.8
                  ]
                },
                "fruits_vegetables_nuts_colza_walnut_olive_oils": {
                  "type": "number",
                  "format": "float",
                  "examples": [
                    0
                  ]
                },
                "fruits_vegetables_nuts_colza_walnut_olive_oils_points": {
                  "type": "integer",
                  "examples": [
                    0
                  ]
                },
                "fruits_vegetables_nuts_colza_walnut_olive_oils_value": {
                  "type": "number",
                  "format": "float",
                  "examples": [
                    0
                  ]
                },
                "proteins": {
                  "type": "number",
                  "format": "float",
                  "examples": [
                    6.6
                  ]
                },
                "proteins_points": {
                  "type": "integer",
                  "examples": [
                    4
                  ]
                },
                "proteins_value": {
                  "type": "number",
                  "format": "float",
                  "examples": [
                    6.6
                  ]
                },
                "saturated_fat": {
                  "type": "number",
                  "format": "float",
                  "examples": [
                    6.2
                  ]
                },
                "saturated_fat_points": {
                  "type": "integer",
                  "examples": [
                    6
                  ]
                },
                "saturated_fat_value": {
                  "type": "number",
                  "format": "float",
                  "examples": [
                    6.2
                  ]
                },
                "sodium": {
                  "type": "number",
                  "format": "float",
                  "examples": [
                    210
                  ]
                },
                "sodium_points": {
                  "type": "integer",
                  "examples": [
                    2
                  ]
                },
                "sodium_value": {
                  "type": "number",
                  "format": "float",
                  "examples": [
                    210
                  ]
                },
                "sugars": {
                  "type": "number",
                  "format": "float",
                  "examples": [
                    21.5
                  ]
                },
                "sugars_points": {
                  "type": "integer",
                  "examples": [
                    4
                  ]
                },
                "sugars_value": {
                  "type": "number",
                  "format": "float",
                  "examples": [
                    21.5
                  ]
                },
                "negative_points": {
                  "type": "integer",
                  "examples": [
                    17
                  ]
                },
                "positive_points": {
                  "type": "integer",
                  "examples": [
                    4
                  ]
                }
              }
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "grade": {
              "examples": [
                "d"
              ],
              "description": "Nutri-Score for the product as a letter.\n\nSee https://world.openfoodfacts.org/nutriscore.\n",
              "type": "string",
              "enum": [
                "a",
                "b",
                "c",
                "d",
                "e"
              ]
            },
            "score": {
              "type": "integer",
              "examples": [
                13
              ]
            }
          }
        }
      ]
    },
    "nutriscore_grade": {
      "examples": [
        "d"
      ],
      "description": "Nutri-Score for the product as a letter.\n\nSee https://world.openfoodfacts.org/nutriscore.\n",
      "type": "string",
      "enum": [
        "a",
        "b",
        "c",
        "d",
        "e"
      ]
    },
    "nutriscore_score": {
      "description": "Nutri-Score for the product as an integer (see also `nutriscore_grade`).\n",
      "type": "integer",
      "examples": [
        13
      ]
    },
    "nutriscore_score_opposite": {
      "type": "integer",
      "examples": [
        -13
      ]
    },
    "nutriscore_tags": {
      "type": "array",
      "items": {
        "description": "Nutri-Score for the product as a letter.\n\nSee https://world.openfoodfacts.org/nutriscore.\n",
        "type": "string",
        "enum": [
          "a",
          "b",
          "c",
          "d",
          "e"
        ]
      },
      "examples": [
        [
          "d"
        ]
      ]
    },
    "nutriscore_version": {
      "type": "string"
    }
  }
}