//#region src/schemas/server/v2.d.ts
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
interface paths {
"/api/v2/product/{code}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get Product Details
* @description Fetches product details by its unique barcode.
* Can return all product details or specific fields like knowledge panels.
*
* Use the `blame` parameter to include information about who last modified each field of the product.
*/
get: operations["get-product-by-code"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/cgi/product_image_upload.pl": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Upload Product Image
* @description Photos are source and proof of data.
* The first photo uploaded for a product is
* auto-selected as the product’s “front” photo.'
*/
post: operations["get-cgi-product_image_upload.pl"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/cgi/ingredients.pl": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* OCR on Ingredients
* @description Open Food Facts uses optical character recognition (OCR) to retrieve nutritional data and other information from the product labels.
*/
get: operations["get-cgi-ingredients.pl"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/cgi/product_image_crop.pl": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Rotate Image
* @description Although we recommend rotating photos manually and uploading a new version of the image,
* the OFF API allows you to make api calls to automate this process.
* You can rotate existing photos by setting the angle to 90º, 180º, or 270º clockwise.
*/
get: operations["get-cgi-product_image_crop.pl"];
put?: never;
/**
* Select and Crop Image
* @description Cropping is only relevant for editing existing products.
* You cannot crop an image the first time you upload it to the system.
*/
post: operations["post-cgi-product_image_crop.pl"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/cgi/product_image_unselect.pl": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Unselect Image
* @description This endpoint allows the user to unselect a photo for a product.
* The user must provide the product code and the image ID to unselect.
*/
post: operations["post-cgi-product_image_unselect.pl"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/cgi/product_jqm2.pl": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Edit Product
* @description This updates a product.
*
* Note: If the barcode exists then you will be editing the existing product,
* However if it doesn''t you will be creating a new product with that unique barcode,
* and adding properties to the product.
*/
post: operations["post-cgi-product_jqm2.pl"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/v2/search": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Search Products
* @description Search request allows you to get products that match your search criteria.
*
* It allows you create many custom APIs for your use case.
*
* If the search query parameter has 2 possible values, they are seperated by a comma(,).
* When filtering via a parameter that has different language codes like `fr`, `de` or `en`, specify the language code in the parameter name e.g `categories_tags_en`
*
* **Important:** search API v2 does not support full text request (search_term),
* you have to use [search API v1](https://wiki.openfoodfacts.org/API/Read/Search) for that.
* Upcoming [search-a-licious project](https://github.com/openfoodfacts/search-a-licious) will fix that.
*
* ### Limiting results
*
* You can limit the size of returned objects thanks to the `fields` object (see below).
*
* eg: `fields=code,product_name,brands,attribute_groups``
*
* Please use it as much as possible to avoid overloading the servers.
*
* The search use pagination, see `page` and `page_size` parameters.
*
* **Beware:** the `page_count` data in item is a bit counter intuitive…, read the description.
*
* ### Conditions on tags
*
* All `_tags`` parameters accepts either:
*
* * a single value
* * or a comma-separated list of values (doing a AND)
* * or a pipe separated list of values (doing a OR)
*
* You can exclude terms by using a "-" prefix.
*
* For taxonomized entries, you might either use the tag id (recommended),
* or a known synonym (without language prefix)
*
* * `labels_tags=en:organic,en:fair-trade` find items that are fair-trade AND organic
* * `labels_tags=en:organic|en:fair-trade` find items that are fair-trade OR organic
* * `labels_tags=en:organic,en:-fair-trade` find items that are organic BUT NOT fair-trade
*
*
* ### Conditions on nutriments
*
* To get a list of nutrients
*
* You can either query on nutrient per 100g (`_100g` suffix)
* or per serving (`serving` suffix).
*
* You can also add `_prepared_`
* to get the nutrients in the prepared product instead of as sold.
*
* You can add a comparison operator and value to the parameter name
* to get products with nutrient above or bellow a value.
* If you use a parameter value it exactly match it.
*
* * `energy-kj_100g<200` products where energy in kj for 100g is less than 200kj
* * `sugars_serving>10` products where sugar per serving is greater than 10g
* * `saturated-fat_100g=1` products where saturated fat per 100g is exactly 10g
* * `salt_prepared_serving<0.1` products where salt per serving for prepared product is less than 0.1g
*
* ### More references
*
* See also [wiki page](https://wiki.openfoodfacts.org/Open_Food_Facts_Search_API_Version_2)
*/
get: operations["get-search"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/cgi/suggest.pl": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get Suggestions
* @description For example , Dave is looking for packaging_shapes that contain the term "fe",
* all packaging_shapes containing "fe" will be returned.
* This is useful if you have a search in your application,
* for a specific product field.
*/
get: operations["get-cgi-suggest.pl"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/cgi/nutrients.pl": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get Nutrients List
* @description Used to display the nutrition facts table of a product, or to display a form to input those nutrition facts.
*/
get: operations["get-cgi-nutrients.pl"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/v2/attribute_groups": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get Attribute Groups
* @description Attributes are at the heart of personal search.
* They score the products according to different criterias,
* which could then be matched to a user's preferences.
*
* This API helps you list attributes and display them in your application,
* for the user to choose the importance of each criteria.
*
* note: `/api/v2/attribute_groups_{lc}` is also a valid route, but consider it deprecated
*/
get: operations["get-attribute-groups"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/v2/preferences": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get Preferences Weights
* @description This endpoint retrieves the weights corresponding to attribute preferences
* for computing personal product recommendations. The weights are used to
* personalize the product recommendations based on user preferences.
*/
get: operations["get-preferences"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/cgi/session.pl": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Login Session
* @description Retrieve session cookie for writing operations.
*/
post: operations["get-cgi-session.pl"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
}
interface components {
schemas: {
"Product-Base": components["schemas"]["product_base"];
"Product-Misc": components["schemas"]["product_misc"];
"Product-Tags": components["schemas"]["product_tags"];
"Product-Images": components["schemas"]["product_images"];
"Product-Eco-Score": components["schemas"]["product_ecoscore"];
"Product-Ingredients": components["schemas"]["product_ingredients"];
"Product-Nutrition": components["schemas"]["product_nutrition"];
"Product-Nutrition-v3.5": components["schemas"]["ProductNutritionDataV3"];
"Product-Nutriscore": components["schemas"]["NutriscoreAll"];
"Product-Quality": components["schemas"]["product_quality"];
"Product-Extended": components["schemas"]["product_extended"];
"Product-Metadata": components["schemas"]["product_meta"];
"Product-Knowledge-Panels": components["schemas"]["product_knowledge_panels"];
"Product-Attribute-Groups": components["schemas"]["product_attribute_groups"];
Product: components["schemas"]["product"]; /** ingredient */
Ingredient: {
id?: string;
ingredients?: components["schemas"]["Ingredients"]; /** @description The percentage of the ingredient. */
percent?: number; /** @description Estimated percentage of the ingredient. */
percent_estimate?: number; /** @description Maximum percentage of the ingredient. */
percent_max?: string | number; /** @description Minimum percentage of the ingredient. */
percent_min?: number; /** @description Text description of the ingredient. */
text?: string; /** @description Indicates if the ingredient is vegan. */
vegan?: string; /** @description Indicates if the ingredient is vegetarian. */
vegetarian?: string;
}; /** nutrient */
Nutrient: {
/** @description id of the nutrient */id?: string; /** @description Name of the nutrient in the requested language */
name?: string; /** @description Indicates if the nutrient is always shown on the nutrition facts table */
important?: boolean; /** @description Indicates if the nutrient should be shown in the nutrition facts edit form */
display_in_edit_form?: boolean; /** @description Default unit of the nutrient */
unit?: components["schemas"]["nutrient_unit"];
nutrients?: components["schemas"]["Nutrients"];
}; /** get_product_by_barcode_base_response */
get_product_by_barcode_base: {
/**
* @description Barcode of the product
* (can be EAN-13 or internal codes for some food stores).
* For products without a barcode, Open Food Facts assigns a
* number starting with the 200 reserved prefix.
*/
code?: string;
/**
* @description Return values based on ProductOpener/Display.pm analysis
* @enum {integer}
*/
status?: 0 | 1;
status_verbose?: string;
}; /** @description Product type information */
product_type: {
/**
* @description The product type is a fundamental separation that tells on which platform the product is made available:
* Open Food Facts, Open Beauty Facts, Open Pet Food Facts or Open Products Facts.
*
* Each platform has variations on the way it analyses the product.
*
* Changing the product type moves the product to the new platform.
* It must be done thoughtfully.
* @enum {string}
*/
product_type?: "beauty" | "food" | "petfood" | "product";
}; /** @description Base product data */
product_base: ({
/** @description The name of the product in the main language of the product (lang field) */product_name?: string; /** @description Abbreviated product name (e.g. abbreviated product name printed on receipts) in the main language of the product (lang field) */
abbreviated_product_name?: string;
/**
* @description barcode of the product (can be EAN-13 or internal codes for some food stores),
* for products without a barcode,
* Open Food Facts assigns a number starting with the 200 reserved prefix
*/
code: string;
codes_tags?: string[]; /** @description Generic / legal name of the product in the main language of the product (lang field) */
generic_name?: string;
/**
* @description internal identifier for the product, usually set to the value of `code`,
* except on the producers platform where it is prefixed by the owner
*/
id?: string;
/**
* @description Main language of the product.
* This is a duplicate of `lang` property (for historical reasons).
*/
lc?: string;
/**
* @description Main language of the product.
*
* This should be the main language of product packaging (if one is predominant).
*
* Main language is also used to decide which ingredients list to parse.
*/
lang?: string; /** @description Nova group as an integer from 1 to 4. See https://world.openfoodfacts.org/nova */
nova_group?: number;
nova_groups?: string;
obsolete?: string;
/**
* @description A date at which the product was declared obsolete.
* This means it's not produced any more.
*/
obsolete_since_date?: string;
/**
* @description The size in g or ml for the whole product.
* It is a normalized version of the `quantity` field.
* A `quantity` of "2 x 60 g" leads to `product_quantity`: "120".
* @example 500
*/
product_quantity?: string;
/**
* @description The unit (either g or ml) for the corresponding `product_quantity`.
* It is computed from the `quantity` field.
* A `quantity` of "6 x 250 ml" leads to `product_quantity_unit`: "ml".
* @example g
*/
product_quantity_unit?: string;
/**
* @description The quantity of the product, with the corresponding number of portions or unit (g, ml, kg, l, cl, oz, lbs...).
* It should be the value as displayed on the product. The ℮ sign is allowed.
* When it refers to the number of portions, it can be filled without any units (e.g. "6 eggs").
* @example 3 x 150 g
*/
quantity?: string;
/**
* @description Version of the product object schema used in the response.
* This indicates the structure of the 'product' field itself.
* For more details, please read: https://openfoodfacts.github.io/openfoodfacts-server/api/ref-api-and-product-schema-change-log
* @example 999
*/
schema_version: number;
} & {
[key: string]: string;
}) & components["schemas"]["product_type"];
/**
* Packaging component shape
* @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.
* @example {
* "id": "en:bottle",
* "lc_name": "bouteille"
* }
*/
shape: {
/** @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. */id?: 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. */
lc_name?: string;
};
/**
* Packaging component material
* @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.
* @example {
* "id": "en:bottle",
* "lc_name": "bouteille"
* }
*/
material: {
/** @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. */id?: 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. */
lc_name?: string;
};
/**
* Packaging component recycling instruction
* @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.
* @example {
* "id": "en:bottle",
* "lc_name": "bouteille"
* }
*/
recycling: {
/** @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. */id?: 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. */
lc_name?: string;
};
/**
* Packaging component (READ)
* @description Each packaging component has different properties to specify how many there are, its shape, material etc.
*
* The 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).
*
* They 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).
* @example {
* "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"
* }
*/
packaging_component: {
/** @description umber of units of this packaging component contained in the product (e.g. 6 for a pack of 6 bottles) */number_of_units?: number;
shape?: components["schemas"]["shape"];
material?: components["schemas"]["material"];
recycling?: components["schemas"]["recycling"]; /** @description Quantity (weight or volume) of food product contained in the packaging component. (e.g. 75cl for a wine bottle) */
quantity_per_unit?: string; /** @description Value parsed from the quantity field. */
quantity_per_unit_value?: number; /** @description Unit parsed and normalized from the quantity field. */
quantity_per_unit_unit?: string; /** @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_specified?: 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_measured?: 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_estimated?: number; /** @description Weight of one unit of the empty packaging component. */
weight?: number; /** @description Indicates which field was used to populate the "weight" field. Either "specified", "measured", or "estimated" */
weight_source_id?: string;
};
/**
* Packagings (READ)
* @description The packagings object is an array of individual packaging component objects.
*
* The Packaging data document explains how packaging data is structured in Open Food Facts: https://openfoodfacts.github.io/openfoodfacts-server/dev/explain-packaging-data/
*
* The shape, material and recycling properties of each packaging component are linked to entries in the packaging_shapes, packaging_materials and packaging_recycling taxonomies:
*
* https://world.openfoodfacts.org/data/taxonomies/packaging_shapes.json
* https://world.openfoodfacts.org/data/taxonomies/packaging_materials.json
* https://world.openfoodfacts.org/data/taxonomies/packaging_recycling.json
*
* If the tags_lc field is set, the properties will include a lc_name field with the translation in the requested language.
* @example [
* {
* "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"
* }
* ]
*/
packagings: components["schemas"]["packaging_component"][];
/**
* packagings_complete
* @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.
*/
packagings_complete: number;
/**
* product_misc
* @description Miscellaneous but important fields of a product
*/
product_misc: {
/** @description Number of food additives. */additives_n?: number;
checked?: string;
complete?: number;
completeness?: number; /** @description See also: `ecoscore_tags` */
ecoscore_grade?: string; /** @description See also: `ecoscore_tags` */
ecoscore_score?: number;
food_groups?: string;
food_groups_tags?: string[]; /** @description Traffic light indicators on main nutrients levels */
nutrient_levels?: {
/** @enum {string} */fat?: "low" | "moderate" | "high"; /** @enum {string} */
salt?: "low" | "moderate" | "high"; /** @enum {string} */
"saturated-fat"?: "low" | "moderate" | "high"; /** @enum {string} */
sugars?: "low" | "moderate" | "high";
};
/**
* @description Recycling instructions as raw text, e.g. Plastic
* bottle to recycle, Plastic cap to recycle.
* This will get automatically parsed and
* will be used to compute the Eco-Score.
* You can either request it (if it exists) or
* send it in a specific language.
* @example packaging_text_en
*/
packaging_text?: string;
packagings?: components["schemas"]["packagings"];
packagings_complete?: components["schemas"]["packagings_complete"]; /** @description Category of food according to [French Nutrition and Health Program](https://fr.wikipedia.org/wiki/Programme_national_nutrition_sant%C3%A9) */
pnns_groups_1?: string;
pnns_groups_1_tags?: string[]; /** @description Sub Category of food according to [French Nutrition and Health Program](https://fr.wikipedia.org/wiki/Programme_national_nutrition_sant%C3%A9) */
pnns_groups_2?: string;
pnns_groups_2_tags?: string[]; /** @description An imprecise measurement of popularity based on Scan statistics. A higher value means higher popularity. */
popularity_key?: number;
/**
* @description Indicators for the popularity of a product, like the amount of scans in a specific year.
* `popularity_tags` values from previous years are kept, if there is no popularity_tags at all, then it was never popular.
* This field must be used with care. In countries where Open Food Facts is not widely used,
* a product may obtain the value "top-90-percent-scans-2021" with a single scan.
* @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"
* ]
*/
popularity_tags?: string[];
/**
* @description Number of scans performed with the official Open Food Facts mobile application, the last year
* for which the product was scanned (current year excluded). This value is computed once a year by scanbot.pl.
* It is possible that a product has never been scanned at all: `scans_n` is not given in this case.
* See also `unique_scans_n` field.
*/
scans_n?: number;
/**
* @description Number of unique scans performed with the official Open Food Facts mobile application, the last year
* for which the product was scanned (current year excluded).
* Unique scans means it is based on different IPs.
* This value is computed once a year by scanbot.pl.
* See also `scans_n` field.
*/
unique_scans_n?: number;
/**
* @description Normalized version of serving_size.
* Note that this is NOT the number of servings by product.
* (in perl, see `normalize_serving_size`)
*/
serving_quantity?: string;
/**
* @description The unit (either g or ml) for the correponding serving_quantity.
* @example g
*/
serving_quantity_unit?: string;
/**
* @description Serving size text (generally in g or ml).
* We expect a quantity + unit but the user is free to input any string.
*/
serving_size?: string;
} & {
[key: string]: string;
};
/**
* Canonicalized taxonomy tag entry
* @description A tag entry, that has been matched against a taxonomy (e.g. a category, a label)
*
* The entry is a string that can contain either:
*
* - 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
* - 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
*/
taxonomy_tag_entry: string;
/**
* Indexed taxonomy tag entry (lossy, for search only)
* @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.
* A tag entry, that has been matched against a taxonomy (e.g. a category, a label)
*
* The entry is a string that can contain either:
*
* - 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
* - a string in a specific language, prefixed by the 2 letter language code, and normalized (deaccented and lowercased, depending on language)
* (e.g. "fr:thes-verts") -> for entries that could not be matched to a taxonomy entry
*/
indexed_taxonomy_tag_entry: string; /** @description Data about a product which is represented as tags */
product_tags: {
/**
* @description Comma separated list of brands (not taxonomized), in the last language used to edit it (recorded in brands_lc)
* This field is mostly used for debugging and testing purposes. Do not use it for display purposes.
*/
brands?: string;
/**
* @description An array of brands tag entries (for display and editing).
*
* That is the id of brands found in taxonomy +
* brands not found in taxonomy (as-is, with no normalization).
*
* This is the field that should be used for display purposes, as it is not lossy.
*/
brands_hierarchy?: components["schemas"]["taxonomy_tag_entry"][]; /** @description Language code of the last edit for brands */
brands_lc?: string;
/**
* @description An array of indexed brands tag entries (for search).
*
* That is the id of brands found in taxonomy +
* brands not found in taxonomy (with case / accents / spaces normalized).
*
* This is mostly used for search as the normalization of entries not in the taxonomy is lossy.
*/
brands_tags?: components["schemas"]["indexed_taxonomy_tag_entry"][];
/**
* @description Comma separated list of categories (not taxonomized), in the last language used to edit it (recorded in categories_lc)
* This field is mostly used for debugging and testing purposes. Do not use it for display purposes.
*/
categories?: string;
/**
* @description An array of categories tag entries (for display and editing).
*
* That is the id of categories found in taxonomy +
* categories not found in taxonomy (as-is, with no normalization).
*
* This is the field that should be used for display purposes, as it is not lossy.
*/
categories_hierarchy?: components["schemas"]["taxonomy_tag_entry"][]; /** @description Language code of the last edit for categories */
categories_lc?: string;
/**
* @description An array of indexed categories tag entries (for search).
*
* That is the id of categories found in taxonomy +
* categories not found in taxonomy (with case / accents / spaces normalized).
*
* This is mostly used for search as the normalization of entries not in the taxonomy is lossy.
*/
categories_tags?: components["schemas"]["indexed_taxonomy_tag_entry"][];
checkers_tags?: string[];
cities?: string;
cities_tags?: Record[];
correctors_tags?: string[]; /** @description List of countries where the product is sold. */
countries?: string;
countries_hierarchy?: string[]; /** @description Countries language code */
countries_lc?: string;
countries_tags?: string[];
/**
* @description All ecoscore of a product.
* Most of the time it's only one value,
* but it might eventually be more for products composed of sub-products.
* See also: `ecoscore_score`, `ecoscore_grade`.
*/
ecoscore_tags?: string[];
/**
* @description Packager code. EMB is the French system of traceability codes for packager.
* @example EMB 2013330
*/
emb_codes?: string;
emb_codes_orig?: string;
emb_codes_tags?: Record[];
labels?: string;
labels_hierarchy?: string[];
labels_lc?: string;
labels_tags?: string[];
/**
* @description The data as a series of tag: `yyyy-mm-dd`, `yyyy-mm`, `yyyy`
* @example [
* "2016-03-11",
* "2016-03",
* "2016"
* ]
*/
entry_dates_tags?: string[]; /** @description Places where the product was manufactured or transformed. */
manufacturing_places?: string;
manufacturing_places_tags?: string[];
nova_groups_tags?: string[];
nutrient_levels_tags?: string[];
};
/**
* image_size
* @description Width and height of an image
*/
image_size: {
/**
* @description The height of the reduced/full image in pixels.
* @example 400
*/
h?: number;
/**
* @description The width of the reduced/full image in pixels.
* @example 255
*/
w?: number;
};
/**
* image_role
* @description property of an image (or part thereof) selected for a particular role and a particular language.
*/
ImageRole: {
/**
* @description The angle of the image rotation (if it was rotated).
* @example 0
*/
angle?: number; /** @example full */
coordinates_image_size?: string; /** @example 0x0--1--1 */
geometry?: string;
/**
* @description The id of the original/source image that was selected to edit(rotate, normalize etc) to produce this new image.
* @example 121
*/
imgid?: string;
/**
* @description Normalize colors.
* @example null
* @example false
* @example true
*/
normalize?: string | boolean | null; /** @example 420 */
rev?: string;
/**
* @description The available image sizes for the product (both reduced and full).
* The reduced images are the ones with numbers as the key( 100, 200 etc)
* while the full images have `full` as the key.
*/
sizes?: {
100?: components["schemas"]["image_size"];
200?: components["schemas"]["image_size"];
400?: components["schemas"]["image_size"];
full?: components["schemas"]["image_size"];
};
/**
* @description Photo on white background : Try to remove the background.
* @example null
* @example false
* @example true
*/
white_magic?: string | boolean | null; /** @example -1 */
x1?: string; /** @example -1 */
x2?: string; /** @example -1 */
y1?: string; /** @example -1 */
y2?: string;
};
/**
* @description The available image sizes for the product (both reduced and full).
* The reduced images are the ones with numbers as the key( 100, 200 etc)
* while the full images have `full` as the key.
*/
Sizes: {
full?: components["schemas"]["image_size"];
} & {
[key: string]: string;
};
/**
* image
* @description This object represent an image that was uploaded to a product.
* "imgid" is an integer which is a sequential number unique to each picture.
*/
Image: {
/**
* @description If the image is selected as the front / ingredients / nutrition / packaging image,
* this is the index to access the original image URL in the `images` field of the product.
* If the image is not selected as one of these, this field is null.
*
* So if the product has the following `images` field:
*
* ```json
* "images": {
* 1: { ... },
* front_en: { imgid: 1, ... },
* ...
* }
* ```
*
* then the front image can be accessed by `images[1]`.
* @example 123456789
*/
imgid?: number;
sizes?: components["schemas"]["Sizes"];
/**
* @description The time the image was uploaded (as unix timestamp).
* @example 1457680652
*/
uploaded_t?: string;
/**
* @description The contributor that uploaded the image.
* @example openfoodfacts-contributors
*/
uploader?: string;
};
ImageUrls: {
[key: string]: string;
}; /** @description URLs of thumbnails image of image of type `image_type` */
SelectedImage: {
/** @description Thumbnail urls of product image (front) adapted to display on product page */display?: components["schemas"]["ImageUrls"]; /** @description Thumbnail urls of product image (front) adapted to display on product list page */
small?: components["schemas"]["ImageUrls"]; /** @description Thumbnail urls of product image (front) in smallest format */
thumb?: components["schemas"]["ImageUrls"];
};
/**
* Product-Images
* @description Information about Images of a product.
*
* Images ensure the reliability of Open Food Facts data.
* It provides a primary source and proof of all the structured data.
* You may therefore want to display it along the structured information.
*
* See also tutorials about images:
* * [Getting images](https://openfoodfacts.github.io/openfoodfacts-server/api/how-to-download-images/)
* * [Uploading images](https://openfoodfacts.github.io/openfoodfacts-server/api/tutorial-uploading-photo-to-a-product/)
*/
product_images: {
/**
* product_images_properties
* @description This contains properties for all images contained on the product.
*/
images?: {
front?: components["schemas"]["ImageRole"];
} & {
[key: string]: components["schemas"]["Image"] | string;
};
last_image_dates_tags?: string[]; /** @description timestamp of last image upload (or update?) */
last_image_t?: number;
/**
* product_selected_images
* @description URL for selected (important) images of the product.
*
* This is very handy if you display the product to users.
*/
selected_images?: {
front?: components["schemas"]["SelectedImage"];
} & {
[key: string]: string;
};
image_small_url?: string;
image_thumb_url?: string;
image_url?: string;
} & {
[key: string]: string;
}; /** @enum {string} */
EcoscoreCountryCode: "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";
EcoscoreCountryValues: {
[key: string]: number;
};
agribalyse: {
agribalyse_proxy_food_code?: string;
agribalyse_food_code?: string;
co2_agriculture?: number;
co2_consumption?: number;
co2_distribution?: number;
co2_packaging?: number;
co2_processing?: number;
co2_total?: number;
co2_transportation?: number;
code?: string;
dqr?: string;
ef_agriculture?: number;
ef_consumption?: number;
ef_distribution?: number;
ef_packaging?: number;
ef_processing?: number;
ef_total?: number;
ef_transportation?: number;
is_beverage?: number;
/**
* @description This can be returned in many other languages
* like name_fr (for french).
*/
name_en?: string;
score?: number;
version?: string;
};
/**
* @description Fields related to Eco-Score for a product.
*
* See also: `ecoscore_score`, `ecoscore_grade` and `ecoscore_tags`.
*/
product_ecoscore: {
/**
* product_ecoscore_data
* @description An object about a lot of details about data needed for Eco-Score computation
* and complementary data of interest.
*/
ecoscore_data?: {
/** product_ecoscore_adjustments */adjustments?: {
origins_of_ingredients?: {
/** @description List of aggregated origins of ingredients and their impact. */aggregated_origins?: {
epi_score?: string; /** @description Country or region of origin for the ingredient. */
origin?: string; /** @description Percentage of this ingredient from the specified origin. */
percent?: number; /** @description Transportation score associated with this ingredient's origin. */
transportation_score?: null | number;
}[]; /** @description Environmental Performance Index (EPI) score for the ingredient's origin. */
epi_score?: number;
epi_value?: number; /** @description List of origins derived from product categories, eg for PDO. */
origins_from_categories?: string[]; /** @description List of origins explicitly stated in the product's origins field. */
origins_from_origins_field?: string[];
transportation_score?: number;
transportation_scores?: components["schemas"]["EcoscoreCountryValues"];
transportation_value?: number;
transportation_values?: components["schemas"]["EcoscoreCountryValues"];
value?: number;
values?: components["schemas"]["EcoscoreCountryValues"];
warning?: string;
};
packaging?: {
non_recyclable_and_non_biodegradable_materials?: number;
packagings?: {
ecoscore_material_score?: number;
ecoscore_shape_ratio?: number;
material?: string;
shape?: string; /** @example 1 */
number_of_units?: number;
/**
* @description The quantity per packaging unit, as a string.
* @example 33 cL
*/
quantity_per_unit?: string; /** @example cl */
quantity_per_unit_unit?: string; /** @example 33 */
quantity_per_unit_value?: number; /** @example en:recycle-in-sorting-bin */
recycling?: string; /** @example 12.08 */
weight_measured?: number;
}[];
score?: number;
value?: number;
warning?: string;
};
production_system?: {
/**
* @example vegan
* @example fat free
* @example Kosher
*/
labels?: string[];
value?: number;
warning?: string;
};
threatened_species?: {
ingredient?: string;
value?: number;
};
};
agribalyse?: components["schemas"]["agribalyse"];
grade?: string;
grades?: {
[key: string]: string;
};
missing?: {
labels?: number;
origins?: number;
packagings?: number;
};
missing_data_warning?: number;
previous_data?: {
grade?: string | null;
score?: number | null;
agribalyse?: components["schemas"]["agribalyse"];
};
score?: number;
scores?: {
[key: string]: number;
};
status?: string;
};
ecoscore_extended_data_version?: string;
environment_impact_level?: string;
environment_impact_level_tags?: Record[];
};
/**
* ingredients
* @description This structure gives the different ingredients and some information about them,
* like estimate on their quantity.
*/
Ingredients: components["schemas"]["Ingredient"][];
/**
* product_ingredients
* @description Fields about ingredients of a product
*/
product_ingredients: {
additives_tags?: string[]; /** @description comma separated list of allergens */
allergens?: string; /** @description language in which `allergens` where input */
allergens_lc?: string;
allergens_hierarchy?: string[];
allergens_tags?: string[];
ingredients?: components["schemas"]["Ingredients"];
ingredients_analysis?: {
"en:palm-oil"?: string[];
"en:vegan-status-unknown"?: string[];
"en:vegetarian-status-unknown"?: string[];
};
ingredients_analysis_tags?: string[];
ingredients_from_or_that_may_be_from_palm_oil_n?: number;
ingredients_from_palm_oil_n?: number;
ingredients_from_palm_oil_tags?: Record[];
ingredients_hierarchy?: string[];
ingredients_n?: number;
ingredients_n_tags?: string[];
ingredients_original_tags?: string[];
/**
* @description Indicates the result of ingredients analysis processing
*
* * not present -> we didn't run ingredient percent analysis (e.g. we have no ingredients)
* * 1: we estimated the ingredients percent.
* * -1 : we tried to estimate the ingredients, but the values were impossible. (e.g. if the sum of % is above 100%)
*/
ingredients_percent_analysis?: number; /** @description Number of sweeteners additives in the ingredients. Undefined if ingredients are not specified. */
ingredients_sweeteners_n?: number; /** @description Number of non-nutritive sweeteners additives (as specified in the Nutri-Score formula) in the ingredients. Undefined if ingredients are not specified. */
ingredients_non_nutritive_sweeteners_n?: number;
ingredients_tags?: string[];
/**
* @description Language that was used to parse the ingredient list. If `ingredients_text` is available
* for the product main language (`lang`), `ingredients_lc=lang`, otherwise we look at
* `ingredients_text` fields for other languages and set `ingredients_lc` to the first
* non-empty `ingredient_text`.
*/
ingredients_lc?: string;
/**
* @description Raw list of ingredients. This will get automatically
* parsed and get used to compute the Eco-Score or find allergens, etc..
*
* It's a copy of ingredients_text in the main language of the product (see `lang` proprety).
* @example Farine de blé* 67,4%, sucre de canne*, huile de tournesol oléique*, graines de chia* 5,2%, son de blé*, oranges déshydratées * 0,9%, farine de riz*, poudres à lever (acide citrique, carbonates de sodium), arôme naturel d'orange.
*/
ingredients_text?: string;
/**
* @description Same text as `ingredients_text` but where allergens have HTML elements around them to identify them
* @example Farine de blé* 67,4%, sucre de canne*, huile de tournesol oléique*, graines de chia* 5,2%, son de blé*, oranges déshydratées * 0,9%, farine de riz*, poudres à lever (acide citrique, carbonates de sodium), arôme naturel d'orange.
*/
ingredients_text_with_allergens?: string;
ingredients_that_may_be_from_palm_oil_n?: number;
ingredients_that_may_be_from_palm_oil_tags?: Record[];
ingredients_with_specified_percent_n?: number;
ingredients_with_specified_percent_sum?: number;
ingredients_with_unspecified_percent_n?: number;
ingredients_with_unspecified_percent_sum?: number;
known_ingredients_n?: number; /** @description Origins of ingredients */
origins?: string;
origins_hierarchy?: Record[];
origins_lc?: string;
origins_tags?: Record[];
/**
* @description List of substances that might cause allergies
* that are present in trace amounts in the product
* (this does not include the ingredients, as they
* are not only present in trace amounts).
* It is taxonomized with the allergens taxonomy. Refer to the [allergens taxonomy](https://static.openfoodfacts.org/data/taxonomies/allergens.json)
*/
traces?: string;
traces_hierarchy?: (Record | string)[];
traces_lc?: string;
traces_tags?: (Record | string)[];
unknown_ingredients_n?: number;
} & {
[key: string]: string;
};
/**
* product_nutrition
* @description Nutrition fields of a product
*
* Most of these properties are read-only.
*
* See [how to add nutrition data](https://openfoodfacts.github.io/openfoodfacts-server/api/ref-cheatsheet/#add-nutrition-facts-values-units-and-base)
*/
product_nutrition: {
/**
* @description When a product does not have nutrition data displayed on the
* packaging, the user can check the field "Nutrition facts are
* not specified on the product".
* By doing so, the no_nutrition_data field takes the value "on".
* This case is frequent (thousands of products).
* @example on
*/
no_nutrition_data?: string;
/**
* @description The nutrition data on the package can be per serving or per 100g.
*
* This is essential to understand if `_value` and ``
* values in `nutriments` applies for a serving or for 100g.
*
* **IMPORTANT:**
* When writing products,
* this setting applies to all existing nutrients values for the product,
* not only the nutrient values sent in the write request.
* So it should not be changed unless all nutrients values are provided
* with values that match the nutrition_data_per field.
* @enum {string}
*/
nutrition_data_per?: "serving" | "100g";
/**
* @description The nutrition data for prepared product on the package (if any) can be per serving or per 100g.
*
* This is essential to understand if `_prepared_value` and `_prepared`
* values in `nutriments` applies for a serving or for 100g.
*
* See also important note on `nutrition_data_per`.
* @enum {string}
*/
nutrition_data_prepared_per?: "serving" | "100g";
/**
* @description All known nutrients for the product.
*
* Note that each nutrients are declined with a variety of suffixes like `_100g`, `_serving`,
* see patternProperties below.
*
* A specific `_unit` is the unit of the value that was entered by the contributor (a user or the manufacturer).
* It is not necessarily the unit that is printed on the product, as some apps may force specific units when writing nutrient values.
*
* Beware that some properties are to be interpreted based upon `nutrition_data_per` value.
*
* For most use cases, you should use the `_100g` or `_serving` fields, as they are always in the same standard unit, for a specific quantity (100g or 1 serving).
*
* For products that have a nutrition table for prepared product
* (eg. the nutrition facts for a bowl of milk with cocoa powder),
* a `_prepared` suffix is added (before other suffixes).
*
* You can get all possible nutrients from the
* [nutrients taxonomy](https://static.openfoodfacts.org/data/taxonomies/nutrients.json)
*
* **FIXME** add more nutrients with description.
*/
nutriments?: {
/**
* @description Quantity of alcohol
*
* (per 100g or per serving) in a standard unit (g or ml)
*/
alcohol?: number; /** @description This is the available carbohydrates (excluding fiber), also known as net carbohydrates */
carbohydrates?: number; /** @description This follows the US / Canada definition of carbohydrates which includes fiber, also known as gross carbohydrates */
"carbohydrates-total"?: number;
/**
* @description It is the same as `energy-kj` if we have it, or computed from `energy-kcal` otherwise
*
* (per 100g or per serving) in kj
*/
energy?: number; /** @description energy_value will be equal to energy-kj_value if we have it or to energy-kcal_value otherwise */
energy_value?: number;
/**
* @description Equal to energy-kj_unit if we have it or to energy-kcal_unit otherwise
* @enum {string}
*/
energy_unit?: "kcal" | "kJ";
/**
* @description energy in kcal, if it is specified
*
* (per 100g or per serving) in a standard unit (g or ml)
*/
"energy-kcal"?: number;
/**
* @description energy in kj, if it is specified
*
* (per 100g or per serving) in a standard unit (g or ml)
*/
"energy-kj"?: number;
fat?: number;
/**
* @description An estimate, from the ingredients list of the percentage of fruits, vegetable and legumes.
* This is an important information for Nutri-Score (2023 version) computation.
*/
"fruits-vegetables-legumes-estimate-from-ingredients"?: number;
/**
* @description An estimate, from the ingredients list of the percentage of fruits, vegetable and nuts.
* This is an important information for Nutri-Score (2021 version) computation.
*/
"fruits-vegetables-nuts-estimate-from-ingredients"?: number;
"nova-group"?: number;
/**
* @description Experimental nutrition score derived from
* the UK FSA score and adapted for the French market
* (formula defined by the team of Professor Hercberg).
*/
"nutrition-score-fr"?: unknown;
proteins?: number;
salt?: number;
"saturated-fat"?: number;
sodium?: number;
sugars?: number;
"carbon-footprint-from-known-ingredients_product"?: number;
"carbon-footprint-from-known-ingredients_serving"?: number;
/**
* @description erythritol is a polyol which is not providing any energy.
* As such, it needs not be taken into account when computing
* the energy of a product. Eryhtritol is now displayed on
* nutrition facts sheet of some products, mainly in the USA.
* This value is entered either by contributors, either by
* imports.
* @example 12.5
*/
erythritol?: number;
} & {
[key: string]: ("公斤" | "公升" | "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") | number | string;
};
/**
* @description Detail of data the Nutri-Score was computed upon.
*
* **Note**: this might not be stable, don't rely too much on this, or, at least, tell us !
*
* **TODO** document each property
*/
nutriscore_data?: {
saturated_fat_ratio?: number;
saturated_fat_ratio_points?: number;
saturated_fat_ratio_value?: number;
};
/**
* @description Nutrition grade (‘a’ to ‘e’),
* https://world.openfoodfacts.org/nutriscore.
*/
nutrition_grade_fr?: string;
/**
* @description Nutrition grades as a comma separated list.
*
* Some products with multiple components might have multiple Nutri-Score
*/
nutrition_grades?: string;
nutrition_grades_tags?: string[];
nutrition_score_beverage?: number;
nutrition_score_warning_fruits_vegetables_nuts_estimate_from_ingredients?: number;
nutrition_score_warning_fruits_vegetables_nuts_estimate_from_ingredients_value?: number;
nutrition_score_warning_no_fiber?: number;
other_nutritional_substances_tags?: Record[];
unknown_nutrients_tags?: Record[];
vitamins_tags?: Record[];
};
/**
* @description Nutri-Score for the product as a letter.
*
* See https://world.openfoodfacts.org/nutriscore.
* @enum {string}
*/
NutriscoreGrade: "a" | "b" | "c" | "d" | "e";
NutriscoreYearData: {
/**
* @example 1
* @enum {integer}
*/
category_available?: 0 | 1; /** @example d */
grade?: components["schemas"]["NutriscoreGrade"];
/**
* @example 1
* @enum {integer}
*/
nutrients_available?: 0 | 1;
/**
* @example 1
* @enum {integer}
*/
nutriscore_applicable?: 0 | 1;
/**
* @example 1
* @enum {integer}
*/
nutriscore_computed?: 0 | 1;
/**
* @example 13
* @example 18
*/
score?: number;
};
ProductType: {
/**
* @example 0
* @enum {integer}
*/
is_beverage?: 0 | 1;
/**
* @example 0
* @enum {integer}
*/
is_cheese?: 0 | 1;
/**
* @example 0
* @enum {integer}
*/
is_water?: 0 | 1;
}; /** Nutriscore2021InnerData */
Nutriscore2021InnerData: components["schemas"]["ProductType"] & {
/**
* @example 0
* @enum {integer}
*/
is_fat?: 0 | 1; /** @example 1996 */
energy?: number; /** @example 5 */
energy_points?: number; /** @example 1996 */
energy_value?: number;
/**
* Format: float
* @example 3.8
*/
fiber?: number; /** @example 4 */
fiber_points?: number;
/**
* Format: float
* @example 3.8
*/
fiber_value?: number;
/**
* Format: float
* @example 0
*/
fruits_vegetables_nuts_colza_walnut_olive_oils?: number; /** @example 0 */
fruits_vegetables_nuts_colza_walnut_olive_oils_points?: number;
/**
* Format: float
* @example 0
*/
fruits_vegetables_nuts_colza_walnut_olive_oils_value?: number;
/**
* Format: float
* @example 6.6
*/
proteins?: number; /** @example 4 */
proteins_points?: number;
/**
* Format: float
* @example 6.6
*/
proteins_value?: number;
/**
* Format: float
* @example 6.2
*/
saturated_fat?: number; /** @example 6 */
saturated_fat_points?: number;
/**
* Format: float
* @example 6.2
*/
saturated_fat_value?: number;
/**
* Format: float
* @example 210
*/
sodium?: number; /** @example 2 */
sodium_points?: number;
/**
* Format: float
* @example 210
*/
sodium_value?: number;
/**
* Format: float
* @example 21.5
*/
sugars?: number; /** @example 4 */
sugars_points?: number;
/**
* Format: float
* @example 21.5
*/
sugars_value?: number; /** @example 17 */
negative_points?: number; /** @example 4 */
positive_points?: number;
}; /** Nutriscore2021Data */
Nutriscore2021Data: components["schemas"]["Nutriscore2021InnerData"] & {
/** @example d */grade?: components["schemas"]["NutriscoreGrade"]; /** @example 13 */
score?: number;
}; /** NutriscoreComponent */
NutriscoreComponent: {
/**
* @example energy
* @example sugars
* @example saturated_fat
* @example salt
* @example fiber
* @example fruits_vegetables_legumes
*/
id?: string;
/**
* @example 5
* @example 6
* @example 7
* @example 2
* @example 1
* @example 0
*/
points?: number;
/**
* @example 10
* @example 15
* @example 20
* @example 25
* @example 5
* @example 5
*/
points_max?: number;
/**
* @example kJ
* @example g
* @example %
*/
unit?: string;
/**
* Format: float
* @example 21.5
* @example 6.2
* @example 0.53
* @example 3.8
* @example 0
*/
value?: null | number;
}; /** Nutriscore2023Data */
Nutriscore2023Data: components["schemas"]["ProductType"] & {
/**
* @example 0
* @enum {integer}
*/
is_fat_oil_nuts_seeds?: 0 | 1;
/**
* @example 0
* @enum {integer}
*/
is_red_meat_product?: 0 | 1; /** Nutriscore2023DataComponents */
components?: {
negative?: components["schemas"]["NutriscoreComponent"][];
positive?: components["schemas"]["NutriscoreComponent"][];
};
/**
* Format: float
* @example 0
*/
count_proteins?: number; /** @example negative_points_greater_than_or_equal_to_11 */
count_proteins_reason?: string; /** @example 19 */
negative_points?: number; /** @example 1 */
positive_points?: number; /** @example 55 */
negative_points_max?: number; /** @example 10 */
positive_points_max?: number;
/**
* @example [
* "fiber",
* "fruits_vegetables_legumes"
* ]
*/
positive_nutrients?: string[];
}; /** Nutriscores */
Nutriscores: {
/** Nutriscore2021 */2021?: components["schemas"]["NutriscoreYearData"] & {
data?: components["schemas"]["Nutriscore2021Data"];
}; /** Nutriscore2023 */
2023?: components["schemas"]["NutriscoreYearData"] & {
data?: components["schemas"]["Nutriscore2023Data"];
};
};
/**
* @example [
* "d"
* ]
*/
NutriscoreGradeTags: components["schemas"]["NutriscoreGrade"][]; /** ProductNutriscore */
NutriscoreAll: {
nutriscore?: components["schemas"]["Nutriscores"];
nutriscore_2021_tags?: components["schemas"]["NutriscoreGradeTags"];
nutriscore_2023_tags?: components["schemas"]["NutriscoreGradeTags"];
nutriscore_data?: components["schemas"]["Nutriscore2021Data"]; /** @example d */
nutriscore_grade?: components["schemas"]["NutriscoreGrade"];
/**
* @description Nutri-Score for the product as an integer (see also `nutriscore_grade`).
* @example 13
*/
nutriscore_score?: number; /** @example -13 */
nutriscore_score_opposite?: number;
nutriscore_tags?: components["schemas"]["NutriscoreGradeTags"];
nutriscore_version?: string;
}; /** @description This is data that is linked to products data quality */
product_quality: {
data_quality_bugs_tags?: string[];
data_quality_errors_tags?: string[];
data_quality_info_tags?: string[];
data_quality_tags?: string[];
data_quality_warnings_tags?: string[]; /** @description Source of data imported from producers. */
data_sources?: string;
data_sources_tags?: string[];
last_check_dates_tags?: string[];
last_checked_t?: number;
last_checker?: string;
/**
* @description comma separated list of values indicating some states of the product,
* like things to be done, or to be completed.
* See [states taxonomy](https://static.openfoodfacts.net/data/taxonomies/states.json)
*/
states?: string;
states_hierarchy?: string[];
states_tags?: string[];
/**
* @description Information about different aspect of the product
* Refer to [misc taxonomy](https://static.openfoodfacts.org/data/taxonomies/misc.json)
*/
misc_tags?: string[];
}; /** product_extended */
product_extended: {
additives_original_tags?: string[];
additives_prev_original_tags?: string[];
added_countries_tags?: Record[];
allergens_from_ingredients?: string;
allergens_from_user?: string;
amino_acids_prev_tags?: Record[];
amino_acids_tags?: Record[];
carbon_footprint_percent_of_known_ingredients?: number;
categories_properties?: {
"agribalyse_food_code:en"?: string;
"agribalyse_proxy_food_code:en"?: string;
"ciqual_food_code:en"?: string;
};
categories_properties_tags?: string[];
category_properties?: {
[key: string]: string;
};
ciqual_food_name_tags?: string[];
/**
* @description the category to use for comparison.
*
* **TODO** explain how it is chosen.
*/
compared_to_category?: string;
conservation_conditions?: string; /** @description Contact info of customer service. */
customer_service?: string;
expiration_date?: string; /** @description link to the product on the website of the producer */
link?: string;
main_countries_tags?: Record[];
minerals_prev_tags?: Record[];
minerals_tags?: Record[];
/**
* @description Those are fields provided by the producer (through producers platform),
* and the value he provided.
*/
owner_fields?: {
/**
* @description you can retrieve all kind of properties, the same as on the parent object (the product).
* It's not processed entries (like tags for example) but raw ones.
*/
additionalProperties?: number | string | Record;
}; /** @description Detail of ingredients or processing that makes the products having Nova 3 or 4 */
nova_groups_markers?: {
[key: string]: string[][];
};
nucleotides_tags?: Record[];
origin?: string;
/**
* @description Country, state, or city where the product can be purchased.
* @example Paris
*/
purchase_places?: string;
purchase_places_tags?: string[];
/**
* @description Distributor name.
* @example Walmart
*/
stores?: string;
stores_tags?: string[];
traces_from_ingredients?: string;
traces_from_user?: string;
} & {
[key: string]: string;
}; /** @description Metadata of a product (author, editors, creation date, etc.) */
product_meta: {
/**
* @description Date when the product was added (UNIX timestamp format).
* See also `entry_dates_tags`
* @example 1457680652
*/
created_t: number; /** @description The contributor who added the product first. */
creator: string; /** @description List of editors who edited the product. */
editors_tags?: string[];
informers_tags?: string[];
interface_version_created?: string;
interface_version_modified?: string;
languages?: {
[key: string]: number;
}; /** @description Same as `languages` but by language code, instead of language tags */
languages_codes?: {
[key: string]: number;
};
languages_hierarchy?: string[];
languages_tags?: string[];
last_edit_dates_tags?: string[];
last_editor?: string;
/**
* @description The username of the user who last modified the product.
* @example sebleouf
*/
last_modified_by: string;
/**
* @description Date when the product page was last modified.
* This date is updated only when primary data is modified (data entered by the user or updated by an interface)
*/
last_modified_t: number;
/**
* @description Date when the product page was last modified.
* This date is updated when primary data or secondary data is modified
* (primary: data entered by a user or read from an interface, secondary: data computed by a utility
* such as update_all_products.pl)
*/
last_updated_t: number; /** @description Id of the producer in case he provides his own data about a product (producer platform). */
owner?: string; /** @description Tagyfied version of owner */
owners_tags?: string;
photographers_tags?: string[]; /** @description revision number of this product version (each edit adds a revision) */
rev: number;
sources?: {
fields?: string[];
id?: string;
images?: Record[];
import_t?: number;
manufacturer?: number | string;
name?: string;
source_licence?: string;
source_licence_url?: string;
url?: null | string;
}[]; /** product_meta_source_fields */
sources_fields?: {
"org-gs1"?: {
gln?: string;
gpcCategoryCode?: string;
gpcCategoryName?: string;
isAllergenRelevantDataProvided?: string;
lastChangeDateTime?: string;
partyName?: string;
productionVariantDescription?: string;
publicationDateTime?: string;
};
};
teams?: string;
teams_tags?: string[];
update_key?: string;
};
/**
* title_element
* @description The title of a panel.
*/
title_element: {
/** @description A short name of this panel, not including any actual values. e.g. "Fat" */name?: string;
title?: string;
subtitle?: 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
* @enum {string}
*/
type?: "grade" | "percentage" | "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 {string}
*/
grade?: "a+" | "a" | "b" | "c" | "d" | "e" | "f" | "unknown"; /** @description The numeric value of the panel, where the type is "percentage" */
value?: number; /** @description The string value of the panel, for cases where the value is not numeric */
value_string?: string;
icon_url?: string;
icon_color_from_evaluation?: string; /** @description If set to "small", the icon should be displayed at a small size. */
icon_size?: string;
};
/**
* text_element
* @description A text in simple HTML format to display.
*
* For 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.
*/
text_element: {
/**
* @description the type of text, might influence the way you display it.
* @enum {string}
*/
type?: "summary" | "warning" | "notes"; /** @description Text to display in HTML format. */
html?: 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. */
language?: string; /** @description 2 letter language code for the text. Only set for specific fields such as the list of ingredients of a product. */
lc?: string; /** @description id of the field used to edit this text in the product edit API. */
edit_field_id?: string; /** @description Type of the product field. */
edit_field_type?: string; /** @description Current value of the product field. This may differ from the html field which can contain extra formating. */
edit_field_value?: string;
/**
* @description Link to the source
* @example https://en.wikipedia.org/wiki/Sodium acetate
*/
source_url?: string;
/**
* @description name of the source
* @example Wikipedia
*/
source_text?: string;
/**
* @description Source locale name
* @example en
*/
source_lc?: string;
/**
* @description Human readable source locale name
* @example English
*/
source_language?: string;
}; /** image_element */
image_element: {
/** @description full URL of the image */url?: string;
/**
* @description Width of the image.
*
* This is just a suggestion coming from the server,
* the client may choose to use its own dimensions for the image.
*/
width?: number;
/**
* @description Height of the image.
*
* This is just a suggestion coming from the server,
* the client may choose to use its own dimensions for the image.
*/
height?: number; /** @description Alt Text of the image. */
alt_text?: string;
};
/**
* action_element
* @description The action element is used to display a title and a list of actions like editing a product or adding categories.
*/
action_element: {
title?: string; /** @description The ids of the actions to show. */
actions?: string[];
};
/**
* panel_element
* @description Panels can include other panels as sub-panels using the panel_element.
*/
panel_element: {
/** @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_id?: string;
};
/**
* panel_group_element
* @description The panel group element is used to display an optional title followed by a number of sub-panels.
*/
panel_group_element: {
title?: string; /** @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. */
panel_ids?: string[]; /** @description An image related to the panel group (e.g. the ingredients or nutrition facts image for the ingredients and nutrition panel groups). */
image?: Record;
};
/**
* table_element
* @description Element to display a table.
*/
table_element: {
/** @description An id for the table. */id?: string; /** @description Type of table (e.g. "percents" for tables with percentage columns) */
table_type?: string; /** @description Title of the table. */
title?: string;
columns?: {
/** @description Column header text */text?: string; /** @description Column type (e.g. "text", "percent") */
type?: string; /** @description Alternative text for small screens */
text_for_small_screens?: string; /** @description CSS style for the column */
style?: string;
column_group_id?: string;
shown_by_default?: boolean;
}[]; /** @description Array of table rows */
rows?: {
/** @description Row ID */id?: string; /** @description CSS style for the row */
style?: string; /** @description Array of cell values */
values?: {
/** @description Cell text content */text?: string; /** @description URL of an icon to display in the cell */
icon_url?: string; /** @description Percentage value for progress bars (used with percent columns) */
percent?: number; /** @description Evaluation level (good, bad, neutral, etc.) for styling */
evaluation?: string; /** @description Indentation level */
level?: number; /** @description CSS style for the cell */
style?: string;
}[];
}[];
};
/**
* element
* @description Each element object contains one specific element object such as a text element or an image element.
*/
element: {
/**
* @description The type of the included element object.
* The element_type also indicates which field contains the included element object.
* e.g. if the element_type is "text", the included element object will be in the "text_element" field.
*
* Note that in the future, new type of element may be added,
* so your code should ignore unrecognized types, and unknown properties.
*
* TODO: add Map type
* @enum {string}
*/
element_type: "text" | "image" | "action" | "panel" | "panel_group" | "table";
text_element?: components["schemas"]["text_element"];
image_element?: components["schemas"]["image_element"];
action_element?: components["schemas"]["action_element"];
panel_element?: components["schemas"]["panel_element"];
panel_group_element?: components["schemas"]["panel_group_element"];
table_element?: components["schemas"]["table_element"];
};
/**
* panel
* @description Each panel contains an optional title and an optional array of elements.
*/
panel: {
/** @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. */type?: string; /** @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. */
expanded?: boolean; /** @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. */
expand_for?: 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 {string}
*/
evaluation?: "good" | "average" | "neutral" | "bad" | "unknown";
/**
* @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
*/
half_width_on_mobile?: boolean;
title_element?: components["schemas"]["title_element"]; /** @description An ordered list of elements to display in the content of the panel. */
elements?: components["schemas"]["element"][];
/**
* @description a message level, as levels we use in log.
* It might help theming the panel visually. Some possible values: info, recommendation
* @example info
*/
level?: string;
/**
* @description size is either empty (normal display)
* or small to indicate a panel that should have a smaller font size
* @example small
* @enum {string}
*/
size?: "small"; /** @description topics currently include health, environment, problem */
topics?: string[];
};
/**
* panels
* @description The panels object is a dictionary of individual panel objects.
* Each key of the dictionary is the id of the panel, and the value is the panel object.
*
* Apps 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.
* @example {
* "additionalProperties": "string"
* }
*/
panels: {
[key: string]: components["schemas"]["panel"];
}; /** @description Knowledge panels for a product */
product_knowledge_panels: {
knowledge_panels?: components["schemas"]["panels"];
}; /** @description Specific data about a product to enable personal ranking */
product_attribute_groups: {
/** @description Each element is an attribute that can help compute a personal ranking for the product */attribute_groups?: {
/**
* @description Unique id of the attribute.
*
* It will be use to match against preferences parameters.
*/
id?: string;
/**
* @description wether we have the information to really compute this criteria or not.
* @enum {string}
*/
status?: "known" | "unknown";
/**
* @description A descriptive sentence about the situation of the product concerning attribute
* @example Does not contain: Molluscs
*/
title?: string;
/**
* Format: float
* @description a numeric value for the match,
* telling how much the products ranks well for this particular attribute.
* The higher the value, the better the match.
*/
match?: number;
/**
* @description every attribute as a grade for a to e
* @enum {string}
*/
grade?: "unknown" | "a" | "b" | "c" | "d" | "e"; /** @description The name of attribute, for eventual display */
name?: string; /** @description an icon representing the attribute match (often using a color) */
icon_url?: string; /** @description An eventual description of the value of the property upon which this attribute is based */
description?: string; /** @description An eventual short description of the value of the property upon which this attribute is based */
description_short?: string;
}[];
};
/**
* product
* @description This is all the fields describing a product and how to display it on a page.
*
* Refer to the different sub schema for more readable entries:
*
* * [Product Base](#cmp--schemas-product-base): Base fields of a product
* * [Product Misc](#cmp--schemas-product-misc): Miscellaneous but important fields of a product
* * [Product Tags](#cmp--schemas-product-tags): Tags fields on a product
* * [Product Images](#cmp--schemas-product-images): Information about Images of a product
* * [Product Eco-Score](#cmp--schemas-product-ecoscore): Fields related to Eco-Score for a product
* * [Product Ingredients](#cmp--schemas-product-ingredients): Fields about ingredients of a product
* * [Product Nutrition](#cmp--schemas-product-nutrition): Nutrition fields of a product
* * [Product Data Quality](#cmp--schemas-product-quality): fields related to data quality for a product
* * [Product Extended](#cmp--schemas-product-extended): TODO
* * [Product Metadata](#cmp--schemas-product-meta): Metadata of a product (author, editors, etc.)
* * [Product Knowledge Panels](#cmp--schemas-product-knowledge-panels): Knowledge panels for a product
* * [Product Attribute Groups](#cmp--schemas-product-attribute-groups): Attribute groups for personal product matching
*/
product: components["schemas"]["product_base"] & components["schemas"]["product_misc"] & components["schemas"]["product_tags"] & components["schemas"]["product_images"] & components["schemas"]["product_ecoscore"] & components["schemas"]["product_ingredients"] & components["schemas"]["product_nutrition"] & components["schemas"]["NutriscoreAll"] & components["schemas"]["product_quality"] & components["schemas"]["product_extended"] & components["schemas"]["product_meta"] & components["schemas"]["product_knowledge_panels"] & components["schemas"]["product_attribute_groups"]; /** get_product_by_barcode_response */
get_product_by_barcode: components["schemas"]["get_product_by_barcode_base"] & {
product?: components["schemas"]["product"];
};
/**
* Blame Information
* @description Information about who last modified each field of the product.
* This is returned when the 'blame' parameter is included in the request.
*/
blame: {
/** @description Blame information for product fields */fields?: {
[key: string]: {
/**
* @description User ID of the person who last modified this field
* @example editortester
*/
userid?: string;
/**
* @description Unix timestamp when the field was last modified
* @example 1636466428
*/
t?: number;
/**
* @description Revision number when the field was last modified
* @example 5
*/
rev?: number;
/**
* @description Current value of the field
* @example Some Cookie
*/
value?: string;
/**
* @description User ID of the person who previously modified this field
* @example previoustester
*/
previous_userid?: string;
/**
* @description Unix timestamp when the field was previously modified
* @example 1636366428
*/
previous_t?: number;
/**
* @description Previous revision number
* @example 4
*/
previous_rev?: number;
/**
* @description Previous value of the field
* @example Old Cookie Name
*/
previous_value?: string;
};
}; /** @description Blame information for uploaded images */
uploaded_images?: {
[key: string]: {
/** @description User ID of the person who uploaded this image */userid?: string; /** @description Unix timestamp when the image was uploaded */
t?: number; /** @description Revision number when the image was uploaded */
rev?: number; /** @description Image filename or identifier */
value?: string;
};
}; /** @description Blame information for selected images */
selected_images?: {
[key: string]: {
/** @description User ID of the person who selected this image */userid?: string; /** @description Unix timestamp when the image was selected */
t?: number; /** @description Revision number when the image was selected */
rev?: number; /** @description Selected image identifier */
value?: string;
};
}; /** @description Blame information for nutrition facts */
nutriments?: {
[key: string]: {
/** @description User ID of the person who last modified this nutriment */userid?: string; /** @description Unix timestamp when the nutriment was last modified */
t?: number; /** @description Revision number when the nutriment was last modified */
rev?: number; /** @description Current value of the nutriment */
value?: string | number;
};
}; /** @description Blame information for packaging data */
packagings?: {
[key: string]: {
/** @description User ID of the person who last modified packaging info */userid?: string; /** @description Unix timestamp when packaging was last modified */
t?: number; /** @description Revision number when packaging was last modified */
rev?: number; /** @description Current packaging data signature */
value?: string;
};
};
}; /** get_product_by_barcode_with_blame_response */
get_product_by_barcode_with_blame: components["schemas"]["get_product_by_barcode_base"] & {
product?: components["schemas"]["product"];
blame?: components["schemas"]["blame"];
};
add_photo_to_existing_product: {
/**
* @description Barcode of the product
* @example 3017620422003
*/
code: string;
/**
* @description Indicates the type of the image and the corresponding language. It should
* be in the format `{IMAGE_TYPE}_{LANG}` format, where `IMAGE_TYPE` is one
* of `front|ingredients|nutrition|packaging|other` and `LANG` is the 2
* letter language code. Use `other` if you don't want the image to be
* selected. Note that the first image of a product is always selected as front
* picture.
* @example front_en
*/
imagefield: string;
/**
* Format: binary
* @description This field must contain image binary content.
* The format and extension must be one of gif|jpeg|jpg|png|heic.
* This field is dynamic and dependent on the value of imagefield in the
* request body. It wil be imgupload_the value of the imagefield stated
* earlier. For example, if `imagefield=front_en`, the name of this field
* should be `imageupload_front_en`.
*/
imgupload_front_en: string;
}; /** @description Properties that goes in change ref */
change_ref_properties: {
/**
* @description A comment on the contribution. It will be shown in product changes history.
* Adding meaningful comments help moderators and users understand a single product history.
*/
comment?: string; /** @description Name of the app providing the information */
app_name?: string; /** @description Version of the app providing the information */
app_version?: string;
/**
* @description When an app uses a single user to log its contributions,
* it might be interesting to know which user of the app is providing the information.
* You can use this field to provide an identifier (eg: an sha1 of the username) that's privacy preserving. Make sure that your salt is strong, perfectly random and secret
*
* In case we have trouble with one of your user, it helps our moderators revert edits.
*/
app_uuid?: string;
/**
* @description It is required that you pass a specific User-Agent header when you do an API request.
* But some times it's not possible to modify such a header
* (eg. request using JavaScript in a browser).
* In such cases, you can override it with this parameter.
*/
"User-Agent"?: string;
}; /** add_photo_to_existing_product_response */
"add_photo_to_existing_product-2": {
files?: {
/** @example /product/3017620422003/nutella-ferrero */url?: string; /** @example */
filename?: string; /** @example Nutella - Ferrero - 400g */
name?: string; /** @example /images/products/301/762/042/2003/123.100.jpg */
thumbnailUrl?: string; /** @example 3017620422003 */
code?: string;
}[];
image?: {
/** @example 123.100.jpg */thumb_url?: string; /** @example 123 */
imgid?: number; /** @example 123.400.jpg */
crop_url?: string;
}; /** @example 123 */
imgid?: number; /** @example status ok */
status?: string; /** @example front_en */
imagefield?: string; /** @example 3017620422003 */
code?: string;
}; /** ocr_on_product_response */
ocr_on_product: {
/** @example 1 */status?: number;
}; /** rotate_a_photo_response */
rotate_a_photo: {
/** @example status ok */status?: string; /** @example nutrition_fr */
imagefield?: string;
image?: {
/** @example nutrition_fr.67.400.jpg */display_url?: string;
};
};
/**
* @description Select a photo and optionally crop/rotate it.
* The origin of the cropping coordinates is the top-left corner.
* Note that rotation is applied *before* cropping, so the cropping bounding box
* is relative to the rotated image.
*/
crop_a_photo: {
/**
* @description Barcode of the product.
* @example 04963406
*/
code: string;
/**
* @description identifier of the image to select, it should be a number
* @example 2
*/
imgid: number;
/**
* @description identifier of the selected image field, should be in the format
* `{IMAGE_TYPE}_{LANG}` format, where `IMAGE_TYPE` is one of
* `front|ingredients|nutrition|packaging|other` and `LANG` is the 2 letter
* language code.
* Note that if you select an image for the main language of the product (ex:
* `ingredients_it` if `it` is the main language), this image will be
* displayed on Product Opener for all languages (ex: on
* `https://fr.openfoodfacts.org`, unless `ingredients_fr` exists).
* @example front_en
*/
id: string;
/**
* @description X origin coordinate of the crop, it must be lower than x2
* @example 0
*/
x1?: number;
/**
* @description Y origin coordinate of the crop, it must be lower than y2
* @example 0
*/
y1?: number;
/**
* @description X end coordinate of the crop, it must be higher than x1
* @example 145
*/
x2?: number;
/**
* @description Y end coordinate of the crop, it must be higher than y1
* @example 145
*/
y2?: number;
/**
* @description angle of the rotation to apply on the selected image.
* passing `90` as value rotate the image 90 degrees counter-clockwise.
* @example 0
*/
angle?: number;
/**
* @description whether the selected image should be normalized using ImageMagick
* @example false
* @enum {string}
*/
normalize?: "true" | "false";
/**
* @description whether the source image should be white magiced (background removal) using
* ImageMagick.
* @default false
* @enum {string}
*/
white_magic: "true" | "false";
}; /** product_image_crop */
product_image_crop: {
/**
* @example status ok
* @example status not ok - image not selected - imgid not in uploaded images
* @example status not ok - image not selected - image cannot be read
*/
status?: string;
/**
* @description identifier of the processed image
* @example 2
*/
imgid?: number;
/**
* @description identifier of the selected image field
* (corresponding to the `id` parameter)
*/
imagefield?: string;
}; /** unselect_a_photo_request */
unselect_a_photo: {
/**
* @description code of the product
* @example 4251105501381
*/
code?: string;
/**
* @description image field (image id) of the photo to unselect
* @example front_fr
*/
id?: string;
};
/**
* @description You can provide most of the properties defined in the product READ schema.
* This includes language-specific fields like product_name_[language_code], ingredients_text_[language_code], etc.
*/
add_or_edit_a_product: ({
/**
* @description The barcode of the product to be added or edited
* @example 0074570036004
*/
code: string;
/**
* @description Username to authenticate with
*
* Note: you must always use the username (and not the email)
* as it is far less brittle.
*/
user_id: string;
/**
* Format: password
* @description Password to authenticate with
*/
password: string; /** @description 2 letter code of the language of the interface. Used to determine the language of certain fields (e.g. product_name and taxonomy fields like categories and labels). If not passed, the language may be inferred by the country of the user (passed through the cc field or inferred by the IP address). Full list at https://static.openfoodfacts.org/data/taxonomies/languages.json */
lc?: string; /** @description 2 letter language code of the main language of the product (the most prominent on the packaging) */
lang?: string; /** @description Product name in the language sent in the lc field. For backward compatibility only, use the field product_name_[language_code] instead. */
product_name?: string; /** @description Abbreviated product name. For backward compatibility only, use the field abbreviated_product_name_[language_code] instead. */
abbreviated_product_name?: string; /** @description Legal name of the product. For backward compatibility only, use the field generic_name_[language_code] instead. */
generic_name?: string; /** @description Raw list of ingredients text. For backward compatibility only, use the field ingredients_text_[language_code] instead. */
ingredients_text?: string; /** @description Packaging information text. For backward compatibility only, use the field packaging_text_[language_code] instead. */
packaging_text?: string; /** @description Product quantity with unit */
quantity?: string; /** @description Product labels (comma-separated list) */
labels?: string; /** @description Product categories (comma-separated list) */
categories?: string; /** @description Product brands (comma-separated list) */
brands?: string; /** @description Stores where product is sold */
stores?: string; /** @description Countries where product is sold */
countries?: string; /** @description Origins of ingredients */
origins?: string; /** @description Traces of allergens */
traces?: string;
/**
* @description Packaging type, format, material.
* The [v3 API documentation](https://openfoodfacts.github.io/openfoodfacts-server/api/ref-v3/#operation/post-api-v3-product-barcode)
* has a more structured data for `packaging`.
* @example Frozen
*/
packaging?: string; /** @description Serving size */
serving_size?: string;
/**
* @description Whether nutrition data is per 100g or per serving. Note that this field applies to all nutriment fields (existing or new). So if its value is changed, all nutrients should be supplied, so that we don't have existing values per 100g when the new values are per serving, or vice versa.
* @enum {string}
*/
nutrition_data_per?: "100g" | "serving";
} & {
[key: string]: string;
}) & components["schemas"]["product_type"]; /** add_or_edit_a_product_response */
"add_or_edit_a_product-2": {
/** @example fields saved */status_verbose?: string; /** @example 1 */
status?: number;
}; /** search_for_products_response */
search_for_products: {
/**
* @description Total number of products found
* @example 2701
*/
count?: number;
/**
* @description Page number of returned results.
*
* You can get a different page, by using the `page` query parameter.
* @example 1
*/
page?: number;
/**
* @description Number of products in this page.
*
* This will differ from page_size only on the last page.
* @example 24
*/
page_count?: number;
/**
* @description Requested number of products per pages
*
* To get the number of pages, divide count by page_size
* (eg. `Math.floor( count / page_size) + 1 `)
* @example 24
*/
page_size?: number; /** @description The products matching the query corresponding to current page */
products?: components["schemas"]["product"][]; /** @example 0 */
skip?: number;
};
/**
* @description The unit in which the nutrient for 100g or per serving is measured.
*
* The possible values depends on the nutrient.
*
* * `g` for grams
* * `mg` for milligrams
* * `μg` for micrograms
* * `cl` for centiliters
* * `ml` for mililiters
* * `dv` for recommended daily intakes (aka [Dietary Reference Intake](https://en.wikipedia.org/wiki/Dietary_Reference_Intake))
* * `% vol` for percentage per volume (e.g. alcohol vol per 100 ml)
* * `%` for percentage
*
* 🤓 code: see the [Units module][units-module],
* and [Food:default_unit_for_nid function][default-unit]
*
* [units-module]: https://openfoodfacts.github.io/openfoodfacts-server/dev/ref-perl-pod/ProductOpener/Units.html
* [default-unit]: https://openfoodfacts.github.io/openfoodfacts-server/dev/ref-perl-pod/ProductOpener/Food.html#default_unit_for_nid_(_%24nid)
* @enum {string}
*/
nutrient_unit: "g" | "mg" | "μg" | "cl" | "ml" | "dv" | "% vol" | "%";
/**
* @description Nutrients and sub-nutrients of a product, with their name and default unit.
* (e.g. saturated-fat is a sub-nutrient of fat).
*/
Nutrients: components["schemas"]["Nutrient"][]; /** @description List of groups of attributes for personal search in a specific language. */
get_attribute_groups: {
/** @description unique id of the group */id?: string; /** @description Name of the group */
name?: string; /** @description Attributes that are part of this group */
attributes?: {
/** @description unique id of the attribute */id?: string; /** @description Name of the attribute */
name?: string; /** @description url of icon to display next to the settings for this attribute */
icon_url?: string; /** @description a description of the attribute to display to users */
setting_name?: string; /** @description a complementary note on the attribute */
setting_note?: string;
/**
* @description Indicates the default setting for this attribute
* @enum {string}
*/
default?: "mandatory" | "very_important" | "important" | "not_important"; /** @description Linked knowledge panel (optional) */
panel_id?: string;
}[];
}[];
/**
* get_preferences_response
* @description Rules to apply to compute personal ranking of a product,
* based upon the setting value of each attribute.
*/
get_preferences: {
/**
* @description id for the setting value
* @enum {string}
*/
id?: "not_important" | "important" | "very_important" | "mandatory"; /** @description name for the setting value, translated according to `lc` parameter */
name?: string;
/**
* @description factor to apply to the property of the product corresponding to attributes
* having this setting value
*/
factor?: number; /** @description FIXME */
minimum_match?: number;
}[];
product_nutrition_properties: {
/**
* @description Indicates whether the nutrition values refer to the product *as_sold* or *prepared*.
*
* The preparation state affects nutrient values.
* @enum {string}
*/
preparation?: "as_sold" | "prepared";
/**
* @description The nutrition data on the package can be per serving, per 100g or per 100ml.
*
* This is essential to understand if values in the `nutrients` object apply for a serving, for 100g or for 100ml.
* @enum {string}
*/
per?: "100g" | "100ml" | "serving";
};
/**
* @description Quantity of a nutrient
*
* (per 100g, per 100ml or per serving) in a standard unit (g or ml)
*/
nutrient_values_v3_base: {
/**
* @description A normalized float value for the quantity, computed from `value_string` if it exists.
* @example 2
* @example 4.1
*/
value?: number;
/**
* @description The unit of the value entered by the contributor (a user or the manufacturer), for the product.
* In 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.
*
* The possible values depends on the nutrient.
*
* * `g` for grams
* * `mg` for milligrams
* * `μg` for micrograms
* * `cl` for centiliters
* * `ml` for mililiters
* * `dv` for recommended daily intakes (aka [Dietary Reference Intake](https://en.wikipedia.org/wiki/Dietary_Reference_Intake))
* * `% vol` for alcohol vol per 100 ml
*
* 🤓 code: see the [Units module][units-module],
* and [Food:default_unit_for_nid function][default-unit]
*
* [units-module]: https://openfoodfacts.github.io/openfoodfacts-server/dev/ref-perl-pod/ProductOpener/Units.html
* [default-unit]: https://openfoodfacts.github.io/openfoodfacts-server/dev/ref-perl-pod/ProductOpener/Food.html#default_unit_for_nid_(_%24nid)
* @example 公斤
* @example 公升
* @example kg
* @example кг
* @example l
* @example л
* @example 毫克
* @example mg
* @example мг
* @example mcg
* @example µg
* @example oz
* @example fl oz
* @example dl
* @example дл
* @example cl
* @example кл
* @example 斤
* @example g
* @example
* @example
* @example kJ
* @example 克
* @example 公克
* @example г
* @example мл
* @example ml
* @example mmol/l
* @example 毫升
* @example % vol
* @example ph
* @example %
* @example % dv
* @example % vol (alcohol)
* @example iu
* @example mol/l
* @example mval/l
* @example ppm
* @example �rh
* @example �fh
* @example �e
* @example �dh
* @example gpg
*/
unit?: string;
/**
* @description This property is optional.
* @enum {string}
*/
modifier?: "<" | "<=" | "~" | ">=" | ">";
};
nutrients_source_v3: {
/**
* @description Indicates the original source like “packaging”, “manufacturer”, “estimate”, “usda”
* @example packaging
*/
source?: string;
/**
* @description Indicates if the original source is per serving or per 100g, 100ml
* @enum {string}
*/
source_per?: "100g" | "100ml" | "serving"; /** @description Index of the source nutrient set in the input_sets array of the nutrition field */
source_index?: number;
};
nutrients_v3_with_source: {
/**
* @description All known nutrients for the product.
*
* You can get all possible nutrients from the
* [nutrients taxonomy](https://static.openfoodfacts.org/data/taxonomies/nutrients.json).
*
* New nutrients are regularly added.
*
* Clients should not break if they encounter an unexpected nutrient to preserve compatibility.
*/
nutrients?: {
/**
* @description It is the same as `energy-kj` if we have it, or computed from `energy-kcal` otherwise
*
* (per 100g or per serving) in kj
*/
energy?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
/**
* @description energy in kcal, if it is specified
*
* (per 100g or per serving) in a standard unit (g or ml)
*/
energy_kcal?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
/**
* @description energy in kj, if it is specified
*
* (per 100g or per serving) in a standard unit (g or ml)
*/
energy_kj?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
fat?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
"saturated-fat"?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
"trans-fat"?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
cholesterol?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
salt?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
sodium?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
/**
* @description This is the available carbohydrates (excluding fiber), also known as net carbohydrates
*
* (per 100g, per 100ml or per serving) in a standard unit (g or ml)
*/
carbohydrates?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
/**
* @description This follows the US / Canada definition of carbohydrates which includes fiber, also known as gross carbohydrates
*
* (per 100g, per 100ml or per serving) in a standard unit (g or ml)
*/
"carbohydrates-total"?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
fiber?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
sugars?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
"added-sugars"?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
proteins?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
"vitamin-d"?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
calcium?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
iron?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
potassium?: components["schemas"]["nutrient_values_v3_base"] & components["schemas"]["nutrients_source_v3"];
} & {
[key: string]: components["schemas"]["nutrient_values_v3_base"] & {
/** @description Indicates the original source like “packaging”, “manufacturer”, “estimate”, “usda” */source?: string; /** @description Indicates if the original source is per serving or per 100g, 100ml */
source_per?: string;
};
};
};
/**
* @description Quantity of a nutrient
*
* (per 100g, per 100ml or per serving) in a standard unit (g or ml)
*/
nutrient_values_v3_with_value_string: {
/**
* @description A string representing the value of the quantity.
* @example 2.0
* @example 4.1
*/
value_string?: string;
} & components["schemas"]["nutrient_values_v3_base"];
nutrients_v3_base: {
/**
* @description All known nutrients for the product.
*
* You can get all possible nutrients from the
* [nutrients taxonomy](https://static.openfoodfacts.org/data/taxonomies/nutrients.json).
*
* New nutrients are regularly added.
*
* Clients should not break if they encounter an unexpected nutrient to preserve compatibility.
*/
nutrients?: {
/**
* @description It is the same as `energy-kj` if we have it, or computed from `energy-kcal` otherwise
*
* (per 100g or per serving) in kj
*/
energy?: components["schemas"]["nutrient_values_v3_with_value_string"];
/**
* @description energy in kcal, if it is specified
*
* (per 100g or per serving) in a standard unit (g or ml)
*/
energy_kcal?: components["schemas"]["nutrient_values_v3_with_value_string"];
/**
* @description energy in kj, if it is specified
*
* (per 100g or per serving) in a standard unit (g or ml)
*/
energy_kj?: components["schemas"]["nutrient_values_v3_with_value_string"];
fat?: components["schemas"]["nutrient_values_v3_with_value_string"];
"saturated-fat"?: components["schemas"]["nutrient_values_v3_with_value_string"];
"trans-fat"?: components["schemas"]["nutrient_values_v3_with_value_string"];
cholesterol?: components["schemas"]["nutrient_values_v3_with_value_string"];
salt?: components["schemas"]["nutrient_values_v3_with_value_string"];
sodium?: components["schemas"]["nutrient_values_v3_with_value_string"];
/**
* @description This follows the US / Canada definition of carbohydrates which includes fiber, also known as gross carbohydrates
*
* (per 100g, per 100ml or per serving) in a standard unit (g or ml)
*/
"carbohydrates-total"?: components["schemas"]["nutrient_values_v3_with_value_string"];
/**
* @description This is the available carbohydrates (excluding fiber), also known as net carbohydrates
*
* (per 100g, per 100ml or per serving) in a standard unit (g or ml)
*/
carbohydrates?: components["schemas"]["nutrient_values_v3_with_value_string"];
fiber?: components["schemas"]["nutrient_values_v3_with_value_string"];
sugars?: components["schemas"]["nutrient_values_v3_with_value_string"];
"added-sugars"?: components["schemas"]["nutrient_values_v3_with_value_string"];
proteins?: components["schemas"]["nutrient_values_v3_with_value_string"];
"vitamin-d"?: components["schemas"]["nutrient_values_v3_with_value_string"];
calcium?: components["schemas"]["nutrient_values_v3_with_value_string"];
iron?: components["schemas"]["nutrient_values_v3_with_value_string"];
potassium?: components["schemas"]["nutrient_values_v3_with_value_string"];
} & {
[key: string]: components["schemas"]["nutrient_values_v3_with_value_string"];
};
}; /** Product Nutrition Data */
ProductNutritionDataV3: {
/**
* @description Fields related to the nutrition facts of a product
*
* Input nutrient sets can be updated directly with API v3.
*
* API v2 can still be used to update input sets for the default source (*packaging* on the public platform and *manufacturer* on the pro platform).
*/
nutrition?: {
/**
* @description A set that combines nutrient data from preferred sources, with normalized units,
* and for a normalized 100g or 100ml quantity.
*
* It takes values from multiple sources (by priority: manufacturer, packaging, usda, estimate)
* and normalizes all values to the same unit: g for weights, kJ for energy and energy-kj, kcal for energy-kcal.
*
* The aggregated_set is read-only, and cannot be modified directly. It is computed from the other nutrient sets available for the product.
*/
aggregated_set?: components["schemas"]["product_nutrition_properties"] & components["schemas"]["nutrients_v3_with_source"];
/**
* @description An array of nutrient sets of the product.
*
* Each nutrient set represents a version of the nutrition facts, defined by a combination of:
* - the source of the data (e.g. *packaging*, *manufacturer*, *estimate*).
* - the preparation state (e.g. *as_sold* or *prepared*),
* - the reference quantity (*per 100g*, *per 100ml* or *per serving*), and
*
* This structure allows capturing multiple nutritional profiles for a single product.
*/
input_sets?: (components["schemas"]["nutrients_v3_base"] & components["schemas"]["product_nutrition_properties"] & {
/**
* @description The nutrition data on the package can be per serving, per 100g or per 100ml.
* When the data is given per serving,
* the actual quantity that defines one serving may vary between products
* and is stored in this field.
*
* This is essential to understand to which quantity values in `nutrients` apply for.
*
* For example, if the label states "per 250g", then this field should be *250*.
* @example 250
*/
per_quantity?: number;
/**
* @description The nutrition data on the package can be per serving, per 100g or per 100ml.
* When the data is given per serving,
* the actual unit that defines one serving may vary between products
* and is stored in this field.
*
* This is essential to understand to which quantity values in `nutrients` apply for.
*
* For example, if the label states "per 250g", then this field should be *g*.
* @example g
*/
per_unit?: string;
/**
* @description The nutrition data of products can be obtained through several sources.
* @example packaging
* @example manufacturer
* @example usda
* @example estimate
*/
source?: string;
/**
* @description A description of the source used for this nutrition set.
*
* This provides more information on how and when the source was used.
*
* This property is optional.
* @example USDA non-branded foods 2025/04
* @example Import from org-nestle-france through Equadis
* @example Estimate from ingredients”, “Estimate from category: Olive oils
*/
source_description?: string;
/**
* @description A timestamp indicating when this nutrition set was last updated.
* @example 1631270265
* @example 1512153487
*/
last_updated_t?: number;
/**
* @description A list of nutrients that are typically present, but that are not specified for this particular product,
* especially for packaging source.
*
* This property is optional.
* @example [
* "fibers"
* ]
*/
unspecified_nutrients?: string[];
})[];
};
};
};
responses: never;
parameters: {
id: string;
process_image: string;
ocr_engine: string;
imgid: string;
angle: string; /** @description The page number you request to view (eg. in search results spanning multiple pages) */
page: number; /** @description The number of elements should be sent per page */
page_size: number;
/**
* @description The allowed values used to sort/order the search results.
*
* * `product_name` sorts on name
* * `ecoscore_score`, `nova_score`, `nutriscore_score` rank on the [Eco-Score](https://world.openfoodfacts.org/eco-score-the-environmental-impact-of-food-products), [Nova](https://world.openfoodfacts.org/nova), or [Nutri-Score](https://world.openfoodfacts.org/nutriscore)
* * `scans_n`, `unique_scans_n` and `popularity_key` are about product popularity: number of scans on unique scans, rank of product
* * `created_t`, `last_modified_t`, are about creation and modification dates
* * `nothing`, tells not to sort at all (because if you do not provide the sort_by argument we default to sorting on popularity (for food) or last modification date)
*/
sort_by: "product_name" | "last_modified_t" | "scans_n" | "unique_scans_n" | "created_t" | "completeness" | "popularity_key" | "nutriscore_score" | "nova_score" | "nothing" | "ecoscore_score";
term: string; /** @description Used for READ queries for one product. Expected product type of the requested product. Defaults to the product type of the server the query is sent to (e.g. 'food' for Open Food Facts, 'beauty' for Open Beauty Facts, etc.). 'all' matches all product types. If the product exists on a different server that matches the requested product type, the API will return a 302 redirect to the correct server. Otherwise, the API will return a 404 error. It is possible that new product types will be added in the future. */
RequestedProductType: "all" | "beauty" | "food" | "petfood" | "product"; /** @description 2 letter code of the country of the user. Used for localizing some fields in returned values (e.g. knowledge panels). If not passed, the country may be inferred by the IP address of the request. */
Cc: string;
/**
* @description 2 letter code of the language of the user.
* Used for localizing some fields in returned values (e.g. knowledge panels).
* If not passed, the language may be inferred by the domain name prefix.
*/
Lc: string; /** @description Specific fields to return. Use 'knowledge_panels' for Knowledge Panels only. */
ProductAvailableFields: string; /** @description Client requesting knowledge panels. Used to customize which knowledge panels are returned. Example values: "web", "mobile". Defaults to "app" for all API requests, and "web" for all other requests. */
KnowledgePanelClient: string; /** @description If true, knowledge panels will include the simplified_root knowledge panel its simplified sub-panels (e.g. simplified health and environment cards) */
ActivateKnowledgePanelsSimplified: boolean; /** @description If true, knowledge panels will include the physical activities panel */
ActivateKnowledgePanelPhysicalActivities: boolean; /** @description When knowledge_panels are requested, you can specify which panels should be in the response. All the others will be excluded. */
KnowledgePanelsIncluded: string;
/**
* @description When knowledge_panels are requested, you can specify which panels to exclude from the response. All the others will be included.
* If a panel is both excluded and included (with the knowledge_panels_excluded parameter), it will be excluded.
*/
KnowledgePanelsExcluded: string;
/**
* @description Include blame information in the response showing who last modified each field of the product.
* The blame information contains the user ID, timestamp, revision number, and value for each field.
* Set to a non-empty and non-0 value (e.g. 1 or true) to enable.
*/
Blame: string; /** @description Barcode of the product */
Code: string;
/**
* @description The additives_tags in english of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/additives) has a list of possible values for `additives`. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/additives.json
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
additives_tags: string;
/**
* @description The allergens_tags in english of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/allergens) has a list of possible values for `allergens`. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/allergens.json
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
allergens_tags: string;
/**
* @description The brands_tags of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/brands) has a list of possible values for `brands`. Taxonomized values are available at https://static.openfoodfacts.org/data/taxonomies/brands.json
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
brands_tags: string;
/**
* @description The category of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/categories) has a list of possible values for `categories`. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/categories.json
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
categories_tags: string;
/**
* @description The countries_tags_en of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/countries) shows a list of possible values for `countries`. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/countries.json
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
countries_tags: string;
/**
* @description The emb_codes_tags of product(s) you are searching for.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
emb_codes_tags: string;
/**
* @description The labels_tags in english of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/labels) has a list of possible values for `labels`.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
labels_tags: string;
/**
* @description The manufacturing_places_tags of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/manufacturing-places) has a list of possible values for `manufacturing-places`.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
manufacturing_places_tags: string;
/**
* @description The nutrition_grades_tags of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/nutrition-grades) has a list of possible values for `nutrition-grades`.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
nutrition_grades_tags: string;
/**
* @description The origins_tags of product(s) you are searching for. The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/origins) has a list of possible values for `origins`.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
origins_tags: string;
/**
* @description The packaging_tag in german of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/packaging) has a list of possible values for `packaging`.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
packaging_tags: string;
/**
* @description The purchase_places_tags of product(s) you are searching for.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
purchase_places_tags: string;
/**
* @description The states_tags in english of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/states) has a list of possible values for `states`. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/states.json
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
states_tags: string;
/**
* @description The stores_tags of product(s) you are searching for.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
stores_tags: string;
/**
* @description The traces_tags of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/traces) shows a list of possible values for `traces`.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
traces_tags: string; /** @description You can add a language code to a specific tag to query it in a specific language */
tag_name_with_language_code: {
[key: string]: string;
}; /** @description Search on nutrient lower than a value */
nutrient_lower_than: {
[key: string]: string;
}; /** @description Search on nutrient greater than a value */
nutrient_greater_than: {
[key: string]: string;
}; /** @description Search on nutrient for an exact quantity */
nutrient_equal: {
[key: string]: string;
}; /** @description Type of a tag / id of a tags taxonomy (e.g. categories, labels, ingredients, etc.) */
Tagtype: string;
};
requestBodies: never;
headers: never;
pathItems: never;
}
interface operations {
"get-product-by-code": {
parameters: {
query?: {
/** @description Used for READ queries for one product. Expected product type of the requested product. Defaults to the product type of the server the query is sent to (e.g. 'food' for Open Food Facts, 'beauty' for Open Beauty Facts, etc.). 'all' matches all product types. If the product exists on a different server that matches the requested product type, the API will return a 302 redirect to the correct server. Otherwise, the API will return a 404 error. It is possible that new product types will be added in the future. */product_type?: components["parameters"]["RequestedProductType"]; /** @description 2 letter code of the country of the user. Used for localizing some fields in returned values (e.g. knowledge panels). If not passed, the country may be inferred by the IP address of the request. */
cc?: components["parameters"]["Cc"];
/**
* @description 2 letter code of the language of the user.
* Used for localizing some fields in returned values (e.g. knowledge panels).
* If not passed, the language may be inferred by the domain name prefix.
*/
lc?: components["parameters"]["Lc"]; /** @description Specific fields to return. Use 'knowledge_panels' for Knowledge Panels only. */
fields?: components["parameters"]["ProductAvailableFields"]; /** @description Client requesting knowledge panels. Used to customize which knowledge panels are returned. Example values: "web", "mobile". Defaults to "app" for all API requests, and "web" for all other requests. */
knowledge_panel_client?: components["parameters"]["KnowledgePanelClient"]; /** @description If true, knowledge panels will include the simplified_root knowledge panel its simplified sub-panels (e.g. simplified health and environment cards) */
activate_knowledge_panels_simplified?: components["parameters"]["ActivateKnowledgePanelsSimplified"]; /** @description If true, knowledge panels will include the physical activities panel */
activate_knowledge_panel_physical_activities?: components["parameters"]["ActivateKnowledgePanelPhysicalActivities"]; /** @description When knowledge_panels are requested, you can specify which panels should be in the response. All the others will be excluded. */
knowledge_panels_included?: components["parameters"]["KnowledgePanelsIncluded"];
/**
* @description When knowledge_panels are requested, you can specify which panels to exclude from the response. All the others will be included.
* If a panel is both excluded and included (with the knowledge_panels_excluded parameter), it will be excluded.
*/
knowledge_panels_excluded?: components["parameters"]["KnowledgePanelsExcluded"];
/**
* @description Include blame information in the response showing who last modified each field of the product.
* The blame information contains the user ID, timestamp, revision number, and value for each field.
* Set to a non-empty and non-0 value (e.g. 1 or true) to enable.
*/
blame?: components["parameters"]["Blame"];
};
header?: never;
path: {
/** @description The barcode of the product to be fetched */code: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["get_product_by_barcode"] | (components["schemas"]["get_product_by_barcode_base"] & {
product?: components["schemas"]["product_knowledge_panels"];
}) | components["schemas"]["get_product_by_barcode_with_blame"];
};
}; /** @description Redirect to the correct server for the product type of the requested product */
302: {
headers: {
Location?: string;
[name: string]: unknown;
};
content?: never;
}; /** @description Product not found */
404: {
headers: {
[name: string]: unknown;
};
content?: never;
};
};
};
"get-cgi-product_image_upload.pl": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: {
content: {
"multipart/form-data": components["schemas"]["add_photo_to_existing_product"] & components["schemas"]["change_ref_properties"];
};
};
responses: {
/** @description OK */200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["add_photo_to_existing_product-2"];
};
};
};
};
"get-cgi-ingredients.pl": {
parameters: {
query: {
id: components["parameters"]["id"]; /** @description Barcode of the product */
code: components["parameters"]["Code"];
process_image: components["parameters"]["process_image"];
ocr_engine: components["parameters"]["ocr_engine"];
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ocr_on_product"];
};
};
};
};
"get-cgi-product_image_crop.pl": {
parameters: {
query: {
/** @description Barcode of the product */code: components["parameters"]["Code"];
id: components["parameters"]["id"];
imgid: components["parameters"]["imgid"];
angle: components["parameters"]["angle"];
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["rotate_a_photo"];
};
};
};
};
"post-cgi-product_image_crop.pl": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"multipart/form-data": components["schemas"]["crop_a_photo"] & components["schemas"]["change_ref_properties"];
};
};
responses: {
/** @description OK */200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["product_image_crop"];
};
};
};
};
"post-cgi-product_image_unselect.pl": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: {
content: {
"multipart/form-data": components["schemas"]["unselect_a_photo"];
};
};
responses: {
/** @description OK */200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
/**
* @description status of the unselect operation
* @example status ok
*/
status?: string;
/**
* @description status code of the operation
* @example 0
*/
status_code?: number;
/**
* @description image field that was unselected
* @example front_fr
*/
imagefield?: string;
};
};
};
};
};
"post-cgi-product_jqm2.pl": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: {
content: {
"multipart/form-data": components["schemas"]["add_or_edit_a_product"] & components["schemas"]["change_ref_properties"];
};
};
responses: {
/** @description OK */200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["add_or_edit_a_product-2"];
};
};
};
};
"get-search": {
parameters: {
query?: {
/**
* @description The additives_tags in english of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/additives) has a list of possible values for `additives`. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/additives.json
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
additives_tags?: components["parameters"]["additives_tags"];
/**
* @description The allergens_tags in english of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/allergens) has a list of possible values for `allergens`. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/allergens.json
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
allergens_tags?: components["parameters"]["allergens_tags"];
/**
* @description The brands_tags of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/brands) has a list of possible values for `brands`. Taxonomized values are available at https://static.openfoodfacts.org/data/taxonomies/brands.json
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
brands_tags?: components["parameters"]["brands_tags"];
/**
* @description The category of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/categories) has a list of possible values for `categories`. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/categories.json
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
categories_tags?: components["parameters"]["categories_tags"];
/**
* @description The countries_tags_en of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/countries) shows a list of possible values for `countries`. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/countries.json
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
countries_tags_en?: components["parameters"]["countries_tags"];
/**
* @description The emb_codes_tags of product(s) you are searching for.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
emb_codes_tags?: components["parameters"]["emb_codes_tags"];
/**
* @description The labels_tags in english of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/labels) has a list of possible values for `labels`.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
labels_tags?: components["parameters"]["labels_tags"];
/**
* @description The manufacturing_places_tags of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/manufacturing-places) has a list of possible values for `manufacturing-places`.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
manufacturing_places_tags?: components["parameters"]["manufacturing_places_tags"];
/**
* @description The nutrition_grades_tags of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/nutrition-grades) has a list of possible values for `nutrition-grades`.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
nutrition_grades_tags?: components["parameters"]["nutrition_grades_tags"];
/**
* @description The origins_tags of product(s) you are searching for. The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/origins) has a list of possible values for `origins`.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
origins_tags?: components["parameters"]["origins_tags"];
/**
* @description The packaging_tag in german of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/packaging) has a list of possible values for `packaging`.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
packaging_tags_de?: components["parameters"]["packaging_tags"];
/**
* @description The purchase_places_tags of product(s) you are searching for.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
purchase_places_tags?: components["parameters"]["purchase_places_tags"];
/**
* @description The states_tags in english of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/states) has a list of possible values for `states`. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/states.json
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
states_tags?: components["parameters"]["states_tags"];
/**
* @description The stores_tags of product(s) you are searching for.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
stores_tags?: components["parameters"]["stores_tags"];
/**
* @description The traces_tags of product(s) you are searching for.
* The [Open Food Facts Web App](https://world.openfoodfacts.org/facets/traces) shows a list of possible values for `traces`.
*
* You can use multiple values by using a comma separated list.
* You can add a "-" before values to avoid matching a tag.
*/
traces_tags?: components["parameters"]["traces_tags"]; /** @description You can add a language code to a specific tag to query it in a specific language */
"_tags_"?: components["parameters"]["tag_name_with_language_code"]; /** @description Search on nutrient lower than a value */
"_lt_"?: components["parameters"]["nutrient_lower_than"]; /** @description Search on nutrient greater than a value */
"_gt_"?: components["parameters"]["nutrient_greater_than"]; /** @description Search on nutrient for an exact quantity */
"_eq_"?: components["parameters"]["nutrient_equal"]; /** @description Specific fields to return. Use 'knowledge_panels' for Knowledge Panels only. */
fields?: components["parameters"]["ProductAvailableFields"];
/**
* @description The allowed values used to sort/order the search results.
*
* * `product_name` sorts on name
* * `ecoscore_score`, `nova_score`, `nutriscore_score` rank on the [Eco-Score](https://world.openfoodfacts.org/eco-score-the-environmental-impact-of-food-products), [Nova](https://world.openfoodfacts.org/nova), or [Nutri-Score](https://world.openfoodfacts.org/nutriscore)
* * `scans_n`, `unique_scans_n` and `popularity_key` are about product popularity: number of scans on unique scans, rank of product
* * `created_t`, `last_modified_t`, are about creation and modification dates
* * `nothing`, tells not to sort at all (because if you do not provide the sort_by argument we default to sorting on popularity (for food) or last modification date)
*/
sort_by?: components["parameters"]["sort_by"]; /** @description The page number you request to view (eg. in search results spanning multiple pages) */
page?: components["parameters"]["page"]; /** @description The number of elements should be sent per page */
page_size?: components["parameters"]["page_size"];
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["search_for_products"];
};
};
};
};
"get-cgi-suggest.pl": {
parameters: {
query: {
/** @description Type of a tag / id of a tags taxonomy (e.g. categories, labels, ingredients, etc.) */tagtype: components["parameters"]["Tagtype"];
term?: components["parameters"]["term"];
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": string[];
};
};
};
};
"get-cgi-nutrients.pl": {
parameters: {
query?: {
/** @description 2 letter code of the country of the user. Used for localizing some fields in returned values (e.g. knowledge panels). If not passed, the country may be inferred by the IP address of the request. */cc?: components["parameters"]["Cc"];
/**
* @description 2 letter code of the language of the user.
* Used for localizing some fields in returned values (e.g. knowledge panels).
* If not passed, the language may be inferred by the domain name prefix.
*/
lc?: components["parameters"]["Lc"];
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Nutrients"];
};
};
};
};
"get-attribute-groups": {
parameters: {
query?: {
/**
* @description 2 letter code of the language of the user.
* Used for localizing some fields in returned values (e.g. knowledge panels).
* If not passed, the language may be inferred by the domain name prefix.
*/
lc?: components["parameters"]["Lc"];
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["get_attribute_groups"];
};
};
};
};
"get-preferences": {
parameters: {
query?: {
/**
* @description 2 letter code of the language of the user.
* Used for localizing some fields in returned values (e.g. knowledge panels).
* If not passed, the language may be inferred by the domain name prefix.
*/
lc?: components["parameters"]["Lc"];
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["get_preferences"];
};
};
};
};
"get-cgi-session.pl": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/x-www-form-urlencoded": {
/**
* @description Username for login
*
* Note: you must always use the username (and not the email)
* as it is far less brittle.
*/
user_id: string;
/**
* Format: password
* @description Password for login
*/
password: string;
};
};
};
responses: {
/** @description Successful login */200: {
headers: {
"Set-Cookie"?: string;
[name: string]: unknown;
};
content?: never;
}; /** @description Authentication failed */
401: {
headers: {
[name: string]: unknown;
};
content?: never;
};
};
};
}
//#endregion
export { components, operations, paths };
//# sourceMappingURL=v2.d.ts.map