Detect page rotation and script (e.g. a scan that's upside down)

Detects how a scan is rotated and which script it uses, so you can straighten it before OCR.

Request

POSThttps://ocr-image-to-text.p.apihiver.com/v1/orientation

Upload the image in the file field (max 25 MB). Instead of a file you can send JSON: {"url": "https://…"} for a public image URL, or {"base64": "…"}.

*
No file chosen
File. The image file (JPG, PNG, WebP, GIF, BMP or TIFF).

Parameters and body structure are inherited from this endpoint's definition. Changes here only apply to this test run.

Language
Client
1curl --request POST \
2  --url https://ocr-image-to-text.p.apihiver.com/v1/orientation \
3  --header 'Accept: application/json' \
4  --header 'X-API-Key: YOUR_API_KEY' \
5  --header 'content-type: multipart/form-data' \
6  --form file=@file.bin

Detect page rotation and script (e.g. a scan that's upside down): OCR API — Image to Text reference

Detects how a scan is rotated and which script it uses, so you can straighten it before OCR. This endpoint is part of the OCR API — Image to Text: Extract text from images and scans in English, Hindi and Marathi, and pull out emails, phone numbers, URLs, PAN and GSTIN.

Example response (200, application/json)

Success.

1{
2  "script": "Latin",
3  "rotate_by_degrees": 0,
4  "script_confidence": 7.78,
5  "orientation_degrees": 0,
6  "orientation_confidence": 2.96
7}

Errors

  • 400 — A required parameter is missing or a value has the wrong format.
    1{
    2  "error": {
    3    "code": "INVALID_INPUT",
    4    "message": "Provide a file upload, 'url', or 'base64'."
    5  }
    6}

Gateway errors (missing key, no subscription, rate limits) are listed in Error codes.