Process Document
The process endpoint is the core of Cardinal OCR. Upload documents and receive extracted text, structured data, images, and metadata in your preferred format.
Process Endpoint
https://api.trycardinal.ai/v1/process
Upload a document file and receive processed OCR results with text extraction, structured data, and optional image/metadata extraction.
multipart/form-data
when uploading files to the process endpoint.Parameters
file
The document file to process. Supports PDF, images, and other document formats.
output_format
Output format for the processed document. Default: json
extract_images
Extract images, charts, and visual elements from the document. Default: false
include_bounding_boxes
Include precise coordinate data for all text elements. Default: false
extract_metadata
Extract barcodes, QR codes, and other metadata. Default: false
extract_signature
Extract detected signatures from the document. Default: false
Supported File Formats
Supported: PDF (.pdf)
Coming Soon: Excel sheets (.xlsx, .xls) support is currently in development.
Image Formats: JPEG (.jpg, .jpeg), PNG (.png), TIFF (.tif, .tiff)
Response Format
All successful responses return a JSON object with the processed document data, regardless of the chosen output format.
{ "status": "success", "document_id": "doc_abc123", "content": { "text": "Extracted text content...", "structured_data": { // Structured data based on document type } }, "metadata": { "page_count": 3, "processing_time_ms": 2500, }, "images": [ // Array of extracted images (if extract_images=true) ], "bounding_boxes": [ // Array of coordinate data (if include_bounding_boxes=true) ], "barcodes": [ // Array of detected barcodes/QR codes (if extract_metadata=true) ], "signatures": [ // Array of detected signatures (if extract_signature=true) ] }
{ "error": { "code": "invalid_file_format", "message": "Unsupported file format", "details": { "supported_formats": ["pdf", "png", "jpg"] } } }
- • Simple documents: 1-30 seconds (depending on the document size)
- • Complex documents: 1-2 minutes (depending on the document size)
- • Large files (50MB): Couple of minutes
Examples
curl -X POST https://api.trycardinal.ai/v1/process \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@invoice.pdf" \ -F "output_format=json"
extract_images=true
and extract_metadata=true
and extract_signature=true
for comprehensive data extraction.