---
title: "Look up a food product by barcode"
method: GET
path: "/foods/barcode/{upc}"
tags: ["Nutrition"]
---

# Look up a food product by barcode

`GET /foods/barcode/{upc}`

## Request

- Base URL: `https://exercise-api.ymove.app/api/v2`
- URL: `https://exercise-api.ymove.app/api/v2/foods/barcode/{upc}`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in query parameter `api_key`

## Path parameters

- `upc` string, required

## Query parameters

- `country` string

## Response `200`

Food product with nutrition data

- object
  - `data` Food: All weights default to grams unless noted. Sodium and cholesterol are in milligrams. Three name fields: `shortName` is a compact label for search results and lists. `displayName` is a detailed label that distinguishes similar foods (includes cooking method, grade, brand). `name` is the raw database entry. Use `shortName` for compact views, `displayName` for detail views. The database includes international products from OpenFoodFacts with names in their original language (Dutch, French, German, Spanish, and more). The API is optimized for English, but searching in other languages works for branded and international products.
    - `id` string
    - `fdcId` integer, nullable: USDA FoodData Central ID
    - `name` string: Full original name from the source database (e.g. USDA). Often long and technical - not recommended for UI display. Example: "Chicken, broilers or fryers, breast, skinless, boneless, meat only, cooked, grilled"
    - `shortName` string: Short, search-friendly label. Use this for search results, autocomplete dropdowns, and compact list views where space is limited. Example: "Chicken Breast", "Brown Rice", "Granola Bar"
    - `displayName` string: Detailed human-readable name that distinguishes similar foods. Use this for food detail pages, nutrition labels, and anywhere users need to tell similar foods apart. Includes cooking method, grade, and preparation for USDA foods. Includes brand in parentheses for packaged products. Examples: "Chicken Breast (grilled, lean)", "Top Round Steak (choice, lean, broiled)", "Granola Bar (Nature Valley)"
    - `brand` string, nullable: Brand name for packaged/branded products. Null for generic foods (e.g. USDA entries). Also included in displayName when present.
    - `category` string, nullable: Food category (e.g. "Poultry Products", "Fruits and Fruit Juices", "Cereals")
    - `servingSize` number: Serving size in grams. All nutritional values (calories, protein, fat, etc.) are per this serving size. To calculate nutrition per 100g: divide each value by servingSize and multiply by 100.
    - `servingDescription` string, nullable: Human-readable serving description (e.g. "1 cup (240ml)", "1 medium (182g)", "1 slice (28g)"). Display this to users alongside servingSize for context.
    - `calories` number: Calories (kcal) per serving
    - `protein` number: Protein per serving in grams. All macro values are in grams unless noted.
    - `fat` number: Total fat per serving (grams)
    - `carbs` number: Carbohydrates per serving (grams)
    - `fiber` number, nullable: Dietary fiber per serving (grams)
    - `sugar` number, nullable: Sugar per serving (grams)
    - `sodium` number, nullable: Sodium per serving in milligrams (not grams - only sodium and cholesterol use mg)
    - `cholesterol` number, nullable: Cholesterol per serving in milligrams
    - `saturatedFat` number, nullable: Saturated fat per serving (grams)
    - `barcode` string, nullable
    - `imageUrl` string, nullable: Product image URL. Sourced from Open Food Facts for branded products and enriched from Open Food Facts / curated staples for generic USDA items. May be null when no image has been located for the food.
    - `source` string: Data source (e.g. "usda", "openfoodfacts")
    - `country` string, nullable: ISO 3166-1 alpha-2 country code (e.g. "FR", "US", "NL") when the product is tagged to a specific country. Null for USDA generic items and untagged products.

## Other responses

- `404`: Product not found

---

[API](https://skmtc.dev/ymove/apis/ymove-fitness-api.md) · [All operations](https://skmtc.dev/ymove/apis/ymove-fitness-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ymove/apis/ymove-fitness-api/revisions/6636f2b4a343?raw)
