Skip to content

Lookup Barcode

POST
/users/{user_id}/food-items/barcode
curl --request POST \
--url https://example.com/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/food-items/barcode \
--header 'Content-Type: application/json' \
--data '{ "barcode": "example" }'

Resolve a scanned barcode to a food item — reusing the owned DB before OpenFoodFacts.

Dedup order: (1) same barcode already scanned, (2) OFF product matching an existing (name, brand) row — the barcode is attached to it. Otherwise a new item is created with OFF’s label nutrition (source="verified" — label data beats an AI estimate).

user_id
required
User Id
string format: uuid
Media typeapplication/json
BarcodeLookup
object
barcode
required
Barcode
string
Examplegenerated
{
"barcode": "example"
}

Successful Response

Media typeapplication/json
FoodItemRead
object
barcode
required
Any of:
string
brand
required
Brand
string
confidence
required
Any of:
string
created_at
required
Created At
string format: date-time
id
required
Id
string format: uuid
is_drink
required
Is Drink
boolean
name
required
Name
string
nutrition
required
Any of:
object
key
additional properties
any
place
required
Any of:
string
serving_description
required
Any of:
string
source
required
Source
string
updated_at
required
Updated At
string format: date-time
usage_count
required
Usage Count
integer
Examplegenerated
{
"barcode": "example",
"brand": "example",
"confidence": "example",
"created_at": "2026-04-15T12:00:00Z",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"is_drink": true,
"name": "example",
"nutrition": {},
"place": "example",
"serving_description": "example",
"source": "example",
"updated_at": "2026-04-15T12:00:00Z",
"usage_count": 1
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}