---
title: "Search By Barcode"
method: GET
path: "/api/v1/search/barcode/{upc}"
tags: ["search"]
---

# Search By Barcode

`GET /api/v1/search/barcode/{upc}`

## Request

- Base URL: `https://calorieapiadmin.com`
- URL: `https://calorieapiadmin.com/api/v1/search/barcode/{upc}`
- Auth: none declared

Lookup food by barcode (UPC/EAN). Uses local database first, then Open Food Facts.

## Path parameters

- `upc` string, required

## Headers

- `X-API-Key` string, nullable
- `authorization` string, nullable

## Response `200`

Successful Response

- BarcodeLookupResponse
  - `barcode` string, required
  - `food_id` integer, nullable
  - `product` BarcodeProductDetails, required
    - `name` string, required
    - `brand` string, nullable
    - `category` string, nullable
    - `generic_name` string, nullable
    - `quantity` string, nullable: Package size, e.g. '400 g'
    - `ingredients` string, nullable
    - `allergens` string[]
  - `serving` BarcodeServing, required
    - `label` string, nullable: Human-readable serving, e.g. '1 tsp (4 g)'
    - `quantity` number, nullable: Numeric serving amount when available
    - `unit` string, nullable: Serving unit, e.g. g or ml
  - `nutrition_per_100g` BarcodeMacros, required
    - `energy_kcal` number, nullable: Energy in kcal
    - `protein_g` number, nullable
    - `carbohydrates_g` number, nullable
    - `fat_g` number, nullable
    - `fiber_g` number, nullable
    - `sugars_g` number, nullable
    - `saturated_fat_g` number, nullable
    - `salt_g` number, nullable
    - `sodium_g` number, nullable
    - `added_sugars_g` number, nullable
  - `nutrition_per_serving` BarcodeMacros
    - `energy_kcal` number, nullable: Energy in kcal
    - `protein_g` number, nullable
    - `carbohydrates_g` number, nullable
    - `fat_g` number, nullable
    - `fiber_g` number, nullable
    - `sugars_g` number, nullable
    - `saturated_fat_g` number, nullable
    - `salt_g` number, nullable
    - `sodium_g` number, nullable
    - `added_sugars_g` number, nullable
  - `micronutrients_per_100g` BarcodeMicronutrient[]
    - `name` string, required
    - `amount` number, required
    - `unit` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/calorieapi/apis/calorie-api.md) · [All operations](https://skmtc.dev/calorieapi/apis/calorie-api/llms.txt) · [OpenAPI document](https://skmtc.dev/calorieapi/apis/calorie-api/revisions/f851bb41617a?raw)
