# Open Food Facts API

> Open Food Facts returns packaged food ingredients, allergens, nutrition, and product details as a workflow and API.

Open Food Facts (OFF) looks up a packaged food by barcode or product name and brand, returning ingredients, allergens, nutrition, and product details. Search products finds packaged foods by required search words, with optional diet, country, and brand filters.

- Page: https://fous.com/workflows/open-food-facts
- Handle: `@open-food-facts`
- Category: [Food](https://fous.com/workflows/category/food)
- Source website: https://world.openfoodfacts.org
- Last verified: Sep 29, 2026
- Fous is not affiliated with Open Food Facts.

## Methods

### Get product

Operation `get_product`, version 1. 1 credit per call.

Get ingredients, allergens, Nutri-Score, NOVA processing level, and nutrition for a packaged food by barcode or product name and brand. Missing fields remain empty; name searches select the most complete close match.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `product` | string | yes | `"3017620422003"` | Product name with brand or barcode printed on the pack, for example Nutella Ferrero or 3017620422003. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "product"
  ],
  "properties": {
    "product": {
      "type": "string",
      "description": "Product name with brand or barcode printed on the pack, for example Nutella Ferrero or 3017620422003.",
      "examples": [
        "3017620422003",
        "Nutella Ferrero"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "product": "3017620422003"
    },
    {
      "product": "Nutella Ferrero"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `brand` | string or null | `"Nutella, Ferrero"` | Brand or brands. |
| `barcode` | string | `"3017620422003"` | Product barcode. |
| `quantity` | string or null | `"400 g e"` | Pack quantity as labeled. |
| `allergens` | array |  | Allergens in words. |
| `photo_link` | string or null | `"https://images.openfoodfacts.org/images/products/301/762/042/2003/front_en.879.400.jpg"` | Product photo link. |
| `nova_number` | integer or null | `4` | NOVA group number, 1 to 4. |
| `nutri_score` | string or null | `"E - poor nutritional quality"` | Nutri-Score letter A–E and its nutrition-quality meaning. |
| `product_name` | string or null | `"Nutella"` | Name printed for the product. |
| `ingredients_text` | string or null | `"Sugar, vegetable fat (palm), hazelnuts (13%), skimmed milk powder (8.7%), fat-reduced cocoa powder (7.4%), emulsifier: ` | Ingredients, in English when available. |
| `processing_level` | string or null | `"Ultra-processed food"` | NOVA processing level in words. |
| `countries_sold_in` | array |  | Countries where the product is reported sold. |
| `nutrition_per_100g` | object |  | Nutrients per 100 g or 100 ml, as recorded by the source. |
| `nutrition_per_100g.fat_g` | number or null | `30.9` | Total fat in grams. |
| `nutrition_per_100g.salt_g` | number or null | `0.107` | Salt in grams. |
| `nutrition_per_100g.fibre_g` | number or null | `0` | Fibre in grams. |
| `nutrition_per_100g.sugars_g` | number or null | `56.3` | Sugars in grams. |
| `nutrition_per_100g.protein_g` | number or null | `6.3` | Protein in grams. |
| `nutrition_per_100g.energy_kcal` | number or null | `539` | Energy in kilocalories. |
| `nutrition_per_100g.carbohydrates_g` | number or null | `57.5` | Carbohydrates in grams. |
| `nutrition_per_100g.saturated_fat_g` | number or null | `10.6` | Saturated fat in grams. |
| `open_food_facts_link` | string | `"https://world.openfoodfacts.org/product/3017620422003"` | Product page on Open Food Facts. |
| `nutrition_per_serving` | object |  | Nutrients per serving, when available. |
| `nutrition_per_serving.fat_g` | number or null | `4.63` | Total fat in grams. |
| `nutrition_per_serving.salt_g` | number or null | `0` | Salt in grams. |
| `nutrition_per_serving.fibre_g` | number or null | `0` | Fibre in grams. |
| `nutrition_per_serving.sugars_g` | number or null | `8.44` | Sugars in grams. |
| `nutrition_per_serving.protein_g` | number or null | `0.945` | Protein in grams. |
| `nutrition_per_serving.energy_kcal` | number or null | `80` | Energy in kilocalories. |
| `nutrition_per_serving.carbohydrates_g` | number or null | `8.62` | Carbohydrates in grams. |
| `nutrition_per_serving.saturated_fat_g` | number or null | `1.59` | Saturated fat in grams. |

**Example input**

```json
{
  "product": "3017620422003"
}
```

**Example output**

```json
{
  "brand": "Nutella, Ferrero",
  "barcode": "3017620422003",
  "quantity": "400 g e",
  "allergens": [
    "Milk",
    "Nuts",
    "Soybeans"
  ],
  "photo_link": "https://images.openfoodfacts.org/images/products/301/762/042/2003/front_en.879.400.jpg",
  "nova_number": 4,
  "nutri_score": "E - poor nutritional quality",
  "product_name": "Nutella",
  "ingredients_text": "Sugar, vegetable fat (palm), hazelnuts (13%), skimmed milk powder (8.7%), fat-reduced cocoa powder (7.4%), emulsifier: lecithins (soya), flavouring (vanillin).",
  "processing_level": "Ultra-processed food",
  "countries_sold_in": [
    "France"
  ],
  "nutrition_per_100g": {
    "fat_g": 30.9,
    "salt_g": 0.107,
    "fibre_g": 0,
    "sugars_g": 56.3,
    "protein_g": 6.3,
    "energy_kcal": 539,
    "carbohydrates_g": 57.5,
    "saturated_fat_g": 10.6
  },
  "open_food_facts_link": "https://world.openfoodfacts.org/product/3017620422003",
  "nutrition_per_serving": {
    "fat_g": null,
    "salt_g": null,
    "fibre_g": null,
    "sugars_g": null,
    "protein_g": null,
    "energy_kcal": null,
    "carbohydrates_g": null,
    "saturated_fat_g": null
  }
}
```

### Search products

Operation `search_products`, version 1. 1 credit per call.

Search packaged foods by name, diet, country sold, and brand, ordered by popularity. Gluten-free matching uses product labels; missing nutrition or classifications are shown as null.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `diet` | string | no | `"vegan"` | Diet filter, for example vegan. Default: any. |
| `page` | integer | no | `1` | Results page number, for example 2. Default: 1. |
| `brand` | string | no | `"Nature Valley"` | Brand to match, for example Nature Valley. Default: any. |
| `query` | string | yes | `"granola"` | Words to search for, for example granola or oat milk. |
| `country` | string | no | `"United States"` | Country where the food is sold, for example United States or US. Default: any. |
| `max_results` | integer | no | `5` | Products per page, for example 20; maximum 100. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "diet": {
      "enum": [
        "any",
        "vegan",
        "vegetarian",
        "gluten_free",
        "palm_oil_free"
      ],
      "type": "string",
      "default": "any",
      "description": "Diet filter, for example vegan. Default: any.",
      "examples": [
        "vegan",
        "palm_oil_free",
        "gluten_free"
      ]
    },
    "page": {
      "type": "integer",
      "default": 1,
      "minimum": 1,
      "description": "Results page number, for example 2. Default: 1.",
      "x-fous-developer": true,
      "examples": [
        1
      ]
    },
    "brand": {
      "type": "string",
      "default": "any",
      "description": "Brand to match, for example Nature Valley. Default: any.",
      "examples": [
        "Nature Valley"
      ]
    },
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Words to search for, for example granola or oat milk.",
      "examples": [
        "granola",
        "oat milk",
        "zzzxxyy_no_food_product_123456"
      ]
    },
    "country": {
      "type": "string",
      "default": "any",
      "description": "Country where the food is sold, for example United States or US. Default: any.",
      "examples": [
        "United States",
        "GB"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Products per page, for example 20; maximum 100.",
      "x-fous-developer": true,
      "examples": [
        5,
        3
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "diet": "vegan",
      "query": "granola",
      "country": "United States",
      "max_results": 5
    },
    {
      "diet": "palm_oil_free",
      "brand": "Nature Valley",
      "query": "granola",
      "max_results": 5
    },
    {
      "diet": "gluten_free",
      "page": 1,
      "query": "oat milk",
      "country": "GB",
      "max_results": 5
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `products` | array |  |  |
| `products[].brand` | string or null | `"Kirkland Signature"` | Brand name. |
| `products[].barcode` | string | `"0096619194261"` | Product barcode. |
| `products[].quantity` | string or null | `"35.3 oz (1 kg)"` | Package quantity. |
| `products[].photo_link` | string or null | `"https://images.openfoodfacts.org/images/products/009/661/919/4261/front_en.199.400.jpg"` | Product photo link. |
| `products[].product_link` | string | `"https://world.openfoodfacts.org/product/0096619194261"` | Open Food Facts product page. |
| `products[].product_name` | string or null | `"Ancient Grains Probiotic Granola"` | Product name. |
| `products[].fat_g_per_100g` | number or null | `16.3636363636364` | Fat in grams per 100 g. |
| `products[].salt_g_per_100g` | number or null | `1.09090909090909` | Salt in grams per 100 g. |
| `products[].processing_level` | string or null | `"Ultra-processed foods"` | Processing category in words, when known. |
| `products[].nutri_score_grade` | string or null | `"D"` | Nutri-Score grade, A to E, when known. |
| `products[].sugars_g_per_100g` | number or null | `16.3636363636364` | Sugars in grams per 100 g. |
| `products[].energy_kcal_per_100g` | number or null | `454.545454545455` | Energy in kilocalories per 100 g. |

**Example input**

```json
{
  "diet": "vegan",
  "query": "granola",
  "country": "United States",
  "max_results": 5
}
```

**Example output**

```json
{
  "products": [
    {
      "brand": "Kirkland Signature",
      "barcode": "0096619194261",
      "quantity": "35.3 oz (1 kg)",
      "photo_link": "https://images.openfoodfacts.org/images/products/009/661/919/4261/front_en.199.400.jpg",
      "product_link": "https://world.openfoodfacts.org/product/0096619194261",
      "product_name": "Ancient Grains Probiotic Granola",
      "fat_g_per_100g": 16.3636363636364,
      "salt_g_per_100g": 1.09090909090909,
      "processing_level": "Ultra-processed foods",
      "nutri_score_grade": "D",
      "sugars_g_per_100g": 16.3636363636364,
      "energy_kcal_per_100g": 454.545454545455
    },
    {
      "brand": "Nature's Path Organic",
      "barcode": "0058449770565",
      "quantity": "35.3 oz (2 lb 3.3 oz) 1 kg",
      "photo_link": "https://images.openfoodfacts.org/images/products/005/844/977/0565/front_en.111.400.jpg",
      "product_link": "https://world.openfoodfacts.org/product/0058449770565",
      "product_name": "Pumpkin Seed + Flax Granola",
      "fat_g_per_100g": 18.1818181818182,
      "salt_g_per_100g": 0.204545454545455,
      "processing_level": "Processed foods",
      "nutri_score_grade": "C",
      "sugars_g_per_100g": 18.1818181818182,
      "energy_kcal_per_100g": 472.727272727273
    },
    {
      "brand": "purely elizabeth.",
      "barcode": "0855140002175",
      "quantity": "12 oz (340 g)",
      "photo_link": "https://images.openfoodfacts.org/images/products/085/514/000/2175/front_en.72.400.jpg",
      "product_link": "https://world.openfoodfacts.org/product/0855140002175",
      "product_name": "ORIGINAL ANCIENT GRAIN GRANOLA",
      "fat_g_per_100g": 16.6666666666667,
      "salt_g_per_100g": 1.125,
      "processing_level": "Processed foods",
      "nutri_score_grade": "E",
      "sugars_g_per_100g": 20,
      "energy_kcal_per_100g": 433.333333333333
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@open-food-facts",
  "visibility": "public",
  "operation": "get_product",
  "version": 1,
  "input": {
    "product": "3017620422003"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@open-food-facts\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_product\",\n  \"version\": 1,\n  \"input\": {\n    \"product\": \"3017620422003\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@open-food-facts",
  "visibility": "public",
  "operation": "get_product",
  "version": 1,
  "input": {
    "product": "3017620422003"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@open-food-facts","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Check ingredients and allergens for a packaged food
- Compare nutrition values across food products
- Find products by brand, diet, or country sold
- Review product Nutri-Score and NOVA processing level

## FAQ

### Is Fous affiliated with Open Food Facts?

No. Fous is not affiliated with Open Food Facts. This workflow reads the public world.openfoodfacts.org website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a Open Food Facts account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from world.openfoodfacts.org when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### What ingredients and allergens does a packaged food contain?

Use Get product with a barcode or product name and brand to return ingredients and allergens when available.

### What is a food product’s Nutri-Score or NOVA level?

Get product returns the Nutri-Score and NOVA processing level for a matched packaged food when available.

### Which products match a food search, diet, or brand?

Search products finds products from required search words and optional diet, country, and brand filters.

## Related

- [USDA FoodData Central API](https://fous.com/workflows/usda-fooddata-central.md): USDA FoodData Central provides food composition, nutrition facts per 100 g or chosen listed portions, and relevant food and branded-product search results; missing data may be unavailable.
- [FDA API](https://fous.com/workflows/fda.md): FDA provides drug safety data, latest matching drug labels, common reported side effects, and newest-first drug, food, and device recalls; recent drug and device recalls may be missing, and weekly food statuses may lag.
- [BBC Good Food API](https://fous.com/workflows/bbc-good-food.md): BBC Good Food returns searchable web recipes, excluding app-only recipes, and full recipe ingredients, steps, and per-serving nutrition when available.
- [Instacart API](https://fous.com/workflows/instacart.md): Search grocery products available from nearby stores.
- [Food Network API](https://fous.com/workflows/food-network.md): Food Network offers recipes, cooking shows, and food inspiration, with searchable recipes and ingredient, direction, rating, and cooking-time details when available.
- [Trader Joe's API](https://fous.com/workflows/trader-joes.md): Trader Joe's groceries, beverages, flowers, plants, and other products.
- [Sephora API](https://fous.com/workflows/sephora.md): Sephora provides US beauty products, shopping information, product details, and customer reviews; prices and availability may change.
- [UPCitemdb API](https://fous.com/workflows/upcitemdb.md): Find product information and recorded store offers by UPC or EAN barcode.
- [All Food workflows](https://fous.com/workflows/category/food)
