OCR Only
Detect and read text in a product image. Returns recognised regions with polygons, bounding boxes, text, and confidence — no inpainting, no translation, no rendering.
Endpoint
POST /v1/image-translate/ocrRun only the OCR step from the full pipeline. Returns recognised text regions with their geometry and confidence scores. No image is modified, nothing is translated, no final image is produced. Use this when you only need text coordinates and content — for example, to pre-screen images or to drive a custom downstream workflow.
Cheaper per call than /translate.
Request Format
The endpoint accepts raw image bytes in the HTTP body. JSON-with-base64 is not accepted.
| Header | Required | Notes |
|---|---|---|
Content-Type | Yes | image/jpeg, image/png, image/webp, or application/octet-stream |
x-api-key | Yes | Your API key |
All other parameters travel in the query string:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
source_language | string | Yes | — | One of ch, zh, zh-CN, zh-TW, chinese_cht, ja, japan, en, or auto. |
Response
{
"success": true,
"requestId": "550e8400e29b41d4a716446655440000",
"data": {
"regions": [
{
"polygon": [[10, 20], [210, 20], [210, 60], [10, 60]],
"bbox": { "x": 10, "y": 20, "w": 200, "h": 40 },
"text": "免费送货",
"confidence": 0.98
}
],
"src_w": 790,
"src_h": 1158,
"regions_found": 1
}
}| Field | Type | Description |
|---|---|---|
regions[].polygon | number[][] | 4-point polygon in original image coordinates. |
regions[].bbox | object | Axis-aligned bounding box {x, y, w, h} in original coordinates. |
regions[].text | string | Recognised text. |
regions[].confidence | number | Recognition confidence, 0–1. |
src_w, src_h | integer | Original image width and height in pixels. |
regions_found | integer | Number of recognised regions returned. |
Examples
cURL
curl -X POST "https://gateway.apinoa.com/v1/image-translate/ocr?source_language=zh-CN" \
-H "x-api-key: $APINOA_API_KEY" \
-H "Content-Type: image/jpeg" \
--data-binary @product.jpgPython
import requests
with open("product.jpg", "rb") as f:
img_bytes = f.read()
r = requests.post(
"https://gateway.apinoa.com/v1/image-translate/ocr",
headers={
"x-api-key": "YOUR_API_KEY",
"Content-Type": "image/jpeg",
},
params={"source_language": "zh-CN"},
data=img_bytes,
timeout=60,
)
r.raise_for_status()
for region in r.json()["data"]["regions"]:
print(region["text"], region["confidence"])Limits
| Limit | Value |
|---|---|
| Max image dimensions | 8192 × 8192 px |
| Max request body | 20 MB |
| Image format | JPEG, PNG, WebP |
Errors
| Code | HTTP | When |
|---|---|---|
BAD_REQUEST | 400 | Empty body or invalid query params |
UNAUTHORIZED | 401 | Missing or invalid API key |
UNSUPPORTED_MEDIA_TYPE | 415 | Content-Type is not a binary image type |
PAYLOAD_TOO_LARGE | 413 | Body > 20 MB |
INSUFFICIENT_BALANCE | 402 | Your balance does not cover the call |
UPSTREAM_ERROR | 502 | Recognition temporarily unavailable |
Pricing
Each call is charged against your balance at the image-translate rate on the pricing page.