# Product by barcode (GTIN / EAN / UPC) API

Look up products by GTIN, EAN or UPC strings via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as gtin, output, raw, and retrieve structured data including normalised barcode string, barcode check-digit validation result, product display name, underlying database product reference, and source licence reference text for product catalogue, and source lineage.

Documentation: https://openany.si/barcode-lookup/barcode-lookup-product-by-barcode-gtin-ean-upc-api/9d5ae585-0b04-47b1-b772-e464097cb31e/
API ID: 9d5ae585-0b04-47b1-b772-e464097cb31e
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/barcode/v1/lookup
Page update time: 2026-12-03T02:48:49.017Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:48:48.221Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "0",
    "max_cost_micro_usd": "2000",
    "quantities": [
      {
        "id": "upstream_credits",
        "label": "Actual API.SH credits consumed",
        "max_quantity": "1",
        "measure": "value",
        "pointer": "/credits_used",
        "price_micro_usd": "2000",
        "quantity_scale": 0,
        "source": "response",
        "unit": "credit",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": []
  }
}
```

## Usage and limits
## GTIN/EAN/UPC Barcode Lookup API

Pass required gtin as an 8-, 12-, 13- or 14-digit string and optionally select source. Keep check-digit validation, found and source product identity separate; category-specific attributes depend on the returned database record.

## What You Can Build

- **Product catalogue**: Connect supported barcode strings to returned product metadata.
- **Source lineage**: Keep database references, attribute units and licence text with each record.

## Returned Data

| Field | Meaning |
| --- | --- |
| `gtin_normalized` | Normalised barcode string |
| `check_digit_valid` | Barcode check-digit validation result |
| `found` | Whether a database product was found |
| `product.name` | Product display name |
| `product.source_url` | Underlying database product reference |
| `product.license` | Source licence reference text |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Product by barcode (GTIN / EAN / UPC) API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "gtin": {
          "type": "string",
          "description": "Barcode digits (8, 12, 13 or 14)."
        },
        "source": {
          "type": "string",
          "description": "Which database to ask.",
          "enum": [
            "all",
            "food",
            "beauty",
            "petfood",
            "products"
          ]
        },
        "raw": {
          "type": "boolean",
          "description": "Also return the full record."
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row."
        }
      },
      "required": [
        "gtin"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "cached": {
      "type": "boolean"
    },
    "check_digit_valid": {
      "type": "boolean"
    },
    "credits_used": {
      "type": "integer"
    },
    "fetched_at": {
      "type": "string"
    },
    "found": {
      "type": "boolean"
    },
    "gtin": {
      "type": "string"
    },
    "gtin_normalized": {
      "type": "string"
    },
    "product": {
      "type": "object",
      "properties": {
        "additives": {
          "type": "array",
          "items": {}
        },
        "allergens": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "brand_owner": {
          "type": "null"
        },
        "brands": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "completeness": {
          "type": "number"
        },
        "countries": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "created_at": {
          "type": "string"
        },
        "ecoscore_grade": {
          "type": "string"
        },
        "ecoscore_score": {
          "type": "integer"
        },
        "food_groups": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "generic_name": {
          "type": "null"
        },
        "gtin": {
          "type": "string"
        },
        "images": {
          "type": "object",
          "properties": {
            "front": {
              "type": "string"
            },
            "ingredients": {
              "type": "string"
            },
            "nutrition": {
              "type": "string"
            },
            "packaging": {
              "type": "string"
            }
          }
        },
        "ingredients": {
          "type": "string"
        },
        "ingredients_count": {
          "type": "integer"
        },
        "ingredients_detail": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "additive_class": {
                "type": "null"
              },
              "e_number": {
                "type": "null"
              },
              "from_palm_oil": {
                "type": "null"
              },
              "id": {
                "type": "string"
              },
              "labels": {
                "type": "null"
              },
              "origins": {
                "type": "null"
              },
              "percent": {
                "type": "null"
              },
              "percent_estimate": {
                "type": "number"
              },
              "percent_max": {
                "type": "null"
              },
              "percent_min": {
                "type": "null"
              },
              "processing": {
                "type": "null"
              },
              "sub_ingredients": {
                "type": "array",
                "items": {}
              },
              "text": {
                "type": "string"
              },
              "vegan": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              },
              "vegetarian": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              }
            }
          }
        },
        "labels": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "languages": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "license": {
          "type": "string"
        },
        "manufacturer_url": {
          "type": "null"
        },
        "manufacturing_places": {
          "type": "null"
        },
        "name": {
          "type": "string"
        },
        "net_quantity": {
          "type": "integer"
        },
        "net_quantity_unit": {
          "type": "string"
        },
        "nova_group": {
          "type": "null"
        },
        "nutriscore_grade": {
          "type": "string"
        },
        "nutriscore_score": {
          "type": "integer"
        },
        "nutrition_100g": {
          "type": "object",
          "properties": {
            "added_sugars_g": {
              "type": "integer"
            },
            "carbohydrates_g": {
              "type": "number"
            },
            "energy_kcal": {
              "type": "integer"
            },
            "energy_kj": {
              "type": "integer"
            },
            "fat_g": {
              "type": "number"
            },
            "proteins_g": {
              "type": "number"
            },
            "salt_g": {
              "type": "number"
            },
            "saturated_fat_g": {
              "type": "number"
            },
            "sodium_g": {
              "type": "number"
            },
            "sugars_g": {
              "type": "number"
            }
          }
        },
        "nutrition_per": {
          "type": "string"
        },
        "nutrition_serving": {
          "type": "null"
        },
        "obsolete": {
          "type": "boolean"
        },
        "origins": {
          "type": "null"
        },
        "packager_codes": {
          "type": "array",
          "items": {}
        },
        "packaging": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "palm_oil_free": {
          "type": "boolean"
        },
        "period_after_opening": {
          "type": "null"
        },
        "quantity": {
          "type": "string"
        },
        "scans": {
          "type": "integer"
        },
        "serving_size": {
          "type": "null"
        },
        "source": {
          "type": "string"
        },
        "source_url": {
          "type": "string"
        },
        "stores": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "traces": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "updated_at": {
          "type": "string"
        },
        "vegan": {
          "type": "boolean"
        },
        "vegetarian": {
          "type": "boolean"
        }
      }
    }
  }
}
```

