itsOCR / API Documentation

API Documentation

Use the itsOCR API to extract text from images programmatically.

Authentication

All API requests require authentication using a Bearer token. You can create API tokens in your Settings.

Authorization: Bearer itsocr_your_token_here

Base URL

https://itsocr.com/api/v1

OCR Endpoint

POST /ocr

Extract text from an image. Supports JPEG, PNG, GIF, WebP, and other common image formats.

Request

Content-Type: multipart/form-data

FieldTypeRequiredDescription
fileFileYesThe image file to process
promptStringNoCustom prompt for OCR (overrides default)

Response

{
  "success": true,
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "text": "Extracted text from the image...",
  "processingTimeMs": 1234,
  "fileName": "document.jpg",
  "fileSize": 102400,
  "mimeType": "image/jpeg"
}

Example

cURL

curl -X POST https://itsocr.com/api/v1/ocr \
  -H "Authorization: Bearer itsocr_your_token_here" \
  -F "file=@document.jpg"

JavaScript / Node.js

import fs from 'fs';

// Read file and create a Blob
const fileBuffer = fs.readFileSync('document.jpg');
const blob = new Blob([fileBuffer], { type: 'image/jpeg' });

const formData = new FormData();
formData.append('file', blob, 'document.jpg');

const response = await fetch('https://itsocr.com/api/v1/ocr', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer itsocr_your_token_here'
  },
  body: formData
});

const result = await response.json();
console.log(result.text);

Python

import requests

with open('document.jpg', 'rb') as f:
    response = requests.post(
        'https://itsocr.com/api/v1/ocr',
        headers={'Authorization': 'Bearer itsocr_your_token_here'},
        files={'file': f}
    )

result = response.json()
print(result['text'])

Error Responses

Status CodeDescription
400Bad request (missing file, invalid format, etc.)
401Invalid or missing API token
429Rate limit exceeded (monthly quota reached)
500Server error
{
  "success": false,
  "error": "Error message describing what went wrong"
}

Rate Limits

API usage is subject to your plan's monthly limits. Check your current usage in the Dashboard.

PlanImages/MonthMax File Size
Free105 MB
Pro50020 MB
EnterpriseUnlimited50 MB

Need Help?

If you have questions or need assistance, please contact us at support@itsocr.com.