REST API documentation

This service provides a REST API for processing individual images attachments or URLs and returning the analysis in real time. The service accepts the data to be annotated as a standard HTTP POST request, and all configuration is done through URL query parameters.

The results page produced by using the web interface. gives two example URLs: one for processing an image as an attachments in the POST request body and another for processing a URL as a string in the POST request body.

In both cases, the OCR output is returned as plain text in the body of the HTTP response.

The following parameters can be passed to the service using the URL query string; all parameters are optional and the default values are used if they are omitted.

                http://..../endpoint?key=value&key=value
            
  • col — preprocessing the image before OCR
    • 0 — no change (default value)
    • 1 — convert to greyscale
    • 2 — convert to monochrome
    • 3 — convert to greyscale and invert
    • 4 — convert to monochrome and invert
  • filter — postprocessing the text with a regular expression to remove noise
    • 0 — no filtering (default value)
    • 1 — minimum filtering
    • 2 — medium filtering
    • 3 — maximum filtering
  • lang — language model; this is provided for future improvements in the service
    • eng — English (default value)

When a problem prevents the correct execution of the request, an error response is returned with an HTTP status code specifying the type of the error as described below together with a human readable error message.

Status Code Description
40x Problems with the user input
50x Errors during the execution of the request