Endpoint
GET /ocr/v1/:id
curl https://api.case.dev/ocr/v1/JOB_ID \
-H "Authorization: Bearer sk_case_YOUR_API_KEY"
casedev ocr:v1 retrieve --id $JOB_ID
import Casedev from 'casedev';
const client = new Casedev({ apiKey: 'sk_case_YOUR_API_KEY' });
const job = await client.ocr.v1.retrieve(jobId);
console.log(job.status); // 'pending' | 'processing' | 'completed' | 'failed'
console.log(job.chunks_completed); // Progress
console.log(job.page_count); // Total pages
import casedev
client = casedev.Casedev(api_key='sk_case_YOUR_API_KEY')
job = client.ocr.v1.retrieve(job_id)
print(job.status) # 'pending' | 'processing' | 'completed' | 'failed'
print(job.chunks_completed) # Progress
print(job.page_count) # Total pages
result, _ := client.Ocr.V1.Get(ctx, jobID)
fmt.Println(result.Status)
Response (processing)
{
"id": "1f4a195e-026b-41ff-b367-c61089f5f367",
"status": "processing",
"page_count": 245,
"chunk_count": 50,
"chunks_completed": 23,
"chunks_processing": 15,
"created_at": "2025-11-04T09:30:12Z"
}
Response (completed)
{
"id": "1f4a195e-026b-41ff-b367-c61089f5f367",
"status": "completed",
"page_count": 245,
"text": "Full extracted text from all 245 pages...",
"confidence": 0.96,
"processing_time_ms": 1091000,
"links": {
"text": "https://api.case.dev/ocr/v1/.../download/text",
"json": "https://api.case.dev/ocr/v1/.../download/json",
"pdf": "https://api.case.dev/ocr/v1/.../download/pdf"
}
}
Status values
| Status | Meaning |
|---|---|
pending | Queued, not started |
processing | OCR in progress |
completed | Done, results ready |
failed | Processing failed |
Polling example
casedev ocr:v1 retrieve --id $JOB_ID
async function waitForOCR(jobId: string) {
while (true) {
const job = await client.ocr.v1.retrieve(jobId);
if (job.status === 'completed') {
return job;
}
if (job.status === 'failed') {
throw new Error('OCR failed');
}
// Wait 5 seconds before checking again
await new Promise(r => setTimeout(r, 5000));
}
}
const result = await waitForOCR(jobId);
console.log(result.text);
import time
def wait_for_ocr(job_id: str):
while True:
job = client.ocr.v1.retrieve(job_id)
if job.status == 'completed':
return job
if job.status == 'failed':
raise Exception('OCR failed')
# Wait 5 seconds before checking again
time.sleep(5)
result = wait_for_ocr(job_id)
print(result.text)
result, _ := client.Ocr.V1.Get(ctx, jobID)
fmt.Println(result.Status)
Use webhooks for large documents. Set
callback_url when submitting to avoid polling.
