Product Schema
Schema definition for the Product object in product data
Product Schema
This is a data schema, not an API endpoint. The Product object describes the shape of
data returned inside product records by the Product Opener API.
{
"type": "object",
"title": "product",
"description": "This is all the fields describing a product and how to display it on a page.\n\nRefer to the different sub schema for more readable entries:\n\n* [Product Base](#cmp--schemas-product-base): Base fields of a product\n* [Product Misc](#cmp--schemas-product-misc): Miscellaneous but important fields of a product\n* [Product Tags](#cmp--schemas-product-tags): Tags fields on a product\n* [Product Images](#cmp--schemas-product-images): Information about Images of a product\n* [Product Eco-Score](#cmp--schemas-product-ecoscore): Fields related to Eco-Score for a product\n* [Product Ingredients](#cmp--schemas-product-ingredients): Fields about ingredients of a product\n* [Product Nutrition](#cmp--schemas-product-nutrition): Nutrition fields of a product\n* [Product Data Quality](#cmp--schemas-product-quality): fields related to data quality for a product\n* [Product Extended](#cmp--schemas-product-extended): TODO\n* [Product Metadata](#cmp--schemas-product-meta): Metadata of a product (author, editors, etc.)\n* [Product Knowledge Panels](#cmp--schemas-product-knowledge-panels): Knowledge panels for a product\n* [Product Attribute Groups](#cmp--schemas-product-attribute-groups): Attribute groups for personal product matching\n",
"allOf": [
{
"type": "object",
"description": "Base product data\n",
"required": [
"code",
"schema_version"
],
"allOf": [
{
"type": "object",
"description": "Product type information",
"properties": {
"product_type": {
"type": "string",
"description": "The product type is a fundamental separation that tells on which platform the product is made available:\nOpen Food Facts, Open Beauty Facts, Open Pet Food Facts or Open Products Facts.\n\nEach platform has variations on the way it analyses the product.\n\nChanging the product type moves the product to the new platform.\nIt must be done thoughtfully.\n",
"enum": [
"beauty",
"food",
"petfood",
"product"
]
}
}
}
],
"properties": {
"product_name": {
"type": "string",
"description": "The name of the product in the main language of the product (lang field) \n"
},
"abbreviated_product_name": {
"type": "string",
"description": "Abbreviated product name (e.g. abbreviated product name printed on receipts) in the main language of the product (lang field)"
},
"code": {
"type": "string",
"description": "barcode of the product (can be EAN-13 or internal codes for some food stores),\nfor products without a barcode,\nOpen Food Facts assigns a number starting with the 200 reserved prefix\n"
},
"codes_tags": {
"type": "array",
"items": {
"type": "string",
"description": "A value which is the type of barcode \"code-13\" or \"code-8\"\nand\nA series of mask for the barcode\nIt helps retrieve barcodes starting by\n",
"examples": [
"code-13",
"3017620422xxx",
"301762042xxxx",
"30176204xxxxx",
"3017620xxxxxx",
"301762xxxxxxx",
"30176xxxxxxxx",
"3017xxxxxxxxx",
"301xxxxxxxxxx",
"30xxxxxxxxxxx",
"3xxxxxxxxxxxx"
]
}
},
"generic_name": {
"type": "string",
"description": "Generic / legal name of the product in the main language of the product (lang field)\n"
},
"id": {
"description": "internal identifier for the product, usually set to the value of `code`,\nexcept on the producers platform where it is prefixed by the owner\n",
"type": "string"
},
"lc": {
"type": "string",
"description": "Main language of the product.\nThis is a duplicate of `lang` property (for historical reasons).\n"
},
"lang": {
"type": "string",
"description": "Main language of the product.\n\nThis should be the main language of product packaging (if one is predominant).\n\nMain language is also used to decide which ingredients list to parse.\n"
},
"nova_group": {
"type": "integer",
"description": "Nova group as an integer from 1 to 4. See https://world.openfoodfacts.org/nova\n"
},
"nova_groups": {
"type": "string"
},
"obsolete": {
"type": "string"
},
"obsolete_since_date": {
"description": "A date at which the product was declared obsolete.\nThis means it's not produced any more.\n",
"type": "string"
},
"product_quantity": {
"type": "string",
"description": "The size in g or ml for the whole product.\nIt is a normalized version of the `quantity` field.\nA `quantity` of \"2 x 60 g\" leads to `product_quantity`: \"120\".\n",
"example": "500"
},
"product_quantity_unit": {
"type": "string",
"description": "The unit (either g or ml) for the corresponding `product_quantity`.\nIt is computed from the `quantity` field.\nA `quantity` of \"6 x 250 ml\" leads to `product_quantity_unit`: \"ml\".\n",
"example": "g"
},
"quantity": {
"type": "string",
"description": "The quantity of the product, with the corresponding number of portions or unit (g, ml, kg, l, cl, oz, lbs...).\nIt should be the value as displayed on the product. The ℮ sign is allowed.\nWhen it refers to the number of portions, it can be filled without any units (e.g. \"6 eggs\").\n",
"example": "3 x 150 g"
},
"schema_version": {
"type": "integer",
"description": "Version of the product object schema used in the response.\nThis indicates the structure of the 'product' field itself.\nFor more details, please read: https://openfoodfacts.github.io/openfoodfacts-server/api/ref-api-and-product-schema-change-log\n",
"example": 999
}
},
"patternProperties": {
"product_name_(?<language_code>\\w\\w)": {
"type": "string",
"description": "Product name in language designated by `language_code`, e.g. product_name_fr\n"
},
"abbreviated_product_name_(?<language_code>\\w\\w)": {
"type": "string",
"description": "Abbreviated product name in language `language_code`."
},
"generic_name_(?<language_code>\\w\\w)": {
"type": "string",
"description": "Generic/legal name in language designated by `language_code`, e.g. generic_name_en.\n"
}
}
},
{
"type": "object",
"title": "product_misc",
"description": "Miscellaneous but important fields of a product\n",
"properties": {
"additives_n": {
"type": "integer",
"description": "Number of food additives.\n"
},
"checked": {
"type": "string"
},
"complete": {
"type": "integer"
},
"completeness": {
"type": "number"
},
"ecoscore_grade": {
"type": "string",
"description": "See also: `ecoscore_tags`\n"
},
"ecoscore_score": {
"type": "integer",
"description": "See also: `ecoscore_tags`\n"
},
"food_groups": {
"type": "string"
},
"food_groups_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"nutrient_levels": {
"description": "Traffic light indicators on main nutrients levels\n",
"type": "object",
"properties": {
"fat": {
"type": "string",
"enum": [
"low",
"moderate",
"high"
]
},
"salt": {
"type": "string",
"enum": [
"low",
"moderate",
"high"
]
},
"saturated-fat": {
"type": "string",
"enum": [
"low",
"moderate",
"high"
]
},
"sugars": {
"type": "string",
"enum": [
"low",
"moderate",
"high"
]
}
}
},
"packaging_text": {
"type": "string",
"description": "Recycling instructions as raw text, e.g. Plastic\nbottle to recycle, Plastic cap to recycle.\nThis will get automatically parsed and\nwill be used to compute the Eco-Score.\nYou can either request it (if it exists) or\nsend it in a specific language.\n",
"example": "packaging_text_en"
},
"packagings": {
"type": "array",
"title": "Packagings (READ)",
"description": "The packagings object is an array of individual packaging component objects.\n\nThe Packaging data document explains how packaging data is structured in Open Food Facts: https://openfoodfacts.github.io/openfoodfacts-server/dev/explain-packaging-data/\n\nThe shape, material and recycling properties of each packaging component are linked to entries in the packaging_shapes, packaging_materials and packaging_recycling taxonomies:\n\nhttps://world.openfoodfacts.org/data/taxonomies/packaging_shapes.json\nhttps://world.openfoodfacts.org/data/taxonomies/packaging_materials.json\nhttps://world.openfoodfacts.org/data/taxonomies/packaging_recycling.json\n\nIf the tags_lc field is set, the properties will include a lc_name field with the translation in the requested language.",
"examples": [
[
{
"number_of_units": 6,
"shape": {
"id": "en:bottle",
"lc_name": "bouteille"
},
"material": {
"id": "en:bottle",
"lc_name": "bouteille"
},
"recycling": {
"id": "en:bottle",
"lc_name": "bouteille"
},
"quantity_per_unit": "25 cl",
"quantity_per_unit_value": 25,
"quantity_per_unit_unit": "cl",
"weight_specified": 30,
"weight_measured": 32,
"weight_estimated": 26,
"weight": 30,
"weight_source_id": "specified"
}
]
],
"items": {
"description": "Each packaging component has different properties to specify how many there are, its shape, material etc.\n\nThe shape, material and recycling properties are mapped to one entry in the packaging_shapes, packaging_materials and packaging_recycling taxonomies, and the value of the property is the canonical name of the taxonomy entry (e.g. en:bottle).\n\nThey may contain values that could not yet get matched to their respective taxonomy, in which case they will contain a free text value prefixed with the language code of this text value (e.g. \"fr:Bouteille sphérique\" might have been entered by a French user to indicate it is a spherical bottle).",
"title": "Packaging component (READ)",
"type": "object",
"examples": [
{
"number_of_units": 6,
"shape": {
"id": "en:bottle",
"lc_name": "bouteille"
},
"material": {
"id": "en:bottle",
"lc_name": "bouteille"
},
"recycling": {
"id": "en:bottle",
"lc_name": "bouteille"
},
"quantity_per_unit": "25 cl",
"quantity_per_unit_value": 25,
"quantity_per_unit_unit": "cl",
"weight_specified": 30,
"weight_measured": 32,
"weight_estimated": 26,
"weight": 30,
"weight_source_id": "specified"
}
],
"properties": {
"number_of_units": {
"type": "integer",
"description": "umber of units of this packaging component contained in the product (e.g. 6 for a pack of 6 bottles)"
},
"shape": {
"title": "Packaging component shape",
"x-stoplight": {
"id": "xrj8agza3dwgf"
},
"type": "object",
"description": "The shape property is canonicalized using the packaging_shapes taxonomy. Taxonomized values are available using the partial taxonomy API, the autosuggest API or the full packaging_shapes taxonomy JSON export.",
"examples": [
{
"id": "en:bottle",
"lc_name": "bouteille"
}
],
"properties": {
"id": {
"type": "string",
"description": "Canonical id of the entry in the taxonomy. If the value cannot be mapped to a taxonomy entry, the value will be the name of the entry in its original language prefixed by the language 2 letter code and a colon."
},
"lc_name": {
"type": "string",
"description": "Name of the entry in the language requested in the tags_lc field of the request. This field is returned only of tags_lc is specified. If the translation is not available, or if the entry does not exist in the taxonomy, the value will be the name of the entry in its original language prefixed by the language 2 letter code and a colon."
}
}
},
"material": {
"title": "Packaging component material",
"type": "object",
"description": "The material property is canonicalized using the packaging_materials taxonomy. Taxonomized values are available using the partial taxonomy API, the autosuggest API or the full packaging_material taxonomy JSON export.",
"examples": [
{
"id": "en:bottle",
"lc_name": "bouteille"
}
],
"properties": {
"id": {
"type": "string",
"description": "Canonical id of the entry in the taxonomy. If the value cannot be mapped to a taxonomy entry, the value will be the name of the entry in its original language prefixed by the language 2 letter code and a colon."
},
"lc_name": {
"type": "string",
"description": "Name of the entry in the language requested in the tags_lc field of the request. This field is returned only of tags_lc is specified. If the translation is not available, or if the entry does not exist in the taxonomy, the value will be the name of the entry in its original language prefixed by the language 2 letter code and a colon."
}
}
},
"recycling": {
"title": "Packaging component recycling instruction",
"x-stoplight": {
"id": "376tk8e2cmyh2"
},
"type": "object",
"description": "The recycling property is canonicalized using the packaging_recycling taxonomy. Taxonomized values are available using the partial taxonomy API, the autosuggest API or the full packaging_recycling taxonomy JSON export.",
"examples": [
{
"id": "en:bottle",
"lc_name": "bouteille"
}
],
"properties": {
"id": {
"type": "string",
"description": "Canonical id of the entry in the taxonomy. If the value cannot be mapped to a taxonomy entry, the value will be the name of the entry in its original language prefixed by the language 2 letter code and a colon."
},
"lc_name": {
"type": "string",
"description": "Name of the entry in the language requested in the tags_lc field of the request. This field is returned only of tags_lc is specified. If the translation is not available, or if the entry does not exist in the taxonomy, the value will be the name of the entry in its original language prefixed by the language 2 letter code and a colon."
}
}
},
"quantity_per_unit": {
"type": "string",
"description": "Quantity (weight or volume) of food product contained in the packaging component. (e.g. 75cl for a wine bottle)"
},
"quantity_per_unit_value": {
"type": "number",
"description": "Value parsed from the quantity field."
},
"quantity_per_unit_unit": {
"type": "string",
"description": "Unit parsed and normalized from the quantity field."
},
"weight_specified": {
"type": "number",
"description": "Weight (as specified by the manufacturer) of one unit of the empty packaging component (in grams). (e.g. for a 6 pack of 1.5l water bottles, it might be 30, the weight in grams of 1 empty water bottle without its cap which is a different packaging component)."
},
"weight_measured": {
"type": "number",
"description": "Weight (as measured by one or more users) of one unit of the empty packaging component (in grams). (e.g. for a 6 pack of 1.5l water bottles, it might be 30, the weight in grams of 1 empty water bottle without its cap which is a different packaging component)."
},
"weight_estimated": {
"type": "number",
"description": "Weight (as estimated from similar products) of one unit of the empty packaging component (in grams). (e.g. for a 6 pack of 1.5l water bottles, it might be 30, the weight in grams of 1 empty water bottle without its cap which is a different packaging component)."
},
"weight": {
"type": "number",
"description": "Weight of one unit of the empty packaging component."
},
"weight_source_id": {
"type": "string",
"description": "Indicates which field was used to populate the \"weight\" field. Either \"specified\", \"measured\", or \"estimated\""
}
}
},
"readOnly": true
},
"packagings_complete": {
"title": "packagings_complete",
"type": "integer",
"minimum": 0,
"maximum": 1,
"description": "Indicate if the packagings array contains all the packaging parts of the product. This field can be set by users when they enter or verify packaging data. Possible values are 0 or 1."
},
"pnns_groups_1": {
"description": "Category of food according to [French Nutrition and Health Program](https://fr.wikipedia.org/wiki/Programme_national_nutrition_sant%C3%A9)\n",
"type": "string"
},
"pnns_groups_1_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"pnns_groups_2": {
"description": "Sub Category of food according to [French Nutrition and Health Program](https://fr.wikipedia.org/wiki/Programme_national_nutrition_sant%C3%A9)\n",
"type": "string"
},
"pnns_groups_2_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"popularity_key": {
"description": "An imprecise measurement of popularity based on Scan statistics. A higher value means higher popularity.\n",
"type": "integer"
},
"popularity_tags": {
"description": "Indicators for the popularity of a product, like the amount of scans in a specific year.\n`popularity_tags` values from previous years are kept, if there is no popularity_tags at all, then it was never popular.\nThis field must be used with care. In countries where Open Food Facts is not widely used, \na product may obtain the value \"top-90-percent-scans-2021\" with a single scan.\n",
"type": "array",
"items": {
"type": "string"
},
"example": [
"bottom-25-percent-scans-2020",
"top-85-percent-scans-2021",
"top-90-percent-scans-2022",
"top-country-it-scans-2019",
"top-100000-mg-scans-2024"
]
},
"scans_n": {
"type": "integer",
"description": "Number of scans performed with the official Open Food Facts mobile application, the last year \nfor which the product was scanned (current year excluded). This value is computed once a year by scanbot.pl.\nIt is possible that a product has never been scanned at all: `scans_n` is not given in this case.\nSee also `unique_scans_n` field.\n"
},
"unique_scans_n": {
"type": "integer",
"description": "Number of unique scans performed with the official Open Food Facts mobile application, the last year \nfor which the product was scanned (current year excluded).\nUnique scans means it is based on different IPs.\nThis value is computed once a year by scanbot.pl.\nSee also `scans_n` field.\n"
},
"serving_quantity": {
"type": "string",
"description": "Normalized version of serving_size.\nNote that this is NOT the number of servings by product.\n<small>(in perl, see `normalize_serving_size`)</small>\n"
},
"serving_quantity_unit": {
"type": "string",
"description": "The unit (either g or ml) for the correponding serving_quantity.\n",
"example": "g"
},
"serving_size": {
"type": "string",
"description": "Serving size text (generally in g or ml).\nWe expect a quantity + unit but the user is free to input any string.\n"
}
},
"patternProperties": {
"food_groups_(?<language_code>\\w\\w)": {
"type": "string",
"description": "see `food_groups`"
},
"packaging_text_(?<language_code>\\w\\w)": {
"type": "string",
"description": "Packaging text in language designated by `language_code`\n"
}
}
},
{
"type": "object",
"description": "Data about a product which is represented as tags\n",
"allOf": [
{
"type": "object",
"title": "Product Base Tags",
"properties": {
"brands": {
"type": "string",
"description": "Comma separated list of brands (not taxonomized), in the last language used to edit it (recorded in brands_lc)\nThis field is mostly used for debugging and testing purposes. Do not use it for display purposes.\n"
},
"brands_tags": {
"type": "array",
"description": "An array of indexed brands tag entries (for search).\n\nThat is the id of brands found in taxonomy + \nbrands not found in taxonomy (with case / accents / spaces normalized).\n\nThis is mostly used for search as the normalization of entries not in the taxonomy is lossy.\n",
"items": {
"title": "Indexed taxonomy tag entry (lossy, for search only)",
"type": "string",
"description": "This field is used for search only. It is a lossy representation of the taxonomy tag entry, that can be used to index the entry in a search engine.\nA tag entry, that has been matched against a taxonomy (e.g. a category, a label)\n\nThe entry is a string that can contain either:\n\n- a taxonomy entry id, in the form [2 letter language code]:[normalized canonical name] (e.g. \"en:green-teas\") -> for entries that could be matched to a taxonomy entry\n- a string in a specific language, prefixed by the 2 letter language code, and normalized (deaccented and lowercased, depending on language)\n(e.g. \"fr:thes-verts\") -> for entries that could not be matched to a taxonomy entry"
}
},
"categories": {
"type": "string",
"description": "Comma separated list of categories (not taxonomized), in the last language used to edit it (recorded in categories_lc)\nThis field is mostly used for debugging and testing purposes. Do not use it for display purposes.\n"
},
"categories_tags": {
"type": "array",
"description": "An array of indexed categories tag entries (for search).\n\nThat is the id of categories found in taxonomy + \ncategories not found in taxonomy (with case / accents / spaces normalized).\n\nThis is mostly used for search as the normalization of entries not in the taxonomy is lossy.\n",
"items": {
"title": "Indexed taxonomy tag entry (lossy, for search only)",
"type": "string",
"description": "This field is used for search only. It is a lossy representation of the taxonomy tag entry, that can be used to index the entry in a search engine.\nA tag entry, that has been matched against a taxonomy (e.g. a category, a label)\n\nThe entry is a string that can contain either:\n\n- a taxonomy entry id, in the form [2 letter language code]:[normalized canonical name] (e.g. \"en:green-teas\") -> for entries that could be matched to a taxonomy entry\n- a string in a specific language, prefixed by the 2 letter language code, and normalized (deaccented and lowercased, depending on language)\n(e.g. \"fr:thes-verts\") -> for entries that could not be matched to a taxonomy entry"
}
},
"checkers_tags": {
"type": "array",
"items": {
"type": "string",
"description": "List of checkers (users who checked the product) tags"
}
},
"cities": {
"type": "string"
},
"cities_tags": {
"type": "array",
"items": {
"type": "object"
}
},
"correctors_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"countries": {
"type": "string",
"description": "List of countries where the product is sold.\n"
},
"countries_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"ecoscore_tags": {
"description": "All ecoscore of a product.\nMost of the time it's only one value,\nbut it might eventually be more for products composed of sub-products.\nSee also: `ecoscore_score`, `ecoscore_grade`.\n",
"type": "array",
"items": {
"type": "string"
}
},
"emb_codes": {
"type": "string",
"description": "Packager code. EMB is the French system of traceability codes for packager.\n",
"example": "EMB 2013330"
},
"emb_codes_tags": {
"type": "array",
"items": {
"type": "object"
}
},
"labels": {
"type": "string"
},
"labels_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"entry_dates_tags": {
"description": "The data as a series of tag: `yyyy-mm-dd`, `yyyy-mm`, `yyyy`\n",
"type": "array",
"items": {
"type": "string"
},
"examples": [
[
"2016-03-11",
"2016-03",
"2016"
]
]
},
"manufacturing_places": {
"type": "string",
"description": "Places where the product was manufactured or transformed.\n"
},
"manufacturing_places_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"nova_groups_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"nutrient_levels_tags": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
{
"type": "object",
"properties": {
"brands_hierarchy": {
"type": "array",
"description": "An array of brands tag entries (for display and editing).\n\nThat is the id of brands found in taxonomy + \nbrands not found in taxonomy (as-is, with no normalization).\n\nThis is the field that should be used for display purposes, as it is not lossy.\n",
"items": {
"title": "Canonicalized taxonomy tag entry",
"type": "string",
"description": "A tag entry, that has been matched against a taxonomy (e.g. a category, a label)\n\nThe entry is a string that can contain either:\n\n- a taxonomy entry id, in the form [2 letter language code]:[normalized canonical name] (e.g. \"en:green-teas\") -> for entries that could be matched to a taxonomy entry\n- a string in a specific language, prefixed by the 2 letter language code (e.g. \"fr:Thés verts\") -> for entries that could not be matched to a taxonomy entry"
}
},
"brands_lc": {
"type": "string",
"description": "Language code of the last edit for brands"
},
"categories_hierarchy": {
"type": "array",
"description": "An array of categories tag entries (for display and editing).\n\nThat is the id of categories found in taxonomy + \ncategories not found in taxonomy (as-is, with no normalization).\n\nThis is the field that should be used for display purposes, as it is not lossy.\n",
"items": {
"title": "Canonicalized taxonomy tag entry",
"type": "string",
"description": "A tag entry, that has been matched against a taxonomy (e.g. a category, a label)\n\nThe entry is a string that can contain either:\n\n- a taxonomy entry id, in the form [2 letter language code]:[normalized canonical name] (e.g. \"en:green-teas\") -> for entries that could be matched to a taxonomy entry\n- a string in a specific language, prefixed by the 2 letter language code (e.g. \"fr:Thés verts\") -> for entries that could not be matched to a taxonomy entry"
}
},
"categories_lc": {
"type": "string",
"description": "Language code of the last edit for categories"
},
"countries_hierarchy": {
"type": "array",
"items": {
"type": "string"
}
},
"countries_lc": {
"type": "string",
"description": "Countries language code"
},
"emb_codes_orig": {
"type": "string"
},
"labels_hierarchy": {
"type": "array",
"items": {
"type": "string"
}
},
"labels_lc": {
"type": "string"
}
}
}
]
},
{
"type": "object",
"title": "Product-Images",
"description": "Information about Images of a product.\n\nImages ensure the reliability of Open Food Facts data.\nIt provides a primary source and proof of all the structured data.\nYou may therefore want to display it along the structured information.\n\nSee also tutorials about images:\n* [Getting images](https://openfoodfacts.github.io/openfoodfacts-server/api/how-to-download-images/)\n* [Uploading images](https://openfoodfacts.github.io/openfoodfacts-server/api/tutorial-uploading-photo-to-a-product/)\n",
"properties": {
"images": {
"description": "This contains properties for all images contained on the product.\n",
"type": "object",
"title": "product_images_properties",
"properties": {
"front": {
"title": "image_role",
"type": "object",
"description": "property of an image (or part thereof) selected for a particular role and a particular language.\n",
"properties": {
"angle": {
"type": "integer",
"example": 0,
"description": "The angle of the image rotation (if it was rotated)."
},
"coordinates_image_size": {
"type": "string",
"example": "full"
},
"geometry": {
"type": "string",
"example": "0x0--1--1"
},
"imgid": {
"type": "string",
"example": "121",
"description": "The id of the original/source image that was selected to edit(rotate, normalize etc) to produce this new image."
},
"normalize": {
"type": [
"string",
"boolean",
"null"
],
"examples": [
null,
"false",
"true"
],
"description": "Normalize colors."
},
"rev": {
"type": "string",
"example": "420"
},
"sizes": {
"type": "object",
"description": "The available image sizes for the product (both reduced and full). \nThe reduced images are the ones with numbers as the key( 100, 200 etc)\nwhile the full images have `full` as the key.\n",
"properties": {
"100": {
"type": "object",
"title": "image_size",
"description": "Width and height of an image\n",
"properties": {
"h": {
"type": "integer",
"example": 400,
"description": "The height of the reduced/full image in pixels.\n"
},
"w": {
"type": "integer",
"example": 255,
"description": "The width of the reduced/full image in pixels.\n"
}
}
},
"200": {
"type": "object",
"title": "image_size",
"description": "Width and height of an image\n",
"properties": {
"h": {
"type": "integer",
"example": 400,
"description": "The height of the reduced/full image in pixels.\n"
},
"w": {
"type": "integer",
"example": 255,
"description": "The width of the reduced/full image in pixels.\n"
}
}
},
"400": {
"type": "object",
"title": "image_size",
"description": "Width and height of an image\n",
"properties": {
"h": {
"type": "integer",
"example": 400,
"description": "The height of the reduced/full image in pixels.\n"
},
"w": {
"type": "integer",
"example": 255,
"description": "The width of the reduced/full image in pixels.\n"
}
}
},
"full": {
"type": "object",
"title": "image_size",
"description": "Width and height of an image\n",
"properties": {
"h": {
"type": "integer",
"example": 400,
"description": "The height of the reduced/full image in pixels.\n"
},
"w": {
"type": "integer",
"example": 255,
"description": "The width of the reduced/full image in pixels.\n"
}
}
}
}
},
"white_magic": {
"type": [
"string",
"boolean",
"null"
],
"examples": [
null,
"false",
"true"
],
"description": "Photo on white background : Try to remove the background.\n"
},
"x1": {
"type": "string",
"example": "-1"
},
"x2": {
"type": "string",
"example": "-1"
},
"y1": {
"type": "string",
"example": "-1"
},
"y2": {
"type": "string",
"example": "-1"
}
}
}
},
"additionalProperties": {
"type": "object",
"title": "image",
"description": "This object represent an image that was uploaded to a product.\n\"imgid\" is an integer which is a sequential number unique to each picture.\n",
"properties": {
"imgid": {
"type": "integer",
"example": 123456789,
"description": "If the image is selected as the front / ingredients / nutrition / packaging image,\nthis is the index to access the original image URL in the `images` field of the product.\nIf the image is not selected as one of these, this field is null.\n\nSo if the product has the following `images` field:\n\n```json\n\"images\": {\n 1: { ... },\n front_en: { imgid: 1, ... },\n ...\n}\n```\n\nthen the front image can be accessed by `images[1]`.\n"
},
"sizes": {
"type": "object",
"description": "The available image sizes for the product (both reduced and full).\nThe reduced images are the ones with numbers as the key( 100, 200 etc)\nwhile the full images have `full` as the key.\n",
"properties": {
"full": {
"type": "object",
"title": "image_size",
"description": "Width and height of an image\n",
"properties": {
"h": {
"type": "integer",
"example": 400,
"description": "The height of the reduced/full image in pixels.\n"
},
"w": {
"type": "integer",
"example": 255,
"description": "The width of the reduced/full image in pixels.\n"
}
}
}
},
"patternProperties": {
"(?<image_size>100|400)": {
"description": "properties of thumbnail of size `image_size`.\n**TODO** explain how to compute name\n\nFor real type: see description of property `full`.\n(Put this way because of a [bug in rapidoc](https://github.com/rapi-doc/RapiDoc/issues/880))\n",
"type": "string"
}
}
},
"uploaded_t": {
"type": "string",
"example": "1457680652",
"description": "The time the image was uploaded (as unix timestamp).\n"
},
"uploader": {
"type": "string",
"example": "openfoodfacts-contributors",
"description": "The contributor that uploaded the image.\n"
}
}
},
"propertyNames": {
"type": "integer"
},
"patternProperties": {
"(?<imgid>\\d+)": {
"description": "See property `1` to get the real type of those objects\n(Put this way because of a [bug in rapidoc](https://github.com/rapi-doc/RapiDoc/issues/880))\n",
"type": "string"
},
"(?<image_type>front|nutrition|ingredients|packaging)_(?<language_code>\\w\\w)": {
"description": "See property `front` to get the real type of those objects\n(Put this way because of a [bug in rapidoc](https://github.com/rapi-doc/RapiDoc/issues/880))\n",
"type": "string"
}
}
},
"last_image_dates_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"last_image_t": {
"description": "timestamp of last image upload (or update?)",
"type": "integer"
},
"selected_images": {
"type": "object",
"title": "product_selected_images",
"description": "URL for selected (important) images of the product.\n\nThis is very handy if you display the product to users.\n",
"properties": {
"front": {
"type": "object",
"description": "URLs of thumbnails image of image of type `image_type`",
"properties": {
"display": {
"description": "Thumbnail urls of product image (front) adapted to display on product page\n",
"type": "object",
"patternProperties": {
"(?<language_code>\\w\\w)": {
"type": "string",
"description": "url of the image for language `language_code`"
}
}
},
"small": {
"description": "Thumbnail urls of product image (front) adapted to display on product list page\n",
"type": "object",
"patternProperties": {
"(?<language_code>\\w\\w)": {
"type": "string",
"description": "url of the image for language `language_code`"
}
}
},
"thumb": {
"description": "Thumbnail urls of product image (front) in smallest format\n",
"type": "object",
"patternProperties": {
"(?<language_code>\\w\\w)": {
"type": "string",
"description": "url of the image for language `language_code`"
}
}
}
}
}
},
"patternProperties": {
"(?<image_type>front|packaging|ingredients|nutrition)": {
"description": "See property `front` to get the real type of those objects\n(Put this way because of a [bug in rapidoc](https://github.com/rapi-doc/RapiDoc/issues/880))\n",
"type": "string"
}
}
},
"image_small_url": {
"type": "string"
},
"image_thumb_url": {
"type": "string"
},
"image_url": {
"type": "string"
}
},
"patternProperties": {
"image(_(?<image_type>front|packaging|ingredients|nutrition))?(_(?<image_size>small|thumb))?_url": {
"description": "the URL of image of type `image_type` in size `image_size` (or full size if not given).\n\nThe `image_type` tells which image the url correspond to. `image_type` is `front` if not provided.\n\nThe image is the one for current language (affected by `lc` parameter) if an image exists for this language, the image in main product language otherwise.\n\n**IMPORTANT:** you should use `selected_images` field instead of this one.\n",
"type": "string"
}
}
},
{
"type": "object",
"description": "Fields related to Eco-Score for a product.\n\nSee also: `ecoscore_score`, `ecoscore_grade` and `ecoscore_tags`.\n",
"properties": {
"ecoscore_data": {
"type": "object",
"title": "product_ecoscore_data",
"description": "An object about a lot of details about data needed for Eco-Score computation\nand complementary data of interest.\n",
"properties": {
"adjustments": {
"title": "product_ecoscore_adjustments",
"type": "object",
"properties": {
"origins_of_ingredients": {
"type": "object",
"properties": {
"aggregated_origins": {
"type": "array",
"description": "List of aggregated origins of ingredients and their impact.",
"items": {
"title": "adjustments_origin_of_ingredient_aggregated",
"type": "object",
"properties": {
"epi_score": {
"type": "string"
},
"origin": {
"type": "string",
"description": "Country or region of origin for the ingredient."
},
"percent": {
"type": "integer",
"description": "Percentage of this ingredient from the specified origin."
},
"transportation_score": {
"type": [
"null",
"integer"
],
"description": "Transportation score associated with this ingredient's origin."
}
}
}
},
"epi_score": {
"type": "integer",
"description": "Environmental Performance Index (EPI) score for the ingredient's origin."
},
"epi_value": {
"type": "integer"
},
"origins_from_categories": {
"type": "array",
"description": "List of origins derived from product categories, eg for PDO.",
"items": {
"type": "string"
}
},
"origins_from_origins_field": {
"type": "array",
"description": "List of origins explicitly stated in the product's origins field.",
"items": {
"type": "string"
}
},
"transportation_score": {
"type": "integer"
},
"transportation_scores": {
"type": "object",
"propertyNames": {
"type": "string",
"enum": [
"ad",
"al",
"at",
"ax",
"ba",
"be",
"bg",
"ch",
"cy",
"cz",
"de",
"dk",
"dz",
"ee",
"eg",
"es",
"fi",
"fo",
"fr",
"gg",
"gi",
"gr",
"hr",
"hu",
"ie",
"il",
"im",
"is",
"it",
"je",
"lb",
"li",
"lt",
"lu",
"lv",
"ly",
"ma",
"mc",
"md",
"me",
"mk",
"mt",
"nl",
"no",
"pl",
"ps",
"pt",
"ro",
"rs",
"se",
"si",
"sj",
"sk",
"sm",
"sy",
"tn",
"tr",
"ua",
"uk",
"us",
"va",
"world",
"xk"
]
},
"additionalProperties": {
"type": "number",
"default": 0
}
},
"transportation_value": {
"type": "integer"
},
"transportation_values": {
"type": "object",
"propertyNames": {
"type": "string",
"enum": [
"ad",
"al",
"at",
"ax",
"ba",
"be",
"bg",
"ch",
"cy",
"cz",
"de",
"dk",
"dz",
"ee",
"eg",
"es",
"fi",
"fo",
"fr",
"gg",
"gi",
"gr",
"hr",
"hu",
"ie",
"il",
"im",
"is",
"it",
"je",
"lb",
"li",
"lt",
"lu",
"lv",
"ly",
"ma",
"mc",
"md",
"me",
"mk",
"mt",
"nl",
"no",
"pl",
"ps",
"pt",
"ro",
"rs",
"se",
"si",
"sj",
"sk",
"sm",
"sy",
"tn",
"tr",
"ua",
"uk",
"us",
"va",
"world",
"xk"
]
},
"additionalProperties": {
"type": "number",
"default": 0
}
},
"value": {
"type": "integer"
},
"values": {
"type": "object",
"propertyNames": {
"type": "string",
"enum": [
"ad",
"al",
"at",
"ax",
"ba",
"be",
"bg",
"ch",
"cy",
"cz",
"de",
"dk",
"dz",
"ee",
"eg",
"es",
"fi",
"fo",
"fr",
"gg",
"gi",
"gr",
"hr",
"hu",
"ie",
"il",
"im",
"is",
"it",
"je",
"lb",
"li",
"lt",
"lu",
"lv",
"ly",
"ma",
"mc",
"md",
"me",
"mk",
"mt",
"nl",
"no",
"pl",
"ps",
"pt",
"ro",
"rs",
"se",
"si",
"sj",
"sk",
"sm",
"sy",
"tn",
"tr",
"ua",
"uk",
"us",
"va",
"world",
"xk"
]
},
"additionalProperties": {
"type": "number",
"default": 0
}
},
"warning": {
"type": "string"
}
}
},
"packaging": {
"type": "object",
"properties": {
"non_recyclable_and_non_biodegradable_materials": {
"type": "integer"
},
"packagings": {
"type": "array",
"items": {
"type": "object",
"title": "adjustments_packaging_item",
"properties": {
"ecoscore_material_score": {
"type": "integer"
},
"ecoscore_shape_ratio": {
"type": "integer"
},
"material": {
"type": "string"
},
"shape": {
"type": "string"
},
"number_of_units": {
"type": "integer",
"examples": [
1
]
},
"quantity_per_unit": {
"type": "string",
"description": "The quantity per packaging unit, as a string.",
"examples": [
"33 cL"
]
},
"quantity_per_unit_unit": {
"type": "string",
"examples": [
"cl"
]
},
"quantity_per_unit_value": {
"type": "number",
"examples": [
33
]
},
"recycling": {
"type": "string",
"examples": [
"en:recycle-in-sorting-bin"
]
},
"weight_measured": {
"type": "number",
"examples": [
12.08
]
}
}
}
},
"score": {
"type": "integer"
},
"value": {
"type": "integer"
},
"warning": {
"type": "string"
}
}
},
"production_system": {
"type": "object",
"properties": {
"labels": {
"type": "array",
"examples": [
"vegan",
"fat free",
"Kosher"
],
"items": {
"type": "string"
}
},
"value": {
"type": "integer"
},
"warning": {
"type": "string"
}
}
},
"threatened_species": {
"type": "object",
"properties": {
"ingredient": {
"type": "string"
},
"value": {
"type": "integer"
}
}
}
}
},
"agribalyse": {
"type": "object",
"properties": {
"agribalyse_proxy_food_code": {
"type": "string"
},
"agribalyse_food_code": {
"type": "string"
},
"co2_agriculture": {
"type": "number"
},
"co2_consumption": {
"type": "integer"
},
"co2_distribution": {
"type": "number"
},
"co2_packaging": {
"type": "number"
},
"co2_processing": {
"type": "number"
},
"co2_total": {
"type": "number"
},
"co2_transportation": {
"type": "number"
},
"code": {
"type": "string"
},
"dqr": {
"type": "string"
},
"ef_agriculture": {
"type": "number"
},
"ef_consumption": {
"type": "integer"
},
"ef_distribution": {
"type": "number"
},
"ef_packaging": {
"type": "number"
},
"ef_processing": {
"type": "number"
},
"ef_total": {
"type": "number"
},
"ef_transportation": {
"type": "number"
},
"is_beverage": {
"type": "integer"
},
"name_en": {
"type": "string",
"description": "This can be returned in many other languages\nlike name_fr (for french).\n"
},
"score": {
"type": "integer"
},
"version": {
"type": "string"
}
}
},
"grade": {
"type": "string"
},
"grades": {
"type": "object",
"patternProperties": {
"(?<country_code>\\w\\w)": {
"type": "string"
}
}
},
"missing": {
"type": "object",
"properties": {
"labels": {
"type": "integer"
},
"origins": {
"type": "integer"
},
"packagings": {
"type": "integer"
}
}
},
"missing_data_warning": {
"type": "integer"
},
"previous_data": {
"type": "object",
"properties": {
"grade": {
"type": [
"string",
"null"
]
},
"score": {
"type": [
"integer",
"null"
]
},
"agribalyse": {
"type": "object",
"properties": {
"agribalyse_proxy_food_code": {
"type": "string"
},
"agribalyse_food_code": {
"type": "string"
},
"co2_agriculture": {
"type": "number"
},
"co2_consumption": {
"type": "integer"
},
"co2_distribution": {
"type": "number"
},
"co2_packaging": {
"type": "number"
},
"co2_processing": {
"type": "number"
},
"co2_total": {
"type": "number"
},
"co2_transportation": {
"type": "number"
},
"code": {
"type": "string"
},
"dqr": {
"type": "string"
},
"ef_agriculture": {
"type": "number"
},
"ef_consumption": {
"type": "integer"
},
"ef_distribution": {
"type": "number"
},
"ef_packaging": {
"type": "number"
},
"ef_processing": {
"type": "number"
},
"ef_total": {
"type": "number"
},
"ef_transportation": {
"type": "number"
},
"is_beverage": {
"type": "integer"
},
"name_en": {
"type": "string",
"description": "This can be returned in many other languages\nlike name_fr (for french).\n"
},
"score": {
"type": "integer"
},
"version": {
"type": "string"
}
}
}
}
},
"score": {
"type": "integer"
},
"scores": {
"type": "object",
"patternProperties": {
"(?<country_code>\\w\\w)": {
"type": "integer"
}
}
},
"status": {
"type": "string"
}
}
},
"ecoscore_extended_data_version": {
"type": "string"
},
"environment_impact_level": {
"type": "string"
},
"environment_impact_level_tags": {
"type": "array",
"items": {
"type": "object"
}
}
}
},
{
"$ref": "#/components/schemas/Product-Ingredients"
},
{
"type": "object",
"title": "product_nutrition",
"description": "Nutrition fields of a product\n\nMost of these properties are read-only.\n\nSee [how to add nutrition data](https://openfoodfacts.github.io/openfoodfacts-server/api/ref-cheatsheet/#add-nutrition-facts-values-units-and-base)\n",
"properties": {
"no_nutrition_data": {
"type": "string",
"description": "When a product does not have nutrition data displayed on the\npackaging, the user can check the field \"Nutrition facts are\nnot specified on the product\".\nBy doing so, the no_nutrition_data field takes the value \"on\".\nThis case is frequent (thousands of products).\n",
"example": "on"
},
"nutrition_data_per": {
"type": "string",
"enum": [
"serving",
"100g"
],
"description": "The nutrition data on the package can be per serving or per 100g.\n\nThis is essential to understand if `<nutrient>_value` and `<nutrient>`\nvalues in `nutriments` applies for a serving or for 100g.\n\n**IMPORTANT:**\nWhen writing products,\nthis setting applies to all existing nutrients values for the product,\nnot only the nutrient values sent in the write request.\nSo it should not be changed unless all nutrients values are provided\nwith values that match the nutrition_data_per field.\n"
},
"nutrition_data_prepared_per": {
"type": "string",
"enum": [
"serving",
"100g"
],
"description": "The nutrition data for prepared product on the package (if any) can be per serving or per 100g.\n\nThis is essential to understand if `<nutrient>_prepared_value` and `<nutrient>_prepared`\nvalues in `nutriments` applies for a serving or for 100g.\n\nSee also important note on `nutrition_data_per`.\n"
},
"nutriments": {
"type": "object",
"description": "All known nutrients for the product.\n\nNote that each nutrients are declined with a variety of suffixes like `_100g`, `_serving`,\nsee patternProperties below.\n\nA specific `_unit` is the unit of the value that was entered by the contributor (a user or the manufacturer).\nIt is not necessarily the unit that is printed on the product, as some apps may force specific units when writing nutrient values.\n\nBeware that some properties are to be interpreted based upon `nutrition_data_per` value.\n\nFor most use cases, you should use the `<nutrient>_100g` or `<nutrient>_serving` fields, as they are always in the same standard unit, for a specific quantity (100g or 1 serving).\n\nFor products that have a nutrition table for prepared product\n(eg. the nutrition facts for a bowl of milk with cocoa powder),\na `_prepared` suffix is added (before other suffixes).\n\nYou can get all possible nutrients from the\n[nutrients taxonomy](https://static.openfoodfacts.org/data/taxonomies/nutrients.json)\n\n**FIXME** add more nutrients with description.\n",
"properties": {
"alcohol": {
"description": "Quantity of alcohol\n\n(per 100g or per serving) in a standard unit (g or ml)\n",
"type": "number"
},
"carbohydrates": {
"description": "This is the available carbohydrates (excluding fiber), also known as net carbohydrates",
"type": "number"
},
"carbohydrates-total": {
"description": "This follows the US / Canada definition of carbohydrates which includes fiber, also known as gross carbohydrates",
"type": "number"
},
"energy": {
"type": "number",
"description": "It is the same as `energy-kj` if we have it, or computed from `energy-kcal` otherwise\n\n(per 100g or per serving) in kj\n"
},
"energy_value": {
"type": "number",
"description": "energy_value will be equal to energy-kj_value if we have it or to energy-kcal_value otherwise\n"
},
"energy_unit": {
"type": "string",
"enum": [
"kcal",
"kJ"
],
"description": "Equal to energy-kj_unit if we have it or to energy-kcal_unit otherwise\n"
},
"energy-kcal": {
"type": "number",
"description": "energy in kcal, if it is specified\n\n(per 100g or per serving) in a standard unit (g or ml)\n"
},
"energy-kj": {
"type": "number",
"description": "energy in kj, if it is specified\n\n(per 100g or per serving) in a standard unit (g or ml)\n"
},
"fat": {
"type": "number"
},
"fruits-vegetables-legumes-estimate-from-ingredients": {
"type": "number",
"description": "An estimate, from the ingredients list of the percentage of fruits, vegetable and legumes.\nThis is an important information for Nutri-Score (2023 version) computation.\n"
},
"fruits-vegetables-nuts-estimate-from-ingredients": {
"type": "number",
"description": "An estimate, from the ingredients list of the percentage of fruits, vegetable and nuts.\nThis is an important information for Nutri-Score (2021 version) computation.\n"
},
"nova-group": {
"type": "integer"
},
"nutrition-score-fr": {
"description": "Experimental nutrition score derived from\nthe UK FSA score and adapted for the French market\n(formula defined by the team of Professor Hercberg).\n"
},
"proteins": {
"type": "number"
},
"salt": {
"type": "number"
},
"saturated-fat": {
"type": "number"
},
"sodium": {
"type": "number"
},
"sugars": {
"type": "number"
},
"carbon-footprint-from-known-ingredients_product": {
"type": "integer"
},
"carbon-footprint-from-known-ingredients_serving": {
"type": "number"
},
"erythritol": {
"type": "number",
"description": "erythritol is a polyol which is not providing any energy.\nAs such, it needs not be taken into account when computing\nthe energy of a product. Eryhtritol is now displayed on\nnutrition facts sheet of some products, mainly in the USA.\nThis value is entered either by contributors, either by\nimports.\n",
"example": 12.5
}
},
"patternProperties": {
"(?<nutrient>[\\w-]+)_unit": {
"description": "The unit of the value entered by the contributor (a user or the manufacturer), for the product as sold (not prepared).\nIn most cases, this unit is the unit displayed on the product for the nutrient, but it is not guaranteed, as some apps may force specific units when writing nutrient values. \n\nThe possible values depends on the nutrient.\n\n* `g` for grams\n* `mg` for milligrams\n* `μg` for micrograms\n* `cl` for centiliters\n* `ml` for mililiters\n* `dv` for recommended daily intakes (aka [Dietary Reference Intake](https://en.wikipedia.org/wiki/Dietary_Reference_Intake))\n* `% vol` for alcohol vol per 100 ml\n\n🤓 code: see the [Units module][units-module],\nand [Food:default_unit_for_nid function][default-unit]\n\n[units-module]: https://openfoodfacts.github.io/openfoodfacts-server/dev/ref-perl-pod/ProductOpener/Units.html\n[default-unit]: https://openfoodfacts.github.io/openfoodfacts-server/dev/ref-perl-pod/ProductOpener/Food.html#default_unit_for_nid_(_%24nid)\n\n**Note**: For most use cases, you should not use this unit, as it can change depending on how the value was entered.\nInstead use the `<nutrient>_100g` or `<nutrient>_serving` fields, and convert them to the unit you need.\n",
"type": "string",
"enum": [
"公斤",
"公升",
"kg",
"кг",
"l",
"л",
"毫克",
"mg",
"мг",
"mcg",
"µg",
"oz",
"fl oz",
"dl",
"дл",
"cl",
"кл",
"斤",
"g",
"",
" ",
"kJ",
"克",
"公克",
"г",
"мл",
"ml",
"mmol/l",
"毫升",
"% vol",
"ph",
"%",
"% dv",
"% vol (alcohol)",
"iu",
"mol/l",
"mval/l",
"ppm",
"�rh",
"�fh",
"�e",
"�dh",
"gpg"
]
},
"(?<nutrient>[\\w-]+)_100g": {
"description": "The normalized value of the nutrient for 100g (or 100ml for liquids), in a standard unit, for the product as sold (not prepared):\n* g for all nutrients that are measured by weight (e.g. fat, proteins, carbohydrates, sodium, vitamins, minerals etc.)\n* % vol for nutrients that are percentages by volume (e.g. alcohol)\n* kJ for energy and energy-kj\n* kcal for energy-kcal\n* no unit for pH\n\nThis is computed from the `nutrient` property,\nthe serving size (if `nutrient` is per serving), and the `nutrient`_unit field.\n\n**Note**:\nFor most use cases, this is the only value you should use, as it is always in the same unit, and always per 100g or 100ml.\n",
"type": "number",
"readOnly": true
},
"(?<nutrient>[\\w-]+)_serving": {
"description": "The normalized value of the nutrient for one serving, in a standard unit:\n- g for most nutrients\n- % for nutrients that are percentages (e.g. alcohol)\n- kJ for energy and energy-kj\n- kcal for energy-kcal\n\nThis is computed from the `nutrient` property,\nthe serving size (if `nutrient` is per 100g), and the `nutrient`_unit field.\n",
"type": "number",
"readOnly": true
},
"(?<nutrient>[\\w-]+)_value": {
"description": "The value entered by the contributor (a user or the manufacturer).\nIn most cases, the unit of the value is the unit displayed on the product for the nutrient, but it is not guaranteed, as some apps may force specific units when writing nutrient values. \n\n* per 100g or serving, depending on `nutrition_data_per` field.\n* in the unit of the corresponding <nutrient>_unit field.\n\n**Note**: For most use cases, you should not use this value, as it can be in different units, and can be per 100g or per serving.\n",
"type": "number",
"readOnly": true
},
"(?<nutrient>[\\w-]+)_prepared": {
"description": "Same as '(?<nutrient>[\\w-]+)', for the prepared product (not as sold).\n",
"type": "number"
},
"(?<nutrient>[\\w-]+)_prepared_unit": {
"description": "Same as '(?<nutrient>[\\w-]+)_unit', for the prepared product (not as sold).\n",
"type": "string"
},
"(?<nutrient>[\\w-]+)_prepared_100g": {
"description": "Same as '(?<nutrient>[\\w-]+)_100g', for the prepared product (not as sold).\n",
"type": "number",
"readOnly": true
},
"(?<nutrient>[\\w-]+)_prepared_serving": {
"description": "Same as '(?<nutrient>[\\w-]+)_serving', for the prepared product (not as sold).\n",
"type": "number",
"readOnly": true
},
"(?<nutrient>[\\w-]+)_prepared_value": {
"description": "Same as '(?<nutrient>[\\w-]+)_value', for the prepared product (not as sold).\n",
"type": "number",
"readOnly": true
}
}
},
"nutriscore_data": {
"description": "Detail of data the Nutri-Score was computed upon.\n\n**Note**: this might not be stable, don't rely too much on this, or, at least, tell us !\n\n**TODO** document each property\n",
"type": "object",
"properties": {
"saturated_fat_ratio": {
"type": "number"
},
"saturated_fat_ratio_points": {
"type": "integer"
},
"saturated_fat_ratio_value": {
"type": "number"
}
}
},
"nutrition_grade_fr": {
"type": "string",
"description": "Nutrition grade (‘a’ to ‘e’),\nhttps://world.openfoodfacts.org/nutriscore.\n"
},
"nutrition_grades": {
"description": "Nutrition grades as a comma separated list.\n\nSome products with multiple components might have multiple Nutri-Score\n",
"type": "string"
},
"nutrition_grades_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"nutrition_score_beverage": {
"type": "integer"
},
"nutrition_score_warning_fruits_vegetables_nuts_estimate_from_ingredients": {
"type": "integer"
},
"nutrition_score_warning_fruits_vegetables_nuts_estimate_from_ingredients_value": {
"type": "integer"
},
"nutrition_score_warning_no_fiber": {
"type": "integer"
},
"other_nutritional_substances_tags": {
"type": "array",
"items": {
"type": "object"
}
},
"unknown_nutrients_tags": {
"type": "array",
"items": {
"type": "object"
}
},
"vitamins_tags": {
"type": "array",
"items": {
"type": "object"
}
}
}
},
{
"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"
}
}
},
{
"type": "object",
"description": "This is data that is linked to products data quality\n",
"properties": {
"data_quality_bugs_tags": {
"type": "array",
"items": {
"type": "string",
"description": "Each data quality bug describes a data quality bug on the product.\n\nRefer to the [data quality taxonomy](https://static.openfoodfacts.org/data/taxonomies/data_quality.json)\n"
}
},
"data_quality_errors_tags": {
"type": "array",
"items": {
"type": "string",
"description": "Each Data Quality Error describes a data quality error on the product.\n\nRefer to the [data quality taxonomy](https://static.openfoodfacts.org/data/taxonomies/data_quality.json)\n"
}
},
"data_quality_info_tags": {
"type": "array",
"items": {
"type": "string",
"description": "Each Data Quality Info describes a data quality info on the product.\n\nRefer to the [data quality taxonomy](https://static.openfoodfacts.org/data/taxonomies/data_quality.json)\n"
}
},
"data_quality_tags": {
"type": "array",
"items": {
"type": "string",
"description": "Each Data Quality tag describes a data quality issue on the product.\n\nRefer to the [data quality taxonomy](https://static.openfoodfacts.org/data/taxonomies/data_quality.json)\n"
}
},
"data_quality_warnings_tags": {
"type": "array",
"items": {
"type": "string",
"description": "Each Data Quality warning tag describes a data quality warning on the product.\n\nRefer to the [data quality taxonomy](https://static.openfoodfacts.org/data/taxonomies/data_quality.json)\n"
}
},
"data_sources": {
"type": "string",
"description": "Source of data imported from producers.\n"
},
"data_sources_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"last_check_dates_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"last_checked_t": {
"type": "integer"
},
"last_checker": {
"type": "string"
},
"states": {
"description": "comma separated list of values indicating some states of the product,\nlike things to be done, or to be completed.\nSee [states taxonomy](https://static.openfoodfacts.net/data/taxonomies/states.json)\n",
"type": "string"
},
"states_hierarchy": {
"type": "array",
"items": {
"type": "string"
}
},
"states_tags": {
"type": "array",
"items": {
"description": "Each state describe something that is completed or is to be done or improved on the product.\n\nRefer to [states taxonomy](https://static.openfoodfacts.net/data/taxonomies/states.json)\n",
"type": "string"
}
},
"misc_tags": {
"description": "Information about different aspect of the product\n Refer to [misc taxonomy](https://static.openfoodfacts.org/data/taxonomies/misc.json)\n",
"type": "array",
"items": {
"type": "string"
}
}
}
},
{
"title": "product_extended",
"type": "object",
"properties": {
"additives_original_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"additives_prev_original_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"added_countries_tags": {
"type": "array",
"items": {
"type": "object"
}
},
"allergens_from_ingredients": {
"type": "string"
},
"allergens_from_user": {
"type": "string"
},
"amino_acids_prev_tags": {
"type": "array",
"items": {
"type": "object"
}
},
"amino_acids_tags": {
"type": "array",
"items": {
"type": "object"
}
},
"carbon_footprint_percent_of_known_ingredients": {
"type": "integer"
},
"categories_properties": {
"type": "object",
"properties": {
"agribalyse_food_code:en": {
"type": "string"
},
"agribalyse_proxy_food_code:en": {
"type": "string"
},
"ciqual_food_code:en": {
"type": "string"
}
}
},
"categories_properties_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"category_properties": {
"type": "object",
"additionalProperties": {
"description": "those are properties taken from the category taxonomy",
"type": "string"
}
},
"ciqual_food_name_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"compared_to_category": {
"type": "string",
"description": "the category to use for comparison.\n\n**TODO** explain how it is chosen.\n"
},
"conservation_conditions": {
"type": "string"
},
"customer_service": {
"type": "string",
"description": "Contact info of customer service.\n"
},
"expiration_date": {
"type": "string"
},
"link": {
"type": "string",
"description": "link to the product on the website of the producer\n"
},
"main_countries_tags": {
"type": "array",
"items": {
"type": "object"
}
},
"minerals_prev_tags": {
"type": "array",
"items": {
"type": "object"
}
},
"minerals_tags": {
"type": "array",
"items": {
"type": "object"
}
},
"owner_fields": {
"type": "object",
"description": "Those are fields provided by the producer (through producers platform),\nand the value he provided.\n",
"properties": {
"additionalProperties": {
"description": "you can retrieve all kind of properties, the same as on the parent object (the product).\nIt's not processed entries (like tags for example) but raw ones.\n",
"oneOf": [
{
"type": "integer"
},
{
"type": "string"
},
{
"type": "object"
}
]
}
}
},
"nova_groups_markers": {
"type": "object",
"description": "Detail of ingredients or processing that makes the products having Nova 3 or 4\n",
"propertyNames": {
"description": "Markers of level 3, 4, ...",
"type": "integer",
"enum": [
3,
4
]
},
"additionalProperties": {
"type": "array",
"items": {
"type": "array",
"items": {
"description": "This array has two elements for each marker. The first element is the tag type of the marker (e.g. \"ingredients\", \"additives\", \"categories\"), and the second is the tag id in the taxonomy (e.g. \"en:e471\")",
"type": "string"
}
}
}
},
"nucleotides_tags": {
"type": "array",
"items": {
"type": "object"
}
},
"origin": {
"type": "string"
},
"purchase_places": {
"type": "string",
"description": "Country, state, or city where the product can be purchased.\n",
"example": "Paris"
},
"purchase_places_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"stores": {
"type": "string",
"description": "Distributor name.\n",
"example": "Walmart"
},
"stores_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"traces_from_ingredients": {
"type": "string"
},
"traces_from_user": {
"type": "string"
}
},
"patternProperties": {
"conservation_conditions_(?<language_code>\\w\\w)": {
"type": "string"
},
"customer_service_(?<language_code>\\w\\w)": {
"type": "string"
},
"origin_(?<language_code>\\w\\w)": {
"type": "string",
"description": "`origin` in language indicated by `language_code`\n"
}
}
},
{
"type": "object",
"description": "Metadata of a product (author, editors, creation date, etc.)\n",
"required": [
"created_t",
"creator",
"last_modified_by",
"last_modified_t",
"last_updated_t",
"rev"
],
"properties": {
"created_t": {
"type": "integer",
"description": "Date when the product was added (UNIX timestamp format).\nSee also `entry_dates_tags`\n",
"example": 1457680652
},
"creator": {
"type": "string",
"description": "The contributor who added the product first.\n"
},
"editors_tags": {
"description": "List of editors who edited the product.\n",
"type": "array",
"items": {
"type": "string"
}
},
"informers_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"interface_version_created": {
"type": "string"
},
"interface_version_modified": {
"type": "string"
},
"languages": {
"type": "object",
"patternProperties": {
"en:(?<language_name>\\w\\w)": {
"type": "integer",
"description": "**TODO** explain !\n"
}
}
},
"languages_codes": {
"type": "object",
"patternProperties": {
"(?<language_code>\\w\\w)": {
"type": "integer"
}
},
"description": "Same as `languages` but by language code, instead of language tags\n"
},
"languages_hierarchy": {
"type": "array",
"items": {
"type": "string"
}
},
"languages_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"last_edit_dates_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"last_editor": {
"type": "string"
},
"last_modified_by": {
"type": "string",
"description": "The username of the user who last modified the product.\n",
"example": "sebleouf"
},
"last_modified_t": {
"type": "integer",
"description": "Date when the product page was last modified.\nThis date is updated only when primary data is modified (data entered by the user or updated by an interface)\n"
},
"last_updated_t": {
"type": "integer",
"description": "Date when the product page was last modified.\nThis date is updated when primary data or secondary data is modified\n(primary: data entered by a user or read from an interface, secondary: data computed by a utility\nsuch as update_all_products.pl)\n"
},
"owner": {
"description": "Id of the producer in case he provides his own data about a product (producer platform).\n",
"type": "string"
},
"owners_tags": {
"description": "Tagyfied version of owner\n",
"type": "string"
},
"photographers_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"rev": {
"description": "revision number of this product version (each edit adds a revision)",
"type": "integer"
},
"sources": {
"type": "array",
"items": {
"type": "object",
"title": "product_meta_source",
"properties": {
"fields": {
"type": "array",
"items": {
"type": "string"
}
},
"id": {
"type": "string"
},
"images": {
"type": "array",
"items": {
"type": "object"
}
},
"import_t": {
"type": "integer"
},
"manufacturer": {
"type": [
"integer",
"string"
]
},
"name": {
"type": "string"
},
"source_licence": {
"type": "string"
},
"source_licence_url": {
"type": "string"
},
"url": {
"type": [
"null",
"string"
]
}
}
}
},
"sources_fields": {
"type": "object",
"title": "product_meta_source_fields",
"properties": {
"org-gs1": {
"type": "object",
"properties": {
"gln": {
"type": "string"
},
"gpcCategoryCode": {
"type": "string"
},
"gpcCategoryName": {
"type": "string"
},
"isAllergenRelevantDataProvided": {
"type": "string"
},
"lastChangeDateTime": {
"type": "string"
},
"partyName": {
"type": "string"
},
"productionVariantDescription": {
"type": "string"
},
"publicationDateTime": {
"type": "string"
}
}
}
}
},
"teams": {
"type": "string"
},
"teams_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"update_key": {
"type": "string"
}
}
},
{
"type": "object",
"description": "Knowledge panels for a product\n",
"properties": {
"knowledge_panels": {
"type": "object",
"title": "panels",
"description": "The panels object is a dictionary of individual panel objects.\nEach key of the dictionary is the id of the panel, and the value is the panel object.\n\nApps typically display a number of root panels with known panel ids (e.g. health_card and environment_card). Panels can reference other panels and display them as sub-panels.",
"examples": [
{
"additionalProperties": "string"
}
],
"additionalProperties": {
"title": "panel",
"type": "object",
"description": "Each panel contains an optional title and an optional array of elements.",
"properties": {
"type": {
"type": "string",
"description": "Type of the panel. If set to \"card\", the panel and its sub-panels should be displayed in a card. If set to \"inline\", the panel should have its content always displayed."
},
"expanded": {
"type": "boolean",
"description": "If true, the panel is to be displayed already expanded. If false, only the title should be displayed, and the user should be able to click or tap it to open the panel and display the elements."
},
"expand_for": {
"type": "string",
"description": "If set to \"large\", the content of the panel should be expanded on large screens, but it should still be possible to unexpand it."
},
"evaluation": {
"type": "string",
"description": "An evaluation status specifically for this title element. This can be used to directly color the icon if 'icon_color_from_evaluation' is true and this field is present, or it might provide context for the title itself. e.g. bad is red. Please be careful in choosing colors, to avoid 50 shades of red.",
"example": "bad",
"enum": [
"good",
"average",
"neutral",
"bad",
"unknown"
]
},
"half_width_on_mobile": {
"type": "boolean",
"description": "If true, suggests that this panel could be rendered as half-width on mobile devices, allowing for side-by-side display with another half-width panel if applicable.",
"example": true
},
"title_element": {
"title": "title_element",
"x-stoplight": {
"id": "lox0wvl9bdgy2"
},
"type": "object",
"description": "The title of a panel.",
"properties": {
"name": {
"type": "string",
"description": "A short name of this panel, not including any actual values. e.g. \"Fat\""
},
"title": {
"type": "string"
},
"subtitle": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"grade",
"percentage",
"string"
],
"description": "Used to indicate how the value of this item is measured, such as \"grade\" for Nutri-Score and Green-Score or \"percentage\" for Salt"
},
"grade": {
"type": "string",
"description": "The value for this panel where it corresponds to a A to E grade such as the Nutri-Score or the Green-Score.",
"enum": [
"a+",
"a",
"b",
"c",
"d",
"e",
"f",
"unknown"
]
},
"value": {
"type": "number",
"description": "The numeric value of the panel, where the type is \"percentage\""
},
"value_string": {
"type": "string",
"description": "The string value of the panel, for cases where the value is not numeric"
},
"icon_url": {
"type": "string"
},
"icon_color_from_evaluation": {
"type": "string"
},
"icon_size": {
"type": "string",
"description": "If set to \"small\", the icon should be displayed at a small size.\n"
}
}
},
"elements": {
"type": "array",
"description": "An ordered list of elements to display in the content of the panel.",
"items": {
"title": "element",
"x-stoplight": {
"id": "e2ybdrtmx0tme"
},
"type": "object",
"description": "Each element object contains one specific element object such as a text element or an image element.\n",
"properties": {
"element_type": {
"type": "string",
"enum": [
"text",
"image",
"action",
"panel",
"panel_group",
"table"
],
"description": "The type of the included element object.\nThe element_type also indicates which field contains the included element object.\ne.g. if the element_type is \"text\", the included element object will be in the \"text_element\" field.\n\nNote that in the future, new type of element may be added,\nso your code should ignore unrecognized types, and unknown properties.\n\nTODO: add Map type\n"
},
"text_element": {
"title": "text_element",
"x-stoplight": {
"id": "vdwxlt73qnqfa"
},
"type": "object",
"description": "A text in simple HTML format to display.\n\nFor some specific texts that correspond to a product field (e.g. a product name, the ingredients list of a product),the edit_field_* fields are used to indicate how to edit the field value.",
"properties": {
"type": {
"type": "string",
"description": "the type of text, might influence the way you display it.\n",
"enum": [
"summary",
"warning",
"notes"
]
},
"html": {
"type": "string",
"description": "Text to display in HTML format."
},
"language": {
"type": "string",
"description": "Language of the text. The name of the language is returned in the language requested when making the API call. e.g. if the text is in Polish, and the requested language is French, the language field will contain \"Polonais\" (French for \"Polish\"). Only set for specific fields such as the list of ingredients of a product."
},
"lc": {
"type": "string",
"description": "2 letter language code for the text. Only set for specific fields such as the list of ingredients of a product."
},
"edit_field_id": {
"type": "string",
"description": "id of the field used to edit this text in the product edit API."
},
"edit_field_type": {
"type": "string",
"description": "Type of the product field."
},
"edit_field_value": {
"type": "string",
"description": "Current value of the product field. This may differ from the html field which can contain extra formating."
},
"source_url": {
"type": "string",
"description": "Link to the source",
"example": "https://en.wikipedia.org/wiki/Sodium acetate"
},
"source_text": {
"type": "string",
"description": "name of the source",
"example": "Wikipedia"
},
"source_lc": {
"type": "string",
"description": "Source locale name",
"example": "en"
},
"source_language": {
"type": "string",
"description": "Human readable source locale name",
"example": "English"
}
}
},
"image_element": {
"title": "image_element",
"x-stoplight": {
"id": "k4v4kwt489q3j"
},
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "full URL of the image"
},
"width": {
"type": "integer",
"description": "Width of the image.\n\nThis is just a suggestion coming from the server, \nthe client may choose to use its own dimensions for the image.\n"
},
"height": {
"type": "integer",
"description": "Height of the image.\n\nThis is just a suggestion coming from the server,\nthe client may choose to use its own dimensions for the image.\n"
},
"alt_text": {
"type": "string",
"description": "Alt Text of the image."
}
}
},
"action_element": {
"title": "action_element",
"type": "object",
"properties": {
"title": {
"type": "string"
},
"actions": {
"type": "array",
"description": "The ids of the actions to show.",
"items": {
"type": "string",
"description": "The id of the action to show.",
"examples": [
"edit_product",
"add_categories"
]
}
}
},
"description": "The action element is used to display a title and a list of actions like editing a product or adding categories."
},
"panel_element": {
"title": "panel_element",
"x-stoplight": {
"id": "ymx41elz4yrnj"
},
"type": "object",
"description": "Panels can include other panels as sub-panels using the panel_element.",
"properties": {
"panel_id": {
"type": "string",
"description": "The id of the panel to include. The id is the key of the panel in the panels object returned in the knowledge_panels field."
}
}
},
"panel_group_element": {
"title": "panel_group_element",
"x-stoplight": {
"id": "b7emlfrgiuue2"
},
"type": "object",
"properties": {
"title": {
"type": "string"
},
"panel_ids": {
"type": "array",
"description": "The ids of the panels to include. The ids are the keys of the panels in the panels object returned in the knowledge_panels field.",
"items": {
"type": "string"
}
},
"image": {
"type": "object",
"description": "An image related to the panel group (e.g. the ingredients or nutrition facts image for the ingredients and nutrition panel groups)."
}
},
"description": "The panel group element is used to display an optional title followed by a number of sub-panels."
},
"table_element": {
"title": "table_element",
"type": "object",
"description": "Element to display a table.",
"properties": {
"id": {
"type": "string",
"description": "An id for the table."
},
"table_type": {
"type": "string",
"description": "Type of table (e.g. \"percents\" for tables with percentage columns)"
},
"title": {
"type": "string",
"description": "Title of the table.\n"
},
"columns": {
"type": "array",
"items": {
"type": "object",
"title": "table_column",
"properties": {
"text": {
"type": "string",
"description": "Column header text"
},
"type": {
"type": "string",
"description": "Column type (e.g. \"text\", \"percent\")"
},
"text_for_small_screens": {
"type": "string",
"description": "Alternative text for small screens"
},
"style": {
"type": "string",
"description": "CSS style for the column"
},
"column_group_id": {
"type": "string"
},
"shown_by_default": {
"type": "boolean"
}
}
}
},
"rows": {
"type": "array",
"description": "Array of table rows",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Row ID"
},
"style": {
"type": "string",
"description": "CSS style for the row"
},
"values": {
"type": "array",
"description": "Array of cell values",
"items": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Cell text content"
},
"icon_url": {
"type": "string",
"description": "URL of an icon to display in the cell"
},
"percent": {
"type": "number",
"description": "Percentage value for progress bars (used with percent columns)"
},
"evaluation": {
"type": "string",
"description": "Evaluation level (good, bad, neutral, etc.) for styling"
},
"level": {
"type": "integer",
"description": "Indentation level"
},
"style": {
"type": "string",
"description": "CSS style for the cell"
}
}
}
}
}
}
}
}
}
},
"required": [
"element_type"
]
}
},
"level": {
"type": "string",
"description": "a message level, as levels we use in log.\nIt might help theming the panel visually. Some possible values: info, recommendation\n",
"example": "info"
},
"size": {
"type": "string",
"enum": [
"small"
],
"description": "size is either empty (normal display) \nor small to indicate a panel that should have a smaller font size\n",
"example": "small"
},
"topics": {
"type": "array",
"items": {
"type": "string",
"example": "health"
},
"description": "topics currently include health, environment, problem"
}
}
},
"readOnly": true
}
}
},
{
"type": "object",
"description": "Specific data about a product to enable personal ranking\n",
"properties": {
"attribute_groups": {
"type": "array",
"description": "Each element is an attribute that can help compute a personal ranking for the product",
"items": {
"title": "product_attribute_group",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique id of the attribute.\n\nIt will be use to match against preferences parameters.\n"
},
"status": {
"type": "string",
"enum": [
"known",
"unknown"
],
"description": "wether we have the information to really compute this criteria or not."
},
"title": {
"type": "string",
"description": "A descriptive sentence about the situation of the product concerning attribute\n",
"example": "Does not contain: Molluscs"
},
"match": {
"type": "number",
"format": "float",
"minimum": 0,
"maximum": 100,
"description": "a numeric value for the match,\ntelling how much the products ranks well for this particular attribute.\nThe higher the value, the better the match.\n"
},
"grade": {
"description": "every attribute as a grade for a to e",
"type": "string",
"enum": [
"unknown",
"a",
"b",
"c",
"d",
"e"
]
},
"name": {
"type": "string",
"description": "The name of attribute, for eventual display"
},
"icon_url": {
"type": "string",
"description": "an icon representing the attribute match (often using a color)"
},
"description": {
"type": "string",
"description": "An eventual description of the value of the property upon which this attribute is based"
},
"description_short": {
"type": "string",
"description": "An eventual short description of the value of the property upon which this attribute is based"
}
}
}
}
}
}
]
}