Open Food Facts

App · Food & Drink · 3 actions

Look up food products by barcode in the Open Food Facts database using the free, keyless v3 API, no account or API key required for reads. Get product details plus computed values like the Nutri-Score, NOVA group, Green-Score, ingredients, and allergens, and fetch taxonomy autocomplete suggestions. Data is contributed by volunteers and is provided under the Open Database License without any guarantee of accuracy or completeness, so verify it before relying on it for dietary or allergen decisions. Disclaimer: this is an independent integration with the community-run Open Food Facts project (openfoodfacts.org); it is not affiliated with, endorsed by, or sponsored by Open Food Facts or the non-profit that operates it.

Actions

ActionWhat it does
Get a product by barcodeLook up a food product in the Open Food Facts database by its barcode using the v3 API.
Get taxonomy suggestionsGet autocomplete suggestions from an Open Food Facts taxonomy, for example matching category, label, or brand names as a user types.
List attribute groupsList the attribute-group definitions Open Food Facts uses to rate products: nutritional quality (Nutri-Score), food processing (NOVA), allergens, labels, and more.

Get a product by barcode

Look up a food product in the Open Food Facts database by its barcode using the v3 API. Returns the product's details along with computed values such as the Nutri-Score, NOVA processing group, Green-Score, nutrient levels, ingredients, and allergens (when Open Food Facts has enough data to compute them). A barcode that isn't in the database yet comes back as a not-found result rather than an error, so a workflow can branch on it: status is 'failure', and result.id is 'product_not_found', or 'product_found_with_a_different_product_type' for a cosmetic, pet food, or other non-food product. By default a curated set of the most useful fields is returned; pass a comma-separated Fields list to choose your own, or 'all' for the complete record.

Inputs

BarcodebarcodetextRequired
The product barcode (EAN/UPC), digits only, for example, 3017620422003 for Nutella.
Fieldsfieldstext
Optional comma-separated list of fields to return (for example, product_name, nutriscore_grade, nutriments). Leave blank for a curated default set, or pass 'all' for the complete product record. Add attribute_groups to see how the product rates on each attribute from 'List attribute groups'. Green-Score fields use their original ecoscore_ names, for example ecoscore_grade.
Languagelanguagetext
Optional two-letter language code (for example, en or fr). The product name, generic name, and ingredient text come back in that language when the product has a translation (also returned as, for example, ingredients_text_en), and in the product's original language when it doesn't.
Countrycountrytext
Optional two-letter country code (for example, us or fr) used to localize country-specific values.

Outputs

codetext
errorslist
productobject
resultobject
statustext
warningslist
Example output
{
  "code": "3017620422003",
  "errors": [],
  "product": {
    "additives_tags": [
      "en:e322"
    ],
    "allergens_tags": [
      "en:milk",
      "en:nuts",
      "en:soybeans"
    ],
    "brands": "Nutella,Ferrero",
    "categories_tags": [
      "en:breakfasts",
      "en:spreads",
      "en:sweet-spreads",
      "en:hazelnut-spreads"
    ],
    "code": "3017620422003",
    "ecoscore_grade": "d",
    "image_front_url": "https://images.openfoodfacts.org/images/products/301/762/042/2003/front_en.400.jpg",
    "ingredients_text": "Sugar, palm oil, hazelnuts 13%, skimmed milk powder 8.7%, fat-reduced cocoa 7.4%, emulsifier: lecithins (soya), vanillin.",
    "labels_tags": [
      "en:no-gluten"
    ],
    "nova_group": 4,
    "nutrient_levels": {
      "fat": "high",
      "salt": "low",
      "saturated-fat": "high",
      "sugars": "high"
    },
    "nutriments": {
      "energy-kcal_100g": 539,
      "energy-kj_100g": 2252,
      "fat_100g": 30.9,
      "proteins_100g": 6.3,
      "salt_100g": 0.107,
      "saturated-fat_100g": 10.6,
      "sugars_100g": 56.3
    },
    "nutriscore_grade": "e",
    "product_name": "Nutella",
    "quantity": "400 g"
  },
  "result": {
    "id": "product_found",
    "lc_name": "Product found",
    "name": "Product found"
  },
  "status": "success",
  "warnings": []
}

Get taxonomy suggestions

Get autocomplete suggestions from an Open Food Facts taxonomy, for example matching category, label, or brand names as a user types. Useful for offering valid tag values when building or filtering product data.

Inputs

TaxonomytagtypetextRequired
Which taxonomy to draw suggestions from.One of: categories, labels, brands, countries, ingredients, additives, allergens, origins, packaging, states, languages.
Queryquerytext
Optional text to match against the taxonomy (for example, choco); entries that start with it come first. Leave blank to list the taxonomy's entries in alphabetical order.
Languagelanguagetext
Optional two-letter language code (for example, en or fr) for the returned suggestion labels.
Limitlimitnumber
Optional maximum number of suggestions to return (default 25, at most 400).From 1 to 400.

Outputs

suggestionslist
Example output
{
  "suggestions": [
    "Chocolates",
    "Chocolate biscuits",
    "Chocolate spreads",
    "Dark chocolates",
    "Milk chocolates"
  ]
}

List attribute groups

List the attribute-group definitions Open Food Facts uses to rate products: nutritional quality (Nutri-Score), food processing (NOVA), allergens, labels, and more. Handy for building preference-based scoring or filtering. To see how a particular product rates on them, add attribute_groups to the Fields of 'Get a product by barcode'.

Inputs

Languagelanguagetext
Optional two-letter language code (for example, en or fr) for the returned attribute names and descriptions.

Outputs

attribute_groupslist
Example output
{
  "attribute_groups": [
    {
      "attributes": [
        {
          "id": "nutriscore",
          "name": "Nutri-Score",
          "setting_name": "Good nutritional quality (Nutri-Score)"
        }
      ],
      "id": "nutritional_quality",
      "name": "Nutritional quality"
    },
    {
      "attributes": [
        {
          "id": "nova",
          "name": "NOVA group",
          "setting_name": "No or little food processing (NOVA group)"
        }
      ],
      "id": "processing",
      "name": "Food processing"
    },
    {
      "attributes": [
        {
          "id": "allergens_no_gluten",
          "name": "Without gluten"
        }
      ],
      "id": "allergens",
      "name": "Allergens"
    }
  ]
}

On this page