Predict

Generate OCR predictions an OCR JSON

GET
/predict/ocr_prediction

Query Parameters

ocr_urlstring

The URL of the OCR JSON to use for extraction

Formaturi
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"
prediction_types?string

a comma-separated list of prediction types to use for extraction. If not provided, we use the default: set of OCR prediction types (see DEFAULT_OCR_PREDICTION_TYPES variable in Robotoff codebase)

Response Body

curl -X GET "https://robotoff.openfoodfacts.org/api/v1/predict/ocr_prediction?ocr_url=https%3A%2F%2Fstatic.openfoodfacts.org%2Fimages%2Fproducts%2F216%2F124%2F000%2F3089%2F1.json&server_type=off&prediction_types=category%2Clabel"
{
  "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
    }
  ]
}
Empty