Image OCR API Docs
The docs are public, but image OCR calls are reserved for professional-tier members. The current flow supports local uploads, remote image URLs, and work URLs, then returns a shared polling path for every task.
API Key / Secret pairs can only be created or deleted after sign-in.
Image OCR consumes quota by the number of successfully processed images.
Invalid credentials, exhausted quota, or unauthorized access return 401 / 403 responses.
Each Key is paired with one Secret that is fully shown only once at creation time.
Store credentials on the server side only, never in browser code or public repos.
Image OCR, video extraction, and AI rewrite all reuse the same polling and management flow.
Download a runnable Python sample package with local upload, remote image list, and workUrl OCR examples for the current deployment API.
Review public plan entitlements and the sign-in path first, then create keys, inspect quota, and manage request logs.
If you need public video or post URL extraction instead, continue to the video copy API docs.
If you plan to upload local images, review the runtime preflight guide first so you can confirm OCR and Whisper dependencies on the current instance.
API Key / Secret pairs can only be created or deleted after sign-in.
Image OCR checks the account's monthly OCR quota for real and returns 403 when credits are exhausted.
Open API requests still follow the current plan's per-minute rate limit.
If your flow includes local image uploads, call `GET /api/public/runtime-health` first so you can verify that RapidOCR is ready on the current machine.
Base URL: `https://your-open-instance.example.com`
Image OCR upload: `POST /api/open/image/extract`
Shared task polling: `GET /api/open/video/query`
Public runtime preflight: `GET /api/public/runtime-health`
The current API supports local uploads, remote `imageUrls` list OCR, and `workUrl` parsing before OCR runs against the resolved images.
This live panel reads the current instance through `GET /api/public/runtime-health`, so you can verify RapidOCR and the local Whisper runtime before wiring image uploads into the same deployment.
Download a runnable toolkit for `GET /api/public/runtime-health`, `WHISPER_MODEL` checks, and local Whisper cache warmup, especially for `cache-required` and cached snapshot folder errors.
# curl: upload a local image
curl -X POST "https://your-open-instance.example.com/api/open/image/extract" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-api-secret: YOUR_API_SECRET" \
-F "file=@./sample-ocr.png;type=image/png" \
-F "locale=en"
# curl: submit one remote image URL
curl -X POST "https://your-open-instance.example.com/api/open/image/extract" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-api-secret: YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"type": "imageUrl",
"imageUrl": "https://cdn.example.com/sample-ocr.png",
"locale": "en"
}'
# curl: submit a remote image URL list
curl -X POST "https://your-open-instance.example.com/api/open/image/extract" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-api-secret: YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"type": "imageUrl",
"imageUrls": [
"https://cdn.example.com/sample-ocr-1.png",
"https://cdn.example.com/sample-ocr-2.png"
],
"locale": "en"
}'
# curl: submit a workUrl
curl -X POST "https://your-open-instance.example.com/api/open/image/extract" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-api-secret: YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"type": "workUrl",
"workUrl": "https://www.example.com/posts/123456",
"locale": "en"
}'curl "https://your-open-instance.example.com/api/open/video/query?taskId=YOUR_TASK_ID" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-api-secret: YOUR_API_SECRET"curl "https://your-open-instance.example.com/api/public/runtime-health"
{
"msg": "操作成功",
"code": 200,
"data": {
"checkedAt": "2026-07-18T15:41:52.660Z",
"localTranscription": {
"ready": false,
"dependencyStatus": "ready",
"ffmpegStatus": "ready",
"whisperReadiness": "cache-required",
"allowDownload": false,
"model": "small",
"source": "huggingface-cache",
"cacheLookupScopes": [
"HOME_CACHE_HUGGINGFACE_HUB",
"LOCALAPPDATA_HUGGINGFACE_HUB"
],
"nextSteps": [
{
"code": "prepare-local-whisper-model",
"severity": "critical",
"commands": [
"python -c \"from huggingface_hub import snapshot_download; snapshot_download(repo_id='Systran/faster-whisper-small')\"",
"python -c \"from faster_whisper import WhisperModel; WhisperModel('small', device='cpu', compute_type='int8', local_files_only=True)\"",
"curl \"<部署地址>/api/public/runtime-health\""
]
}
]
},
"imageOcr": {
"ready": true,
"dependencyStatus": "ready",
"nextSteps": []
}
}
}# TypeScript: submit a remote image URL list and poll the aggregated result
const createResponse = await fetch("https://your-open-instance.example.com/api/open/image/extract", {
method: "POST",
headers: {
"x-api-key": process.env.ATC_API_KEY!,
"x-api-secret": process.env.ATC_API_SECRET!,
"Content-Type": "application/json",
},
body: JSON.stringify({
type: "imageUrl",
imageUrls: [
"https://cdn.example.com/sample-ocr-1.png",
"https://cdn.example.com/sample-ocr-2.png",
],
locale: "en",
}),
});
const createPayload = await createResponse.json();
const taskId = createPayload.data.taskId;
let queryPayload = null;
for (let attempt = 0; attempt < 20; attempt += 1) {
const queryResponse = await fetch(
"https://your-open-instance.example.com/api/open/video/query?taskId=" + encodeURIComponent(taskId),
{
headers: {
"x-api-key": process.env.ATC_API_KEY!,
"x-api-secret": process.env.ATC_API_SECRET!,
},
},
);
queryPayload = await queryResponse.json();
if (queryPayload.data?.status === "SUCCESS" || queryPayload.data?.status === "FAILURE") {
break;
}
await new Promise((resolve) => setTimeout(resolve, 3000));
}
const batchItems = Array.isArray(queryPayload?.data?.batchItems) ? queryPayload.data.batchItems : [];
const successfulItems = batchItems.filter((item) => item.status === "SUCCESS");
console.log(queryPayload?.data?.textContent ?? "");
console.log(successfulItems.map((item) => item.cover));
# Python: submit a workUrl and read the OCR batch result
import requests
import time
headers = {
"x-api-key": "YOUR_API_KEY",
"x-api-secret": "YOUR_API_SECRET",
"Content-Type": "application/json",
}
create_response = requests.post(
"https://your-open-instance.example.com/api/open/image/extract",
headers=headers,
json={
"type": "workUrl",
"workUrl": "https://www.example.com/posts/123456",
"locale": "en",
},
timeout=30,
)
task_id = create_response.json()["data"]["taskId"]
query_payload = None
for _ in range(20):
query_response = requests.get(
"https://your-open-instance.example.com/api/open/video/query",
headers=headers,
params={"taskId": task_id},
timeout=30,
)
query_payload = query_response.json()
if query_payload["data"]["status"] in ("SUCCESS", "FAILURE"):
break
time.sleep(3)
batch_items = query_payload["data"].get("batchItems") or []
print(query_payload["data"].get("textContent", ""))
print(len(batch_items))
print(query_payload["data"].get("meta", {}).get("ocrCountUsed"))1. Create an API Key / Secret from a signed-in account first.
2. Call `POST /api/open/image/extract` with a local upload, an `imageUrls` list, or a `workUrl`, then store the returned `taskId`.
3. Poll `GET /api/open/video/query` every 3 to 5 seconds until the task reaches `SUCCESS` or `FAILURE`.
4. After success, read `textContent`, `cover`, `imageUrlList`, `batchItems`, `meta.ocrCountUsed`, and `meta.imageOcrSourceType`.
{
"msg": "Success",
"code": 200,
"data": {
"taskId": "c32fce2c-bc94-46e6-a91f-9f4636444d7e",
"kind": "image-extract",
"displayKind": "image-extract",
"displayKindTitle": "Image Copy Extraction Tool",
"title": "Remote Image OCR (2 images)",
"content": "https://cdn.example.com/sample-ocr-1.png\nhttps://cdn.example.com/sample-ocr-2.png",
"textContent": "#1 [SUCCESS] Image Item 1\nOpen\nOCR\nTask 123\n\n#2 [SUCCESS] Image Item 2\nOpen\nOCR\nTask 123",
"videoUrlList": [],
"imageUrlList": [
"https://your-open-instance.example.com/api/files/c32fce2c-bc94-46e6-a91f-9f4636444d7e-img-1/sample-ocr-1.png?ownerTaskId=c32fce2c-bc94-46e6-a91f-9f4636444d7e",
"https://your-open-instance.example.com/api/files/c32fce2c-bc94-46e6-a91f-9f4636444d7e-img-2/sample-ocr-2.png?ownerTaskId=c32fce2c-bc94-46e6-a91f-9f4636444d7e"
],
"cover": "https://your-open-instance.example.com/api/files/c32fce2c-bc94-46e6-a91f-9f4636444d7e-img-1/sample-ocr-1.png?ownerTaskId=c32fce2c-bc94-46e6-a91f-9f4636444d7e",
"platform": "remote-image",
"workType": "image",
"status": "SUCCESS",
"errorMessage": "Task completed successfully",
"createTime": "2026-07-16T12:00:00.000Z",
"sourceUrl": "https://cdn.example.com/sample-ocr-1.png",
"batchItems": [
{
"taskId": "c32fce2c-bc94-46e6-a91f-9f4636444d7e-img-1",
"title": "Image Item 1",
"content": "",
"textContent": "Open\nOCR\nTask 123",
"videoUrlList": [],
"imageUrlList": [
"https://your-open-instance.example.com/api/files/c32fce2c-bc94-46e6-a91f-9f4636444d7e-img-1/sample-ocr-1.png?ownerTaskId=c32fce2c-bc94-46e6-a91f-9f4636444d7e"
],
"localFiles": ["sample-ocr-1.png"],
"cover": "https://your-open-instance.example.com/api/files/c32fce2c-bc94-46e6-a91f-9f4636444d7e-img-1/sample-ocr-1.png?ownerTaskId=c32fce2c-bc94-46e6-a91f-9f4636444d7e",
"platform": "remote-image",
"workType": "image",
"status": "SUCCESS",
"errorMessage": "Task completed successfully",
"createTime": "2026-07-16T12:00:00.000Z",
"sourceUrl": "https://cdn.example.com/sample-ocr-1.png",
"meta": {
"ocrEngine": "RapidOCR",
"ocrLineCount": 3,
"originalFileName": "sample-ocr-1.png",
"imageOcrSourceType": "image-url",
"batchIndex": 1
}
},
{
"taskId": "c32fce2c-bc94-46e6-a91f-9f4636444d7e-img-2",
"title": "Image Item 2",
"content": "",
"textContent": "Open\nOCR\nTask 123",
"videoUrlList": [],
"imageUrlList": [
"https://your-open-instance.example.com/api/files/c32fce2c-bc94-46e6-a91f-9f4636444d7e-img-2/sample-ocr-2.png?ownerTaskId=c32fce2c-bc94-46e6-a91f-9f4636444d7e"
],
"localFiles": ["sample-ocr-2.png"],
"cover": "https://your-open-instance.example.com/api/files/c32fce2c-bc94-46e6-a91f-9f4636444d7e-img-2/sample-ocr-2.png?ownerTaskId=c32fce2c-bc94-46e6-a91f-9f4636444d7e",
"platform": "remote-image",
"workType": "image",
"status": "SUCCESS",
"errorMessage": "Task completed successfully",
"createTime": "2026-07-16T12:00:00.000Z",
"sourceUrl": "https://cdn.example.com/sample-ocr-2.png",
"meta": {
"ocrEngine": "RapidOCR",
"ocrLineCount": 3,
"originalFileName": "sample-ocr-2.png",
"imageOcrSourceType": "image-url",
"batchIndex": 2
}
}
],
"meta": {
"imageOcrSourceType": "image-url",
"requestedImageCount": 2,
"successCount": 2,
"failureCount": 0,
"ocrCountUsed": 2,
"sourceUrlCount": 2
}
}
}0. If your flow uses local image uploads, query `GET /api/public/runtime-health` first so you do not finish uploading files before discovering that RapidOCR is still unavailable on the current instance.
1. The public image OCR API supports local uploads, `imageUrls` lists, and `workUrl` image resolution. `batchItems` expands one child result per processed image.
2. Both local uploads and remote images are limited to 15 MB per image. Remote images are downloaded locally before OCR, and only `http` / `https` URLs are accepted.
3. `workUrl` depends on the open-source URL extraction pipeline to resolve image assets first. If the public page exposes no recognizable images, the task fails.
4. Image OCR validates the account's OCR quota for real. Remote lists and `workUrl` consume quota by the number of successfully processed images.
5. `localFiles` only contains safe filenames and never exposes absolute server paths. Aggregated task files are attached to child results inside `batchItems`.
6. This page documents the real endpoints already available on the site, and the downloadable example ZIP can be wired up directly after you replace the credentials.
7. Image OCR and local video / audio transcription share the same polling endpoint. When the returned task is actually blocked by the local Whisper runtime, the payload now also includes `runtimeRepairActions` so your own client can surface the help entry and toolkit download immediately.