Predict
Predict the languages of the product
Return the most common languages present on the product images, based on word-level language detection from product images.
Language detection is not performed on the fly, but is based on predictions of type
image_lang
stored in the prediction
table.
Query Parameters
barcodeinteger
The barcode of the product
server_type?string
The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),...
Default
"off"
Value in
"off" | "obf" | "opff" | "opf" | "off_pro"
k?integer
Number of language predictions to return
Default
10
Range
1 <= value
threshold?number
the minimum probability for a language to be returned
Default
0.01
Range
0 <= value <= 1
Response Body
curl -X GET "https://robotoff.openfoodfacts.org/api/v1/predict/lang/product?barcode=5410041040807&server_type=off&k=10&threshold=0.01"
{
"counts": [
{
"lang": "en",
"count": 10
}
],
"percent": [
{
"lang": "en",
"percent": 80.5
}
],
"image_ids": [
1
]
}
Empty