# Food & Nutrition API
> Look up packaged food products by barcode (EAN/UPC/GTIN) and get the product name, brand, ingredients, allergens, Nutri-Score, NOVA group, Eco-Score and per-100g nutrition facts — or search the catalogue by name. Backed by the Open Food Facts database. Ideal for nutrition trackers, diet and fitness apps, grocery and retail tools.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/food-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 5 req/s
- **Basic** ($15/Mo) — 50,000 calls/Mo, 10 req/s
- **Pro** ($49/Mo) — 250,000 calls/Mo, 20 req/s
- **Mega** ($129/Mo) — 1,000,000 calls/Mo, 40 req/s

## Endpoints

### Food

#### `GET /v1/nutrition` — Nutrition facts by barcode

**Parameters:**
- `barcode` (query, required, string) — EAN/UPC/GTIN barcode Example: `3017620422003`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/food-api/v1/nutrition?barcode=3017620422003"
```

**Response:**
```json
{
    "data": {
        "barcode": "3017620422003",
        "allergens": [
            "milk",
            "nuts",
            "soybeans"
        ],
        "nova_group": 4,
        "nutriments": {
            "fat_100g": 30.9,
            "salt_100g": 0.107,
            "fiber_100g": null,
            "sodium_100g": 0.0428,
            "sugars_100g": 56.3,
            "proteins_100g": 6.3,
            "energy_kcal_100g": 539,
            "carbohydrates_100g": 57.5,
            "saturated_fat_100g": 10.6
        },
        "product_name": "Nutella",
        "serving_size": null,
        "nutriscore_grade": "e"
    },
    "meta": {
        "timestamp": "2026-05-30T03:53:22.258Z",
        "request_id": "c88a38cd-c469-4638-911e-41c979d328bd"
    },
    "status": "ok",
    "message": "Nutrition retrieved successfully",
    "success": true
}
```

#### `GET /v1/product` — Product by barcode

**Parameters:**
- `barcode` (query, required, string) — EAN/UPC/GTIN barcode Example: `3017620422003`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/food-api/v1/product?barcode=3017620422003"
```

**Response:**
```json
{
    "data": {
        "url": "https://world.openfoodfacts.org/product/3017620422003",
        "image": "https://images.openfoodfacts.org/images/products/301/762/042/2003/front_en.820.400.jpg",
        "brands": "Nutella",
        "labels": [
            "no-gluten",
            "triman",
            "Sans colorants",
            "Sans conservateurs",
            "Sans gluten",
            "Sans matière grasse hydrogénée",
            "Végétarien"
        ],
        "barcode": "3017620422003",
        "quantity": null,
        "allergens": [
            "milk",
            "nuts",
            "soybeans"
        ],
        "countries": [
            "france",
            "italy",
            "luxembourg",
            "philippines",
            "Allemagne",
            "Belgique",
            "Espagne",
            "Inde",
            "Maroc",
            "Pays-Bas",
            "Pologne",
            "Roumanie",
            "Royaume-Uni",
            "Suisse",
            "Turquie",
            "États-Unis"
        ],
        "categories": [
            "Petit-déjeuners",
            "Produits à tartiner",
            "Produits à tartiner sucrés",
            "Pâtes à tartiner"
        ],
        "nova_group": 4,
        "nutriments": {
            "fat_100g": 30.9,
            "salt_100g": 0.107,
            "fiber_100g": null,
            "sodium_100g": 0.0428,
            "sugars_100g": 56.3,
            "proteins_100g": 6.3,
            "energy_kcal_100g": 539
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/search` — Search products by name

**Parameters:**
- `q` (query, required, string) — Search term Example: `nutella`
- `limit` (query, optional, string) — Max 1-25 Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/food-api/v1/search?q=nutella&limit=10"
```

**Response:**
```json
{
    "data": {
        "count": 10,
        "query": "nutella",
        "total": 976,
        "results": [
            {
                "image": "https://images.openfoodfacts.org/images/products/301/762/042/2003/front_en.820.400.jpg",
                "brands": "Nutella",
                "barcode": "3017620422003",
                "quantity": null,
                "categories": [
                    "Petit-déjeuners",
                    "Produits à tartiner",
                    "Produits à tartiner sucrés",
                    "Pâtes à tartiner"
                ],
                "nova_group": 4,
                "product_name": "Nutella",
                "nutriscore_grade": "e"
            },
            {
                "image": "https://images.openfoodfacts.org/images/products/301/762/042/5035/front_en.583.400.jpg",
                "brands": "nutella",
                "barcode": "3017620425035",
                "quantity": "1 kg",
                "categories": [
                    "pates-a-tartiner-au-chocolat",
                    "pates-a-tartiner-aux-noisettes",
                    "pates-a-tartiner-aux-noisettes-et-au-cacao",
                    "petit-dejeuners",
                    "produits-a-tartiner",
                    "produits-a-tartiner-sucres"
                ],
                "nova_group": 4,
                "product_name": "Nutella",
                "nutriscore_grade": "e"
            },
            {
                "image": "https://images.ope
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/food-api
OpenAPI spec: https://www.oanor.com/api/food-api/openapi.json
