Barcode API

Integrate barcode lookup and analysis directly into your applications.

POST

1. Authentication

This endpoint allows users to authenticate and retrieve an access token. The token is required to make subsequent API requests.

/api/auth/getToken
Request Body
{
  "userKey": "YOUR_USER_KEY",
  "apiKey": "YOUR_API_KEY"
}
Try It
POST

2. Fetch Barcode

This endpoint allows you to fetch details about a specific barcode, including product name, pricing information, and availability.

Authorization:: This request requires a valid token in the
/api/barcode
Request
{
  "barcode": "8690632994802"
}
Response Example
[
  {
    "barcode": "8690...",
    "text": "Product Name...",
    "prices": []
  }
]
Try It
Auth
* Auto-filled from Authentication step
Barcode

                            
POST

Nutrition facts

Calories, fat, carbohydrate, protein, sugars, sodium, vitamins and minerals of a product, per 100 g (or 100 ml) and per serving, with ingredients. Data from USDA FoodData Central and Open Food Facts. Each call counts towards your daily quota, like a barcode lookup.

Authorization:: This request requires a valid token in the
/api/nutrition
Request
{
  "barcode": "0016000275287"
}
Notes
  • Units: energy in kcal; nutrients in g, mg or mcg (µg).
  • servingSize, servingUnit and perServing are empty when the source gives no serving size.
  • dailyValue: percent of the US Daily Value (2,000 kcal diet); empty when there is none.
  • 404 with {"error": "NO_NUTRITION_FACTS"} when we have no nutrition facts for the product.
  • source: usda-fdc or openfoodfacts. Open Food Facts data is under the ODbL: credit Open Food Facts where you show it.
Response Example
{
  "barcode": "0016000275287",
  "source": "usda-fdc",
  "servingSize": 40.0,
  "servingUnit": "g",
  "householdServing": "1 cup (40 g)",
  "packageWeight": "18 oz",
  "category": "Cereal",
  "ingredients": "Whole grain oats, sugar, ...",
  "nutrients": [
    { "key": "energy", "unit": "kcal",
      "per100": 375.0, "perServing": 150.0,
      "dailyValue": null },
    { "key": "fat", "unit": "g",
      "per100": 5.0, "perServing": 2.0,
      "dailyValue": 3 },
    { "key": "sodium", "unit": "mg",
      "per100": 475.0, "perServing": 190.0,
      "dailyValue": 8 }
  ]
}

Nutrient keys: energy, fat, saturatedFat, transFat, cholesterol, sodium, carbohydrate, fiber, sugars, addedSugars, protein, vitaminD, calcium, iron, potassium (US label order; only those the product lists).

Try It
Auth

                            
POST

3. Barcode Analysis

This endpoint analyzes the given barcode and provides details such as country of origin, manufacturer code, and product code.

/api/analysis
Try It
Auth
Barcode