Get Product Data
Changed onRetrieve information for a product with a specific barcode.
The fields parameter allows to specify what fields to retrieve.
Request
- Base URLhttps://world.openfoodfacts.org
- AuthAPI key in header User-Agent
Path parameters
The barcode of the product to be fetched
Query parameters
Expected product type of the requested product
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.
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.
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.
2 letter language code to request names of tags in a specific language.
For READ requests: if passed, all taxonomized tags of the response will include a lc_name property with the translation in the requested language, if available. Otherwise, the property value will contain the name in the original language, prefixed by the 2 language code and a colon.
For WRITE requests: if passed, taxonomized tags fields with a lc_name property will be considered to be in this language.
Comma separated list of fields requested in the response.
Special values:
- "none": returns no fields
- "raw": returns all fields as stored internally in the database
- "all": returns all fields except generated fields that need to be explicitly requested such as "knowledge_panels".
Defaults to "all" for READ requests. The "all" value can also be combined with fields like "attribute_groups" and "knowledge_panels".
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.
If true, knowledge panels will include the simplified_root knowledge panel its simplified sub-panels (e.g. simplified health and environment cards)
If true, the root knowledge panel starts with an ingredients card and a nutrition card, followed by collapsed health and environment cards with a one-line summary, the product information card, and a collapsed report a problem card. The ingredients and nutrition cards are part of the health card: knowledge_panels_included and knowledge_panels_excluded select them with health_card
If true, knowledge panels will include the physical activities panel
If true, and if the user is logged in, knowledge panels will include the product_history panel (a table of the changes history of the product, in the contribution card)
If true, the product_card panel also lists the storage conditions and customer service of the product when filled, and a sources_manufacturer panel is returned for products of a producer organization
When knowledge_panels are requested, you can specify which panels should be in the response. All the others will be excluded.
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.
Response
OK
Example response
{
"status": "success_with_errors",
"result": {
"id": "product_updated",
"name": "Product updated",
"lc_name": "Produit mis à jour"
},
"errors": [
{
"message": {
"id": "sugars_higher_than_carbohydrates",
"name": "Sugars higher than carbohydrates",
"lc_name": "Sucres plus élevés que les glucides",
"description": "Sugars (40g) are higher than carbohydrates (35g).",
"lc_description": "Les sucres (40g) sont plus élévés que les glucdes."
},
"field": {
"id": "nutriment.sugars",
"value": "40"
},
"impact": {
"id": "nutrients_not_updated",
"name": "Nutrients not updated",
"lc_name": "Nutriments non mis à jour",
"description": "The nutrients were not updated.",
"lc_description": "Les nutriments n'ont pas été mis à jour."
}
}
]
}Changes
- breaking
the
allOf[subschema #2]/productresponse's property type changed from no type toobjectfor status - info
added the new optional
queryrequest parameteractivate_knowledge_panel_physical_activities - info
added the new optional
queryrequest parameteractivate_knowledge_panel_product_history
13 more changes in this revision
- breaking