PNG & JPG Parser

Image Processing Guide

Document Parser API supports text extraction from various image formats using OCR technology.

Endpoint

POST /documents/parse

Supported Image Types

  1. JPEG/JPG

{
    "url": "string",
    "type": "jpg",          // or "jpeg"
    "output": "plain|markdown"
}
  1. PNG

{
    "url": "string",
    "type": "png",
    "output": "plain|markdown"
}
  1. TIFF/TIF

{
    "url": "string",
    "type": "tiff",         // or "tif"
    "output": "plain|markdown"
}
  1. HEIC

{
    "url": "string",
    "type": "heic",
    "output": "plain|markdown"
}

Image Processing Features

  • Text extraction using OCR

  • Multi-page support for TIFF

  • Various image resolutions supported

  • Color, grayscale, and black/white images

  • Maximum file size: 50MB

Example Request

curl --location 'https://api.yetanotherapi.com/documents/parse' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "url": "https://example.com/scan.jpg",
    "type": "jpg",
    "output": "markdown"
}'

Response Format

For single-page images:

{
    "requestId": "string",
    "status": "COMPLETED",
    "data": "Extracted text content"
}

For multi-page TIFF:

{
    "requestId": "string",
    "status": "COMPLETED",
    "data": "Page 1 content\n\n=== Page Break ===\n\nPage 2 content"
}

Image-Specific Limitations

  1. Image quality affects OCR accuracy

  2. Minimum resolution required: 300 DPI

  3. Handwritten text may not be accurately recognized

  4. Complex backgrounds can affect accuracy

  5. Text must be properly oriented

Last updated