Products

Get Product Details

Changed on

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/api/v2/product/{code}

Request

  • Base URL
    https://world.openfoodfacts.net
  • Auth
    API key in header User-Agent

Path parameters

codestring required
Example:3017620422003

The barcode of the product to be fetched

Query parameters

product_type'all' | 'beauty' | 'food' | 'petfood' | 'product'

Expected product type of the requested product

Example:all

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.

ccstring
Example:us

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.

lcstring
Example:fr

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.

fieldsstring

Custom comma-separated list of product field names

Example:knowledge_panels

Specific fields to return. Use 'knowledge_panels' for Knowledge Panels only.

knowledge_panel_clientstring
Example:web

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.

activate_knowledge_panels_simplifiedboolean
Example:true

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_ingredients_nutrition_firstboolean
Example:true

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

activate_knowledge_panel_physical_activitiesboolean
Example:true

If true, knowledge panels will include the physical activities panel

activate_knowledge_panel_product_historyboolean
Example:true

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)

activate_knowledge_panel_product_informationboolean
Example:true

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

knowledge_panels_includedstring
Example:health_card, environment_card

When knowledge_panels are requested, you can specify which panels should be in the response. All the others will be excluded.

knowledge_panels_excludedstring
Example:health_card, environment_card

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.

blamestring
Example:1

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.

Response

OK

OR
OR

Example response

{
  "product": {
    "codes_tags": [
      "code-13"
    ],
    "product_quantity": "500",
    "product_quantity_unit": "g",
    "quantity": "3 x 150 g",
    "schema_version": 999,
    "packaging_text": "packaging_text_en",
    "packagings": [
      {
        "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"
      }
    ],
    "popularity_tags": [
      "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"
    ],
    "serving_quantity_unit": "g",
    "emb_codes": "EMB 2013330",
    "entry_dates_tags": [
      "2016-03-11",
      "2016-03",
      "2016"
    ],
    "images": {
      "front": {
        "coordinates_image_size": "full",
        "geometry": "0x0--1--1",
        "imgid": "121",
        "rev": "420",
        "sizes": {
          "100": {
            "h": 400,
            "w": 255
          },
          "200": {
            "h": 400,
            "w": 255
          },
          "400": {
            "h": 400,
            "w": 255
          },
          "full": {
            "h": 400,
            "w": 255
          }
        },
        "x1": "-1",
        "x2": "-1",
        "y1": "-1",
        "y2": "-1"
      }
    },
    "ecoscore_data": {
      "adjustments": {
        "packaging": {
          "packagings": [
            {
              "number_of_units": 1,
              "quantity_per_unit": "33 cL",
              "quantity_per_unit_unit": "cl",
              "quantity_per_unit_value": 33,
              "recycling": "en:recycle-in-sorting-bin",
              "weight_measured": 12.08
            }
          ]
        }
      }
    },
    "ingredients_text": "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.\n",
    "ingredients_text_with_allergens": "Farine de <span class=\"allergen\">blé*</span> 67,4%, sucre de canne*, huile de tournesol oléique*, graines de chia* 5,2%, <span class=\"allergen\">son de blé*</span>, oranges déshydratées * 0,9%, farine de riz*, poudres à lever (acide citrique, carbonates de sodium), arôme naturel d'orange.\n",
    "no_nutrition_data": "on",
    "nutriments": {
      "erythritol": 12.5
    },
    "nutriscore_data": {
      "energy": 1996,
      "energy_points": 5,
      "energy_value": 1996,
      "fiber": 3.8,
      "fiber_points": 4,
      "fiber_value": 3.8,
      "proteins": 6.6,
      "proteins_points": 4,
      "proteins_value": 6.6,
      "saturated_fat": 6.2,
      "saturated_fat_points": 6,
      "saturated_fat_value": 6.2,
      "sodium": 210,
      "sodium_points": 2,
      "sodium_value": 210,
      "sugars": 21.5,
      "sugars_points": 4,
      "sugars_value": 21.5,
      "negative_points": 17,
      "positive_points": 4,
      "grade": "d",
      "score": 13
    },
    "nutriscore": {
      "2021": {
        "category_available": 1,
        "grade": "d",
        "nutrients_available": 1,
        "nutriscore_applicable": 1,
        "nutriscore_computed": 1,
        "score": 13,
        "data": {
          "energy": 1996,
          "energy_points": 5,
          "energy_value": 1996,
          "fiber": 3.8,
          "fiber_points": 4,
          "fiber_value": 3.8,
          "proteins": 6.6,
          "proteins_points": 4,
          "proteins_value": 6.6,
          "saturated_fat": 6.2,
          "saturated_fat_points": 6,
          "saturated_fat_value": 6.2,
          "sodium": 210,
          "sodium_points": 2,
          "sodium_value": 210,
          "sugars": 21.5,
          "sugars_points": 4,
          "sugars_value": 21.5,
          "negative_points": 17,
          "positive_points": 4,
          "grade": "d",
          "score": 13
        }
      },
      "2023": {
        "category_available": 1,
        "grade": "d",
        "nutrients_available": 1,
        "nutriscore_applicable": 1,
        "nutriscore_computed": 1,
        "score": 13,
        "data": {
          "components": {
            "negative": [
              {
                "id": "energy",
                "points": 5,
                "points_max": 10,
                "unit": "kJ",
                "value": 21.5
              }
            ],
            "positive": [
              {
                "id": "energy",
                "points": 5,
                "points_max": 10,
                "unit": "kJ",
                "value": 21.5
              }
            ]
          },
          "count_proteins_reason": "negative_points_greater_than_or_equal_to_11",
          "negative_points": 19,
          "positive_points": 1,
          "negative_points_max": 55,
          "positive_points_max": 10,
          "positive_nutrients": [
            "fiber",
            "fruits_vegetables_legumes"
          ]
        }
      }
    },
    "nutriscore_2021_tags": [
      "d"
    ],
    "nutriscore_2023_tags": [
      "d"
    ],
    "nutriscore_grade": "d",
    "nutriscore_score": 13,
    "nutriscore_score_opposite": -13,
    "nutriscore_tags": [
      "d"
    ],
    "purchase_places": "Paris",
    "stores": "Walmart",
    "created_t": 1457680652,
    "last_modified_by": "sebleouf",
    "knowledge_panels": {
      "additionalProperties": "string"
    },
    "attribute_groups": [
      {
        "title": "Does not contain: Molluscs"
      }
    ]
  }
}

Changes

    • breaking

      added to the response body oneOf list for the response status

    • breaking

      the oneOf[subschema #2: get_product_by_barcode_knowledge_panels_response]/allOf[subschema #2]/product response's property type changed from no type to object for status

    • info

      added the new optional query request parameter activate_knowledge_panel_physical_activities

    16 more changes in this revision