# Food Barcode Facts: Compare Two Foods by Barcode

> Food Barcode Facts: Compare Two Foods by Barcode is a paid API for AI agents from food-barcode.x402tookit.com, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-29).

Compares two packaged foods side-by-side using their barcodes, returning Nutri-Score, NOVA group, and per-100g nutritional breakdown for both products.

## Facts

- Endpoint: GET https://food-barcode.x402tookit.com/food-compare?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/food-barcode-facts-compare-two-foods-by-barcode-03f63c8f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fIcJYDcaiJrsUqsjbALBF

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability food-barcode-facts-compare-two-foods-by-barcode-03f63c8f
```

Example prompt: Compare the nutritional profiles of these two cereals — barcode 5010029011012 vs barcode 3017620422003 — and tell me which has a better Nutri-Score, lower sugar, and less processing based on their NOVA groups.

## When to prefer this

Choose this endpoint when you need a direct side-by-side comparison of two packaged foods by barcode, including structured nutritional differences, Nutri-Score grades, and NOVA processing levels in a single call. Prefer it over single-product lookup endpoints when the user's goal is to decide between two products or identify which is healthier. It is ideal for shopping-assistant agents, nutrition comparison flows, or diet-tracking applications where a comparative verdict and narrative summary are needed.

## Known failure modes

- Barcode not found in database — product data returns null for one or both items
- Invalid or malformed barcode string — schema validation error
- Missing nutritional data for one or both products causing degraded response flag to be true
- Product data is stale or incomplete leading to low data quality completeness score
- Network timeout or upstream data source unavailability

## How this service works

Compare two packaged foods by barcode: Nutri-Score, NOVA, and per-100 g energy, sugars, saturated fat, salt, fibre and protein.

## Output

Returns a structured comparison object for both products including product name, brand, quantity, Nutri-Score grade, NOVA processing group, and a per-100g breakdown of energy, sugars, saturated fat, salt, fibre, and protein. Also includes a narrative summary, a verdict on which product is nutritionally preferable, reasons supporting the verdict, data quality indicators (completeness, last modified, has ingredients), data source, timestamp, and a flag indicating if the response is degraded due to missing data.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "barcode",
      "other"
     ],
     "properties": {
      "other": {
       "type": "string",
       "description": "Second product barcode"
      },
      "barcode": {
       "type": "string",
       "description": "First product barcode"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "a": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "name": {
         "type": [
          "null",
          "string"
         ]
        },
        "brands": {
         "type": [
          "null",
          "string"
         ]
        },
        "barcode": {
         "type": [
          "null",
          "string"
         ]
        },
        "quantity": {
         "type": [
          "null",
          "string"
         ]
        },
        "novaGroup": {
         "type": [
          "null",
          "number"
         ]
        },
        "nutriScore": {
         "type": [
          "null",
          "string"
         ]
        },
        "dataQuality": {
         "type": [
          "null",
          "object"
         ],
         "properties": {
          "completeness": {
           "type": [
            "null",
            "number"
           ]
          },
          "lastModified": {
           "type": [
            "null",
            "string"
           ]
          },
          "hasIngredients": {
           "type": [
            "boolean",
            "null"
           ]
          }
         }
        }
       }
      },
      "b": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "name": {
         "type": [
          "null",
          "string"
         ]
        },
        "brands": {
         "type": [
          "null",
          "string"
         ]
        },
        "barcode": {
         "type": [
          "null",
          "s
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/food-barcode-facts-compare-two-foods-by-barcode-03f63c8f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from food-barcode.x402tookit.com](https://www.zero.xyz/host/food-barcode.x402tookit.com/llms.txt)
