Skip to content

UPC EAN Barcode Nutrition Lookup JSON API

Published June 16, 2026

A UPC EAN barcode nutrition lookup JSON API resolves packaged food barcodes to calories, protein, carbs, and fat in one HTTP GET. Mobile calorie apps, grocery tools, and kiosk scanners depend on this flow. Calorie API returns consistent JSON for North American UPC and international EAN codes.

Endpoint

curl "https://api.calorieapi.com/api/v1/search/barcode/012345678905" \
  -H "X-API-Key: YOUR_KEY"

Validate format before calling:

/^\d{8,14}$/.test(upc)

JSON Response Shape

Typical fields for app models:

FieldTypeUse
idintegerDetail / portion calls
namestringDisplay name
brandstringOptional subtitle
caloriesnumberPer 100g
protein_gnumberMacro tracking
carbohydrates_gnumberCarb apps
fat_gnumberMacro tracking
barcodestringEcho UPC
allergensarrayFilter UX

Exact schema in API docs.

Mobile Integration

PlatformGuide
Android KotlinBarcode example
iOS SwiftUIFood logging REST
IonicCapacitor scanner
Grocery listsGrocery barcode lookup

Security

Never call with client-side key. Use Firebase or Next.js proxy.

Not Found Handling

Return friendly UX:

  1. Offer manual search
  2. Let user create custom food
  3. Log UPC for catalog gap analytics

Compare vendors: Chomp alternative | Food barcode lookup API.

Get free key

Frequently Asked Questions

Does Calorie API support UPC and EAN barcodes?

Yes. GET /search/barcode/{upc} accepts standard 8 to 14 digit UPC and EAN barcodes and returns nutrition JSON.

What JSON fields does barcode lookup return?

Responses include food ID, name, brand, per-100g calories, protein, carbohydrates, fat, barcode, and allergens when available.

How do mobile apps call barcode nutrition APIs securely?

Mobile apps call a backend proxy that adds the Calorie API key server-side rather than embedding secrets in the app bundle.

What if a UPC is not in the database?

Fall back to text search, allow custom foods, or prompt users to enter nutrition manually while you log missing UPCs.

UPC vs EAN: does it matter?

Calorie API accepts both formats in the same barcode path. Normalize to digits only before calling the endpoint.

← Back to all articles

Start building with the Calorie API

Get a free API key and access 4M+ foods with search, barcode lookup, and full macro data.