Lookup Barcode
POST
/users/{user_id}/food-items/barcode
const url = 'https://example.com/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/food-items/barcode';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"barcode":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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).
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”user_id
required
User Id
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
BarcodeLookup
object
barcode
required
Barcode
string
Examplegenerated
{ "barcode": "example"}Responses
Section titled “Responses”Successful Response
Media typeapplication/json
FoodItemRead
object
brand
required
Brand
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
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>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}