Edit Product
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.
Session cookie containing user ID, username, and session token.
The value is structured as: user_id&username&user_session&session_token
e.g. "user_id&exampleuser&user_session&abcdefghijklmnopqrstuvwxyz123456789ABCDEFGHIJKLM".
The session token is obtained after successful login via the /cgi/session.pl endpoint.
In: cookie
Identification using the User-Agent header. This is recommended in all requests so that we can contact you if there are issues. If we cannot identify the source of problematic API queries, we may have to block them. User-Agent header in the format 'app_name/app_version (URL or contact info)'
In: header
The barcode of the product to be added or edited
Username to authenticate with
Note: you must always use the username (and not the email) as it is far less brittle.
Password to authenticate with
password2 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
2 letter language code of the main language of the product (the most prominent on the packaging)
Product name in the language sent in the lc field. For backward compatibility only, use the field product_name_[language_code] instead.
Abbreviated product name. For backward compatibility only, use the field abbreviated_product_name_[language_code] instead.
Legal name of the product. For backward compatibility only, use the field generic_name_[language_code] instead.
Raw list of ingredients text. For backward compatibility only, use the field ingredients_text_[language_code] instead.
Packaging information text. For backward compatibility only, use the field packaging_text_[language_code] instead.
Product quantity with unit
Product labels (comma-separated list)
Product categories (comma-separated list)
Product brands (comma-separated list)
Stores where product is sold
Countries where product is sold
Origins of ingredients
Traces of allergens
Packaging type, format, material.
The v3 API documentation
has a more structured data for packaging.
Serving size
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.
"100g" | "serving"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.
"beauty" | "food" | "petfood" | "product"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.
Name of the app providing the information
Version of the app providing the information
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.
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.
Product name in language designated by language_code
Abbreviated product name in language designated by language_code
Generic/legal name in language designated by language_code
Ingredients list in language designated by language_code, as it appears on the packaging
Packaging information text in language designated by language_code
Value for the nutrient designated by nutrient_id (from nutrients.txt taxonomy, e.g. energy-kj, energy-kcal, fat, saturated-fat, etc.)
Unit for the nutrient designated by nutrient_id (from nutrients.txt taxonomy, e.g. energy-kj, fat etc.)
Response Body
curl -X POST "https://world.openfoodfacts.net/cgi/product_jqm2.pl" \ -F code="0074570036004" \ -F user_id="string" \ -F password="pa$$word"{
"status_verbose": "fields saved",
"status": 1
}