Image Analysis
Extract text from images with OCR, detect PII and unsafe content, and get a redacted copy of the image back.
Authentication
Image endpoints require a user JWT (Authorization: Bearer YOUR_JWT).
Analyze an Image
POST /image-analysis/analyze
Runs OCR on the image, then scans the extracted text for PII and safety issues. When redaction applies, returns a redacted image.
| Parameter | Type | Required | Description |
|---|---|---|---|
imageBase64 | string | Yes | Base64-encoded image (PNG, JPEG, …) |
ocr_language | string | No | OCR language hint (e.g. en, tr) |
confidenceThreshold | number | No | Minimum detection confidence, 0–1 |
cURL
curl -X POST https://api.cid222.ai/image-analysis/analyze \-H "Authorization: Bearer YOUR_JWT" \-H "Content-Type: application/json" \-d '{"imageBase64": "iVBORw0KGgoAAAANSUhEUg...","ocr_language": "en"}'
Response
Returns the overall action, the extracted text, PII and safety detections, and (when redacted) the redacted image.
{"action": "mask","extractedText": "Name: John Smith\nSSN: 123-45-6789","piiDetections": [{ "type": "PERSON_NAME", "value": "[PERSON_NAME]", "action": "mask", "confidence": 0.95 },{ "type": "SSN", "value": "[SSN]", "action": "mask", "confidence": 0.99 }],"safetyDetections": [],"wasRedacted": true,"redactedImageBase64": "iVBORw0KGgoAAAANSUhEUg...","processingTimeMs": 1320}
Redaction is optional
redactedImageBase64 is only present when a detection requires masking. extractedText and detections are always returned.
List OCR Engines
GET /image-analysis/ocr-engines
Returns the available OCR engines and their language support.
Compare OCR Engines
POST /image-analysis/compare-ocr
Runs the same image through multiple OCR engines so you can compare extraction quality.