{
  "openapi": "3.1.0",
  "info": {
    "title": "Barcode Lookup API",
    "version": "1.0.0",
    "description": "Product name, brand, ingredients and Nutri-Score for 4.3 million barcodes.\n\nScan a barcode, know the product: ~4.3 million products from the Open Facts family of community databases (Open Food Facts plus its beauty, general-product and pet-food siblings), self-hosted and answering in one round trip. Point any EAN-13, UPC-A, EAN-8 or GTIN-14 at the lookup endpoint — leading zeros and common re-paddings are tried automatically — and get back the product name, brand, quantity, categories, labels, ingredients, allergens, serving size, Nutri-Score (a-e), NOVA processing group (1-4), Eco-Score, per-100g nutriments (energy, fat, saturates, carbs, sugars, fibre, protein, salt, sodium) and a product photo URL. Search the catalogue by name, brand, category, country, Nutri-Score, NOVA group or dataset; roll up the top brands; every response carries an attribution block linking to the product's source page. Product data refreshes daily from the official Open Food Facts delta exports. Data licence: Open Database License (ODbL) v1.0 — attribution required, database derivatives share-alike. Built for shopping and diet apps, price scanners, inventory tools and e-commerce enrichment. Self-hosted dataset — no third-party calls at request time.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/barcode-lookup.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/barcode-lookup"
  },
  "servers": [
    {
      "url": "https://api-barcode-lookup.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Tools",
      "description": "Barcode Lookup API belongs to the Tools category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/products/stats": {
      "get": {
        "operationId": "catalogueStats",
        "summary": "Catalogue Stats",
        "description": "Catalogue Stats endpoint of the Barcode Lookup API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/barcode-lookup/catalogue-stats"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "total_products": 4291142,
                  "by_dataset": [
                    {
                      "dataset": "food",
                      "products": 4211142
                    },
                    {
                      "dataset": "beauty",
                      "products": 42042
                    },
                    {
                      "dataset": "products",
                      "products": 25879
                    },
                    {
                      "dataset": "petfood",
                      "products": 12079
                    }
                  ],
                  "by_nutriscore": [
                    {
                      "nutriscore": "a",
                      "products": 196113
                    },
                    {
                      "nutriscore": "b",
                      "products": 150024
                    },
                    {
                      "nutriscore": "c",
                      "products": 277591
                    },
                    {
                      "nutriscore": "d",
                      "products": 337614
                    },
                    {
                      "nutriscore": "e",
                      "products": 368979
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/sources": {
      "get": {
        "operationId": "dataSources",
        "summary": "Data Sources",
        "description": "Data Sources endpoint of the Barcode Lookup API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/barcode-lookup/data-sources"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "count": 4,
                  "attribution": "Data from the Open Food Facts family of projects, licensed under the Open Database License (ODbL) v1.0. https://world.openfoodfacts.org",
                  "sources": [
                    {
                      "slug": "food",
                      "name": "Open Food Facts",
                      "publisher": "Open Food Facts contributors",
                      "licence": "ODbL v1.0 (database) + DbCL (contents) - attribution required",
                      "source_url": "https://world.openfoodfacts.org",
                      "file_url": "https://static.openfoodfacts.org/data/en.openfoodfacts.org.products.csv.gz",
                      "cadence": "daily",
                      "record_count": 4206231,
                      "retrieved_at": "2026-08-29"
                    },
                    {
                      "slug": "beauty",
                      "name": "Open Beauty Facts",
                      "publisher": "Open Food Facts contributors",
                      "licence": "ODbL v1.0 (database) + DbCL (contents) - attribution required",
                      "source_url": "https://world.openbeautyfacts.org",
                      "file_url": "https://static.openbeautyfacts.org/data/en.openbeautyfacts.org.products.csv.gz",
                      "cadence": "daily",
                      "record_count": 42042,
                      "retrieved_at": "2026-08-29"
                    },
                    {
                      "slug": "products",
                      "name": "Open Products Facts",
                      "publisher": "Open Food Facts contributors",
                      "licence": "ODbL v1.0 (database) + DbCL (contents) - attribution required",
                      "source_url": "https://world.openproductsfacts.org",
                      "file_url": "https://static.openproductsfacts.org/data/en.openproductsfacts.org.products.csv.gz",
                      "cadence": "daily",
                      "record_count": 25880,
                      "retrieved_at": "2026-08-29"
                    },
                    {
                      "slug": "petfood",
                      "name": "Open Pet Food Facts",
                      "publisher": "Open Food Facts contributors",
                      "licence": "ODbL v1.0 (database) + DbCL (contents) - attribution required",
                      "source_url": "https://world.openpetfoodfacts.org",
                      "file_url": "https://static.openpetfoodfacts.org/data/en.openpetfoodfacts.org.products.csv.gz",
                      "cadence": "daily",
                      "record_count": 12451,
                      "retrieved_at": "2026-08-29"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/products/{barcode}": {
      "get": {
        "operationId": "lookupByBarcode",
        "summary": "Lookup By Barcode",
        "description": "Lookup By Barcode endpoint of the Barcode Lookup API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/barcode-lookup/lookup-by-barcode"
        },
        "parameters": [
          {
            "name": "barcode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "3017620422003"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "barcode": "3017620422003",
                  "name": "Nutella",
                  "brand": "Nutella, Ferrero, Yum yum",
                  "quantity": null,
                  "categories": "Breakfasts, Spreads, Sweet spreads, Confectionary based spreads, Petit déjeuners, Produits à tartiner, Produits à tartiner sucrés, Pâtes à tartiner",
                  "labels": "Sans gluten, en:no-gluten",
                  "countries": "France",
                  "allergens": "Milk, Nuts, Soybeans",
                  "serving_size": null,
                  "ingredients": "Sucre, huile de palme, NOISETTES 13%, cacao maigre 7,4%, LAIT écrémé en poudre 6,6%, LACTOSERUM en poudre, émulsifiants: lécithines [SOJA), vanilline. Sans gluten.",
                  "scores": {
                    "nutriscore": "e",
                    "nova_group": 4,
                    "ecoscore": null
                  },
                  "nutriments_per_100g": {
                    "energy_kcal": 539,
                    "fat": 30.9,
                    "saturated_fat": 10.6,
                    "carbohydrates": 57.5,
                    "sugars": 56.3,
                    "proteins": 6.3,
                    "salt": 0.107,
                    "sodium": 0.043
                  },
                  "completeness": 0.787,
                  "image_url": "https://images.openfoodfacts.org/images/products/301/762/042/2003/front_en.879.400.jpg",
                  "last_modified": "2026-08-28",
                  "attribution": {
                    "dataset": "food",
                    "source": "Open Food Facts",
                    "source_url": "https://world.openfoodfacts.org/product/3017620422003",
                    "licence": "ODbL v1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/products/random": {
      "get": {
        "operationId": "randomProducts",
        "summary": "Random Products",
        "description": "Random Products endpoint of the Barcode Lookup API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/barcode-lookup/random-products"
        },
        "parameters": [
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "3"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "count": 1,
                  "results": [
                    {
                      "barcode": "4056489603337",
                      "name": "Ταχίνι Κακαο",
                      "brand": "Γλυκανθη",
                      "quantity": null,
                      "categories": "bg:cocoa-tahini",
                      "labels": "Rainforest Alliance",
                      "countries": "Greece",
                      "allergens": null,
                      "serving_size": "100 g",
                      "ingredients": "Tahini with cacas, Ingredients: 62% tahini (ground esame), sugar, 6% fat-reduced cocoa powder*, palm oil, emulsifier: soy lecithin, flavourings. * Rainforest Alliance Certified. Find out more at ra.org.",
                      "scores": {
                        "nutriscore": "e",
                        "nova_group": null,
                        "ecoscore": null
                      },
                      "nutriments_per_100g": {},
                      "completeness": 0.6,
                      "image_url": "https://images.openfoodfacts.org/images/products/405/648/960/3337/front_bg.6.400.jpg",
                      "last_modified": "2026-02-06",
                      "attribution": {
                        "dataset": "food",
                        "source": "Open Food Facts",
                        "source_url": "https://world.openfoodfacts.org/product/4056489603337",
                        "licence": "ODbL v1.0"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/products": {
      "get": {
        "operationId": "searchProducts",
        "summary": "Search Products",
        "description": "Search Products endpoint of the Barcode Lookup API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/barcode-lookup/search-products"
        },
        "parameters": [
          {
            "name": "brand",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "Ferrero"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "Chocolate"
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "France"
          },
          {
            "name": "dataset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "food"
          },
          {
            "name": "has_image",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "true"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "20"
          },
          {
            "name": "nova",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "4"
          },
          {
            "name": "nutriscore",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "1"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "nutella"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "total": 62,
                  "page": 1,
                  "limit": 20,
                  "count": 3,
                  "results": [
                    {
                      "barcode": "8000500045497",
                      "name": "Biscuits Nutella & Go x2 packs - 104g",
                      "brand": "Nutella, Ferrero, Nutella & go, Nutella & go !",
                      "quantity": "2 x 52 g",
                      "nutriscore": "e",
                      "nova": 4,
                      "image_url": "https://images.openfoodfacts.org/images/products/800/050/004/5497/front_fr.171.400.jpg",
                      "dataset": "food"
                    },
                    {
                      "barcode": "9300698000216",
                      "name": "nutella",
                      "brand": "Ferrero",
                      "quantity": "400 g",
                      "nutriscore": "e",
                      "nova": 4,
                      "image_url": "https://images.openfoodfacts.org/images/products/930/069/800/0216/front_en.44.400.jpg",
                      "dataset": "food"
                    },
                    {
                      "barcode": "80177173",
                      "name": "Nutella",
                      "brand": "Ferrero",
                      "quantity": "350 g",
                      "nutriscore": "e",
                      "nova": 4,
                      "image_url": "https://images.openfoodfacts.org/images/products/80177173/front_en.502.400.jpg",
                      "dataset": "food"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/brands": {
      "get": {
        "operationId": "topBrands",
        "summary": "Top Brands",
        "description": "Top Brands endpoint of the Barcode Lookup API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/barcode-lookup/top-brands"
        },
        "parameters": [
          {
            "name": "dataset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "food"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "count": 8,
                  "brands": [
                    {
                      "brand": "Carrefour",
                      "products": 27509
                    },
                    {
                      "brand": "Auchan",
                      "products": 18104
                    },
                    {
                      "brand": "Coop",
                      "products": 13934
                    },
                    {
                      "brand": "Lidl",
                      "products": 13689
                    },
                    {
                      "brand": "Aldi",
                      "products": 11700
                    },
                    {
                      "brand": "Hacendado",
                      "products": 10337
                    },
                    {
                      "brand": "Tesco",
                      "products": 10225
                    },
                    {
                      "brand": "Delhaize",
                      "products": 9742
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 1 token per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}