OCR an Image
PythonToolsPOST api.upapi.io/image-ocr.postRead the text in an image, by URL or as an inline base64 upload. Returns the full text plus every detected line with its confidence score and pixel bounding box. Runs locally on PP-OCR/ONNX — no cloud vision API, no per-image fee.
Request schema
| Field | Type | Description |
|---|---|---|
url | Public URL of the image to read (e.g. https://example.com/receipt.png). Provide this OR file, not both.· default: null | |
file | The image itself, base64-encoded (no data: URI prefix). Max 3.7 MB decoded — base64 inflates by 4/3 and the API request body is capped at 5 MB. Supply url instead for anything larger. Expected media type image/*.· default: null | |
languages | Scripts present in the image (e.g. en). Supported: ch, en — one bundled model covers Latin and Chinese. Omit for the default.· default: null |
Response schema
| Field | Type | Description |
|---|---|---|
textreq | string | All recognised text, one detected line per row |
widthreq | integer | Image width in pixels |
blocksreq | array | Each detected line with its confidence and box |
heightreq | integer | Image height in pixels |
truncatedreq | boolean | True when more than 5000 text blocks were detected and cut |
Try it
Try it
Public URL of the image to read (e.g. https://example.com/receipt.png). Provide this OR file, not both.
The image itself, base64-encoded (no data: URI prefix). Max 3.7 MB decoded — base64 inflates by 4/3 and the API request body is capped at 5 MB. Supply url instead for anything larger. Expected media type image/*.
Sent inline as base64, so the request body cap applies — files up to 3.7 MB.
Scripts present in the image (e.g. en). Supported: ch, en — one bundled model covers Latin and Chinese. Omit for the default.
Run this endpoint live
Jump in as a guest — no signup — and run image-ocr.post with your own inputs. Create a free account anytime to get your own API key.
Code examples
curl -X POST https://api.upapi.io/image-ocr.post \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{ "url": "https://example.com/receipt.png" }'