Download OpenAPI specification:Download
Robotoff provides a simple API allowing consumers to fetch predictions and annotate them.
All endpoints must be prefixed with /api/v1
. The full URL is https://robotoff.openfoodfacts.org/api/v1/{endpoint}
.
Endpoints for managing and retrieving questions about products that need human validation.
Questions are sorted by priority: we want questions with highest impact to be displayed first. The order is the following:
barcode required | integer Example: 5410041040807 The barcode of the product |
count | integer >= 1 Default: 1 The number of questions to return |
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
lang | string Default: "en" The language of the question/value |
insight_types | string Example: insight_types=brand,label Comma-separated list, filter by insight types |
{- "status": "no_questions",
- "questions": [
- { }
]
}
lang | string Default: "en" The language of the question/value |
count | integer >= 1 Default: 25 The number of items to return |
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
insight_types | string Example: insight_types=brand,label Comma-separated list, filter by insight types |
countries | string Example: countries=uk Comma separated list, filter by country value (2-letter code) |
brands | string Example: brands=carrefour,ferrero Comma-separated list, filter by brands |
value_tag | string Example: value_tag=en:organic Filter by value tag, i.e the value that is going to be sent to Product Opener |
page | integer >= 1 Default: 1 Page index to return (starting at 1) |
reserved_barcode | boolean Default: false If true, also return questions about products with reserved barcodes |
campaigns | string Example: campaigns=agribalyse-category Filter by annotation campaigns (the insight must have all the campaigns) An annotation campaign allows to only retrieve questions or insights based on arbitrary criteria defined during insight import. |
predictor | string Example: predictor=universal-logo-detector Filter by predictor value A predictor refers to the model/method that was used to generate the prediction. |
order_by | string Default: "popularity" Enum: "confidence" "random" "popularity" The field to use for ordering results:
|
{- "status": "no_questions",
- "questions": [
- { }
], - "count": 0
}
Get number of unanswered questions grouped by value_tag
.
The list is ordered from highest count to lowest.
count | number >= 1 Default: 25 The number of distinct |
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
type | string Filter by insight type |
countries | string Example: countries=uk Comma separated list, filter by country value (2-letter code) |
page | integer >= 1 Default: 1 Page index to return (starting at 1) |
reserved_barcode | boolean Default: false If true, also return questions about products with reserved barcodes |
campaigns | string Example: campaigns=agribalyse-category Filter by annotation campaigns (the insight must have all the campaigns) An annotation campaign allows to only retrieve questions or insights based on arbitrary criteria defined during insight import. |
predictor | string Example: predictor=universal-logo-detector Filter by predictor value A predictor refers to the model/method that was used to generate the prediction. |
{- "count": 0,
- "questions": [
- "string"
], - "status": "found"
}
An insight is a fact about a product that has been either extracted or inferred from the product pictures, characteristics,... If the insight is correct, the Openfoodfacts DB can be updated accordingly.
Current insight types and their description can be found in robotoff/insights/dataclass.py.
Return insights based on various filters. The results can be filtered by insight type, barcode, annotation status, and more.
The insight_types
parameter is a comma-separated list of insight types to filter by.
If no insight_types
are provided, insights of all types are returned.
insight_types | string Example: insight_types=brand,label Comma-separated list, filter by insight types |
barcode | integer Example: barcode=5410041040807 Filter by barcode value |
annotated | boolean Example: annotated=true Filter by annotation status of the insight. A true value ( |
annotation | integer Example: annotation=1 Filter by annotation value of the insight. If not provided, all insights are returned. This works in conjunction with the |
value_tag | string Example: value_tag=en:organic Filter by value tag, i.e the value that is going to be sent to Product Opener |
brands | string Example: brands=carrefour,ferrero Comma-separated list, filter by brands |
countries | string Example: countries=uk Comma separated list, filter by country value (2-letter code) |
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
predictor | string Example: predictor=universal-logo-detector Filter by predictor value A predictor refers to the model/method that was used to generate the prediction. |
order_by | string Enum: "random" "popularity" Example: order_by=popularity How to order by insight results. By default, results are not ordered. Possible values are:
|
count | integer >= 1 Default: 25 The number of items to return |
page | integer >= 1 Default: 1 Page index to return (starting at 1) |
campaigns | string Example: campaigns=agribalyse-category Filter by annotation campaigns (the insight must have all the campaigns) An annotation campaign allows to only retrieve questions or insights based on arbitrary criteria defined during insight import. |
lc | string Example: lc=en,fr,de Comma-separated list of language codes to filter insights by language |
{- "insights": [
- {
- "id": "3cd5aecd-edcc-4237-87d0-6595fc4e53c9",
- "type": "label",
- "barcode": 9782012805866,
- "countries": [
- "en:france",
- "en:united-kingdom"
]
}
], - "status": "found",
- "count": 10
}
The annotation can be submitted as an anonymous user or as a registered user. If the user is anonymous, the annotation will be accounted as a vote, and several identical anonymous votes are required to apply the insight. If the vote is sent from a registered user, it is applied directly.
To send the annotation as a registered user, send Open Food Facts credentials to the API using
Basic Authentication: add a Authorization: basic {ENCODED_BASE64}
header where {ENCODED_BASE64}
is an base64-encoded string of user:password
. Don't provide an authentication header for anonymous
users.
The annotation is an integer that can take 4 values: 0
, 1
, 2
, -1
. 0
means the insight is incorrect
(so it won't be applied), 1
means it is correct (so it will be applied) and -1
means the insight
won't be returned to the user (skip). 2
is used when user submit some data to the annotate endpoint
(for example in some cases of category annotation or ingredients spellcheck).
We use the voting mecanism system to remember which insight to skip for a user (authenticated or not).
insight_id required | string <uuid> ID of the insight |
annotation required | integer Enum: 0 1 -1 2 Annotation of the prediction: 1 to accept the prediction, 0 to refuse it, and -1 for skip, 2 to accept and add data |
update | integer Default: 1 Enum: 0 1 Send the update to Openfoodfacts if |
data | object or null Additional data provided by the user as key-value pairs (required when annotation=2) |
device_id | string Device identifier for tracking anonymous votes |
{- "status_code": 0,
- "status": "string",
- "description": "string"
}
Generate a CSV dump of insights with specific criteria.
If more than 10,000 insights match provided criteria and count
is not provided, a HTTP 400
is returned
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
value_tag | string Example: value_tag=en:organic Filter by value tag, i.e the value that is going to be sent to Product Opener |
insight_types | string Example: insight_types=brand,label Comma-separated list, filter by insight types |
barcode | string Example: barcode=5410041040807 Filter by barcode value |
annotated | boolean or null Default: null The annotation status of the insight. If not provided, both annotated and non-annotated insights are returned |
count | integer or null [ 0 .. 10000 ] Default: null Maximum number of insights to return. If not provided, an HTTP 400 response may be returned if more than 10,000 insights match the criteria |
count | integer >= 1 Default: 25 The number of items to return |
page | integer >= 1 Default: 1 Page index to return (starting at 1) |
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
barcode | string Example: barcode=5410041040807 Filter by barcode value |
types | string Example: types=brand,label Comma-separated list, filter by prediction types |
{- "status": "no_predictions",
- "predictions": [
- { }
], - "count": 0
}
Endpoints for processing and manipulating images, including cropping and running prediction models.
This endpoint is currently only used to generate cropped logos on Hunger Games from a base image and cropping coordinates. Cropping coordinates are relative (between 0. and 1. inclusive), with (0, 0) being the upper left corner.
image_url | string <uri> Example: image_url=https://images.openfoodfacts.org/images/products/541/004/104/0807/3.jpg The URL of the input image |
y_min | number [ 0 .. 1 ] Example: y_min=0.47795143723487854 The minimum y-coordinate for cropping, relative to the image height. We use relative coordinates, with (0, 0) being the upper left corner and (1, 1) being the lower right corner. |
x_min | number [ 0 .. 1 ] Example: x_min=0.5583494305610657 The minimum x-coordinate for cropping, relative to the image width. We use relative coordinates, with (0, 0) being the upper left corner and (1, 1) being the lower right corner. |
y_max | number [ 0 .. 1 ] Example: y_max=0.5653171539306641 The maximum y-coordinate for cropping, relative to the image height. We use relative coordinates, with (0, 0) being the upper left corner and (1, 1) being the lower right corner. |
x_max | number [ 0 .. 1 ] Example: x_max=0.6795185804367065 The maximum x-coordinate for cropping, relative to the image width. We use relative coordinates, with (0, 0) being the upper left corner and (1, 1) being the lower right corner. |
Run image prediction models on product images
barcode required | integer Example: barcode=5410041040807 The barcode of the product |
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
models | string Example: models=nutrition-table,universal-logo-detector Comma-separated list of model names to run |
output_image_id | string Image ID to store predictions for |
{- "predictions": [
- { }
]
}
Retrieve images with optional filters
count | integer >= 1 Default: 25 The number of items to return |
page | integer >= 1 Default: 1 Page index to return (starting at 1) |
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
barcode | integer Example: barcode=5410041040807 Filter by barcode value |
with_predictions | boolean Default: false Filter images that have predictions |
{- "status": "no_images",
- "images": [
- { }
], - "count": 0
}
Return image predictions based on various filters. The results can be filtered by model name, type, confidence, and more.
count | integer >= 1 Default: 25 The number of items to return |
page | integer >= 1 Default: 1 Page index to return (starting at 1) |
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
barcode | string Example: barcode=5410041040807 Filter by barcode value |
with_logo | boolean or null Default: null if True, only return image predictions that have associated logos (only valid for universal-logo-detector image predictions). If false, only return image predictions that have no associated logos. Otherwise, return all image predictions. |
model_name | string Example: model_name=universal-logo-detector filter by name of the image predictor model |
image_id | string Example: image_id=1 filter by image ID. It should be a digit (raw images only), otherwise no result will be returned. |
type | string Example: type=object_detection filter by type of the image predictor model |
model_version | string filter by model version value |
min_confidence | number [ 0 .. 1 ] filter by minimum confidence score value |
{- "status": "no_image_predictions",
- "image_predictions": [
- { }
], - "count": 0
}
Bulk import image predictions into the database
required | Array of objects |
{- "predictions": [
- {
- "barcode": "string",
- "image_id": "string",
- "model_name": "string",
- "model_version": "string",
- "data": { },
- "server_type": "string"
}
]
}
Endpoints for managing logo annotations, searching, and bulk operations on logos detected in product images.
Search for logos detected using the universal-logo-detector model that meet some criteria (annotation status, annotated, type,...)
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
barcode | string Example: barcode=5410041040807 Filter by barcode value |
count | number [ 1 .. 2000 ] Default: 25 Number of results to return |
type | string Example: type=packager_code Filter by logo type |
value | string Example: value=lidl Filter by annotated value |
taxonomy_value | string Example: taxonomy_value=en:organic Filter by taxonomy value, i.e. the canonical value present is the associated taxonomy. This parameter is mutually exclusive with |
min_confidence | number Filter logos that have a confidence score above a threshold |
random | boolean Default: false If true, randomized result order |
annotated | boolean or null Default: null The annotation status of the logo. If not provided, both annotated and non-annotated logos are returned |
{- "logos": [
- { }
], - "count": 0
}
Bulk annotate logos with type and value
required | Array of objects |
server_type | object The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
{- "annotations": [
- {
- "logo_id": 0,
- "type": "brand",
- "value": "string"
}
], - "server_type": { }
}
{- "annotated": 0
}
Mass update logo annotations by changing type and value
source_type required | string Current logo type to update from |
source_value required | string Current logo value to update from |
target_type required | string New logo type to update to |
target_value required | string New logo value to update to |
{- "updated": 0
}
Update the type and value of a logo annotation
logo_id required | integer Example: 1 The ID of the logo to update |
type required | string non-empty The type of the logo |
value | string or null The value/name of the logo |
{- "type": "string",
- "value": "string"
}
Approximate Nearest Neighbor search endpoints for finding similar logos based on visual features.
Return ID and distance of each logo found, the number of neighbors returned and the ID of the query logo.
count | integer [ 1 .. 2000 ] Default: 25 Number of neighbors to return |
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
{- "results": [
- {
- "logo_id": 1,
- "distance": 0.1
}
], - "count": 0,
- "query_logo_id": 0
}
Return ID and distance of each logo found, the number of neighbors returned and the ID of the query logo.
count | integer [ 1 .. 2000 ] Default: 25 Number of neighbors to return |
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
{- "results": [
- {
- "logo_id": 1,
- "distance": 0.1
}
], - "count": 0,
- "query_logo_id": 0
}
Extract and parse ingredient lists from OCR text
ocr_url required | string <uri> Example: ocr_url=https://static.openfoodfacts.org/images/products/216/124/000/3089/1.json URL of the OCR JSON to process |
aggregation_strategy | string Default: "simple" Enum: "simple" "max" "first" Strategy for aggregating ingredient entities |
model_version | string Default: "1" Version of the ingredient extraction model |
{- "ingredients": [
- { }
]
}
Predictions are performed using a neural model. As input, you can either provide:
barcode
of a product: Robotoff will fetch the product from
Product Opener and will use this data as inputs to predict categories.product
key. The neural category model
accepts the following fields as input: product_name
, ingredients_tags
,
ocr
, nutriments
, image_embeddings
. All fields are optional (but you should at least provide one).barcode required | string non-empty The barcode of the product to categorize |
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... Only 'off' is currently supported for category prediction |
deepest_only | boolean If true, only return the deepest elements in the category taxonomy (don't return categories that are parents of other predicted categories) |
threshold | number Default: 0.5 The score above which we consider the category to be detected |
{- "product": {
- "product_name": "roasted chicken",
- "ingredients_tags": [
- "en:chicken",
- "en:salts"
], - "image_embeddings": [
- [
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0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 0
]
], - "ocr": [
- "string"
], - "nutriments": {
- "fat_100g": 0,
- "saturated-fat_100g": 0,
- "carbohydrates_100g": 0,
- "sugars_100g": 0,
- "fiber_100g": 0,
- "proteins_100g": 0,
- "salt_100g": 0,
- "energy-kcal_100g": 0,
- "fruits-vegetables-nuts_100g": 0
}
}, - "deepest_only": true,
- "threshold": 0.5
}
{- "neural": [
- {
- "value_tag": "en:roast-chicken",
- "confidence": 0.6
}
]
}
Predict nutritional information from a packaging image using the Nutri-Sight model.
The model takes an image and the OCR result (as a JSON file) obtained from Google Cloud Vision. For more information about the model, see the Nutri-Sight documentation.
image_url | string <uri> Example: image_url=https://images.openfoodfacts.org/images/products/541/004/104/0807/3.jpg The URL of the input image |
ocr_url | string <uri> Example: ocr_url=https://images.openfoodfacts.org/images/products/541/004/104/0807/3.json The URL of the OCR JSON to use. The OCR must have been extracted using Google Cloud Vision, and be in the JSON format. |
{- "predictions": [
- {
- "nutrients": { },
- "entities": {
- "aggregated": [
- { }
], - "postprocessed": [
- { }
], - "raw": [
- { }
]
}
}
]
}
ocr_url required | string <uri> Example: ocr_url=https://static.openfoodfacts.org/images/products/216/124/000/3089/1.json The URL of the OCR JSON to use for extraction |
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
prediction_types | string Example: prediction_types=category,label a comma-separated list of prediction types to use for extraction. If not provided, we use the default:
set of OCR prediction types (see |
{- "predictions": [
- {
- "barcode": "5410041040807",
- "type": "category",
- "timestamp": "2023-05-13 02:10:09.107262",
- "data": { },
- "value_tag": "en:beverages",
- "value": null,
- "automatic_processing": false,
- "source_image": "541/004/104/0807/3.jpg",
- "id": 1522429,
- "predictor_version": "keras-image-embeddings-3.0",
- "predictor": "neural",
- "server_type": "off",
- "confidence": 0.95
}
]
}
Predict the language of a text using a neural model. A POST version of this endpoint is also available, it accepts a JSON body with exactly the same parameters.
Use the POST version if you want to predict the language of a long text, as the GET version has a limit on the length of the text that can be provided.
text required | string Example: text=hello world The text to predict language of |
k | integer >= 1 Default: 10 the number of predictions to return |
threshold | number [ 0 .. 1 ] Default: 0.01 the minimum probability for a language to be returned |
{- "predictions": [
- {
- "lang": "en",
- "confidence": 0.9
}
]
}
Predict the language of a text using a neural model. Use this POST version for long texts, as the GET version has a limit on the length of the text that can be provided in the query string.
text required | string The text to predict language of |
k | integer >= 1 Default: 10 The number of predictions to return |
threshold | number [ 0 .. 1 ] Default: 0.01 The minimum probability for a language to be returned |
{- "text": "hello world",
- "k": 10,
- "threshold": 0.01
}
{- "predictions": [
- {
- "lang": "en",
- "confidence": 0.9
}
]
}
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.
barcode required | integer Example: barcode=5410041040807 The barcode of the product |
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
k | integer >= 1 Default: 10 Number of language predictions to return |
threshold | number [ 0 .. 1 ] Default: 0.01 the minimum probability for a language to be returned |
{- "counts": [
- {
- "lang": "en",
- "count": 10
}
], - "percent": [
- {
- "lang": "en",
- "percent": 80.5
}
], - "image_ids": [
- 1
]
}
Retrieve logo annotations with optional filters
count | integer >= 1 Default: 25 The number of items to return |
page | integer >= 1 Default: 1 Page index to return (starting at 1) |
server_type | string Default: "off" Enum: "off" "obf" "opff" "opf" "off_pro" The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),... |
barcode | integer Example: barcode=5410041040807 Filter by barcode value |
value_tag | string Example: value_tag=en:organic Filter by value tag, i.e the value that is going to be sent to Product Opener |
types | string Example: types=brand,label Comma-separated list of annotation types to filter by |
{- "status": "no_annotation",
- "annotation": [
- { }
], - "count": 0
}
Import batch job data into Robotoff database. This endpoint is secured and requires bearer authentication.
This endpoint is mainly used by the batch job once the job is finished.
job_type required | string Value: "ingredients_spellcheck" The type of batch job launched. |
batch_dir required | string Example: batch_dir=gs://bucket/path/to/batch/results The directory path where batch job results are stored |
{- "status": "string"
}