# 2s.io Food Barcode Lookup

> 2s.io Food Barcode Lookup is a paid API for AI agents from 2s.io, paid per call via x402, $0.0012/call, status unknown (last checked 2026-09-14, last successful call 2026-07-19).

Resolves a food product barcode (UPC/EAN) to structured nutritional and product metadata via the Open Food Facts database

## Facts

- Endpoint: GET https://2s.io/api/food/barcode-lookup
- Price: $0.0012/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Last successful call: 2026-07-19
- Success rate: 66% of calls made through Zero
- Activations on Zero: 29
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-io-dba02634
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_d7ceqROIV-843pbGEzYW4

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 2s-io-dba02634
```

Example prompt: Can you look up barcode 3017620422003 and tell me the product name, brand, ingredients, Nutri-Score grade, and whether it contains any allergens?

## When to prefer this

Use this endpoint when you need to resolve a physical food product barcode (UPC, EAN-13, EAN-8, etc.) into rich structured nutritional metadata including Nutri-Score, NOVA processing level, allergens, and ingredient lists. Prefer it over general web search when you need machine-readable, structured nutrition data from a trusted community database with >3M products. Ideal for diet tracking apps, allergen checkers, grocery assistants, or any agent needing food product facts from a scan.

## Known failure modes

- Barcode not found in Open Food Facts database — product may be too niche or not yet catalogued
- Invalid barcode format (must be 6–14 digits) — returns validation error
- Product entry exists but has incomplete community-sourced data — some fields may be null or empty
- Payment required error if x402 micropayment header is missing or invalid
- Rate limiting or upstream Open Food Facts API unavailability

## How this service works

Resolve a food product barcode (UPC, EAN-13, EAN-8, etc.) to structured product metadata via Open Food Facts — the CC0 community-maintained database of >3M food products. Returns product name, brand, ingredient list, allergens, nutriments (per-100g + per-serving), Nutri-Score grade (a-e), NOVA processing classification (1-4), Eco-Score, categories, manufacturing origin, packaging, and product image URLs.

## Output

Returns structured product metadata including product name, brand, full ingredient list, allergens, per-100g and per-serving nutriments, Nutri-Score grade (a–e), NOVA processing classification (1–4), Eco-Score, product categories, manufacturing origin, packaging details, and product image URLs — sourced from the Open Food Facts CC0 database.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "barcode": "5901234123457"
  }
 }
}
```

## 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",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "required": [
      "barcode"
     ],
     "properties": {
      "barcode": {
       "type": "string",
       "description": "6-14 digit UPC/EAN barcode."
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-io-dba02634/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
