Predict

Generate OCR-based predictions for a product.

Changed on

Generate OCR-based predictions for a product based on the OCR JSON obtained from Google Cloud Vision.

get/predict/ocr_prediction

Request

  • Base URL
    https://robotoff.openfoodfacts.org/api/v1
  • URL
    https://robotoff.openfoodfacts.org/api/v1/predict/ocr_prediction
  • Auth
    none declared

Query parameters

ocr_urlstring uri required
Example:https://static.openfoodfacts.org/images/products/216/124/000/3089/1.json

The URL of the OCR JSON to use for extraction

server_type'off' | 'obf' | 'opff' | 'opf' | 'off_pro'

The server type (=project) to use, such as 'off' (Open Food Facts), 'obf' (Open Beauty Facts),...

prediction_typesstring
Example: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 DEFAULT_OCR_PREDICTION_TYPES variable in Robotoff codebase)

Response

the extracted predictions

Changes

    • breaking

      the /// response's property type changed from string to no type for status

    • info

      removed the obf enum value from the /// response property for the response status

    • info

      removed the off enum value from the /// response property for the response status

    • info

      removed the off_pro enum value from the /// response property for the response status

    • info

      removed the opf enum value from the /// response property for the response status

    • info

      removed the opff enum value from the /// response property for the response status