## Request example
Scenario: Official example · Live API.SH response · Minimal request
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/barcode/v1/lookup?gtin=3017624010701&output=json&raw=false' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "cached": false,
  "check_digit_valid": true,
  "credits_used": 1,
  "fetched_at": "2026-11-19T12:29:45.489Z",
  "found": true,
  "gtin": "3017624010701",
  "gtin_normalized": "3017624010701",
  "product": {
    "additives": [],
    "allergens": [
      "nuts"
    ],
    "brand_owner": null,
    "brands": [
      "Ferrero"
    ],
    "categories": [
      "breakfasts",
      "spreads",
      "sweet spreads",
      "pates a tartiner",
      "hazelnut spreads",
      "chocolate spreads",
      "cocoa and hazelnuts spreads",
      "Other"
    ],
    "completeness": 0.7625,
    "countries": [
      "france",
      "united kingdom"
    ],
    "created_at": "2020-10-13T19:33:21.000Z",
    "ecoscore_grade": "d",
    "ecoscore_score": 35,
    "food_groups": [
      "sugary snacks",
      "sweets"
    ],
    "generic_name": null,
    "gtin": "3017624010701",
    "images": {
      "front": "https://images.openfoodfacts.org/images/products/301/762/401/0701/front_en.100.400.jpg",
      "ingredients": "https://images.openfoodfacts.org/images/products/301/762/401/0701/ingredients_en.60.400.jpg",
      "nutrition": "https://images.openfoodfacts.org/images/products/301/762/401/0701/nutrition_en.63.400.jpg",
      "packaging": "https://images.openfoodfacts.org/images/products/301/762/401/0701/packaging_en.65.400.jpg"
    },
    "ingredients": "sugar, palm oil, hazelnuts (13%), skimmed milk powder (8.7%), fat reduced cocoa (7.4%), emulsifier: lecithins (soya), vanillin",
    "ingredients_count": 7,
    "ingredients_detail": [
      {
        "additive_class": null,
        "e_number": null,
        "from_palm_oil": null,
        "id": "de:sugar",
        "labels": null,
        "origins": null,
        "percent": null,
        "percent_estimate": 58.62,
        "percent_max": null,
        "percent_min": null,
        "processing": null,
        "sub_ingredients": [],
        "text": "sugar",
        "vegan": null,
        "vegetarian": null
      },
      {
        "additive_class": null,
        "e_number": null,
        "from_palm_oil": null,
        "id": "de:palm oil",
        "labels": null,
        "origins": null,
        "percent": null,
        "percent_estimate": 18.04,
        "percent_max": null,
        "percent_min": null,
        "processing": null,
        "sub_ingredients": [],
        "text": "palm oil",
        "vegan": null,
        "vegetarian": null
      },
      {
        "additive_class": null,
        "e_number": null,
        "from_palm_oil": null,
        "id": "de:hazelnuts",
        "labels": null,
        "origins": null,
        "percent": null,
        "percent_estimate": 9.06,
        "percent_max": null,
        "percent_min": null,
        "processing": null,
        "sub_ingredients": [],
        "text": "hazelnuts",
        "vegan": null,
        "vegetarian": null
      },
      {
        "additive_class": null,
        "e_number": null,
        "from_palm_oil": null,
        "id": "de:skimmed milk powder",
        "labels": null,
        "origins": null,
        "percent": null,
        "percent_estimate": 5.55,
        "percent_max": null,
        "percent_min": null,
        "processing": null,
        "sub_ingredients": [],
        "text": "skimmed milk powder",
        "vegan": null,
        "vegetarian": null
      },
      {
        "additive_class": null,
        "e_number": null,
        "from_palm_oil": null,
        "id": "de:fat reduced cocoa",
        "labels": null,
        "origins": null,
        "percent": null,
        "percent_estimate": 3.8,
        "percent_max": null,
        "percent_min": null,
        "processing": null,
        "sub_ingredients": [],
        "text": "fat reduced cocoa",
        "vegan": null,
        "vegetarian": null
      },
      {
        "additive_class": null,
        "e_number": null,
        "from_palm_oil": null,
        "id": "de:emulsifier",
        "labels": null,
        "origins": null,
        "percent": null,
        "percent_estimate": 2.79,
        "percent_max": null,
        "percent_min": null,
        "processing": null,
        "sub_ingredients": [],
        "text": "emulsifier",
        "vegan": null,
        "vegetarian": null
      },
      {
        "additive_class": null,
        "e_number": null,
        "from_palm_oil": null,
        "id": "en:vanillin",
        "labels": null,
        "origins": null,
        "percent": null,
        "percent_estimate": 2.14,
        "percent_max": null,
        "percent_min": null,
        "processing": null,
        "sub_ingredients": [],
        "text": "vanillin",
        "vegan": true,
        "vegetarian": true
      }
    ],
    "labels": [
      "no gluten"
    ],
    "languages": [
      "de",
      "en",
      "it",
      "ro"
    ],
    "license": "ODbL 1.0 (database), CC BY-SA 3.0 (images)",
    "manufacturer_url": null,
    "manufacturing_places": null,
    "name": "Nutella",
    "net_quantity": 400,
    "net_quantity_unit": "g",
    "nova_group": null,
    "nutriscore_grade": "e",
    "nutriscore_score": 31,
    "nutrition_100g": {
      "added_sugars_g": 0,
      "carbohydrates_g": 57.5,
      "energy_kcal": 539,
      "energy_kj": 2228,
      "fat_g": 30.9,
      "proteins_g": 6.3,
      "salt_g": 0.1075,
      "saturated_fat_g": 10.6,
      "sodium_g": 0.043,
      "sugars_g": 56.3
    },
    "nutrition_per": "100g",
    "nutrition_serving": null,
    "obsolete": false,
    "origins": null,
    "packager_codes": [],
    "packaging": [
      "glass jar"
    ],
    "palm_oil_free": false,
    "period_after_opening": null,
    "quantity": "400.0 g",
    "scans": 46,
    "serving_size": null,
    "source": "Open Food Facts",
    "source_url": "https://world.openfoodfacts.org/product/3017624010701",
    "stores": [
      "Sainsbury's",
      "Tesco"
    ],
    "traces": [
      "milk",
      "nuts",
      "soybeans"
    ],
    "updated_at": "2026-10-02T17:52:32.000Z",
    "vegan": false,
    "vegetarian": false
  }
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Should the barcode be stored as a number?
Keep it as a digit string to preserve leading zeroes. The exposed gtin input accepts 8, 12, 13 or 14 digits.

### Does a valid check digit guarantee a database match?
No. check_digit_valid concerns the barcode check, while found reports whether a product record was found. Keep both results separate.

### Which database selections are exposed?
source accepts all, food, beauty, petfood or products. Retain the returned product.source and source_url instead of assuming every result comes from one database.

### Do all products have the same attributes and reuse terms?
No. Category-specific attributes can differ. Preserve nutrition_per and quantity units when present, along with the returned source and licence references.

### How do I bypass cached results?
Pass fresh=1. A cache bypass retrieves available source data; it does not make unpublished or restricted records available.

### Can I request CSV or NDJSON?
This OpenAny implementation serves JSON only. Omit output or set output=json.

## Available implementations
- apish: https://openany.si/barcode-lookup/barcode-lookup-product-by-barcode-gtin-ean-upc-api/9d5ae585-0b04-47b1-b772-e464097cb31e/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
