# Food Product by Barcode (`openfoodfacts.product`)

Look up a packaged food by barcode in Open Food Facts: name, brand, ingredients, allergens, Nutri-Score, NOVA group and nutrition per 100 g.

- **Route:** `POST /v1/run/openfoodfacts.product`
- **Price:** $0.0008 per request ($0.80 per 1,000) · `cost_usd` on every response
- **Source:** Open Food Facts (`openfoodfacts`) · failover: no
- **Measured latency:** p50 94 ms · p95 94 ms · p99 94 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `barcode` | string | yes |  | EAN/UPC barcode digits |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `name` | Product name. |
| `brands` | Brands. |
| `ingredients` | Ingredient list text. |
| `allergens` | Declared allergens. |
| `nutriscore` | Nutri-Score grade a-e. |
| `nova_group` | NOVA processing group 1-4. |
| `nutrition_per_100g` | Energy, fat, sugars, salt, protein per 100 g. |
| `license` | ODbL attribution note. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/openfoodfacts.product \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"barcode":"3017620422003"}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('openfoodfacts.product', {'barcode': '3017620422003'})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run openfoodfacts.product '{"barcode":"3017620422003"}'
```

Quote first (free, validates input): `POST /v1/quote/openfoodfacts.product` with the same body.
