API Documentation

The ManifestLens API lets you extract structured data from freight and logistics documents using a simple REST endpoint. You can get plain text or structured JSON output.

Base URL

https://api.manifestlens.com/v1

Authentication

Authenticate all API requests by including your API key in the Authorization header as a Bearer token.

curl https://api.manifestlens.com/v1/ocr \
  -H "Authorization: Bearer ml_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Keep your API key secret. Never expose it in client-side code or public repositories. Rotate keys immediately if they're compromised.

You can create and manage API keys from your dashboard.

OCR Endpoint

POST/api/ocr

Submit a document file and receive extracted text in your desired format.

Request

Send a multipart/form-data request with the following fields:

FieldTypeRequiredDescription
fileFileRequiredThe document to process (max 20MB)
formatstringOptionalOutput format: text (default) or json

Supported file types

PDFJPEGPNGWebPTIFFHEICHEIF

Example — plain text

curl -X POST https://api.manifestlens.com/v1/ocr \
  -H "Authorization: Bearer ml_live_xxxxxxxxxxxx" \
  -F "file=@invoice.pdf"

Example — JSON output

curl -X POST https://api.manifestlens.com/v1/ocr \
  -H "Authorization: Bearer ml_live_xxxxxxxxxxxx" \
  -F "file=@receipt.jpg" \
  -F "format=json"

Example — JavaScript/TypeScript

const form = new FormData()
form.append('file', fileBlob, 'document.pdf')
form.append('format', 'json')

const response = await fetch('https://api.manifestlens.com/v1/ocr', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer ' + process.env.OMNIOCR_API_KEY,
  },
  body: form,
})

const result = await response.json()
console.log(result.data.full_text)

Response format

All successful responses return HTTP 200 with a JSON body.

Text format response

{
  "success": true,
  "data": {
    "text": "INVOICE\nDate: 2024-01-15\nAmount: $1,234.00\n..."
  },
  "meta": {
    "fileName": "invoice.pdf",
    "fileSize": 142308,
    "mimeType": "application/pdf",
    "format": "text",
    "processingTimeMs": 847
  }
}

JSON format response

{
  "success": true,
  "data": {
    "full_text": "INVOICE\nDate: 2024-01-15\n...",
    "blocks": [
      { "type": "header", "content": "INVOICE" },
      { "type": "field",  "content": "Date: 2024-01-15" },
      { "type": "field",  "content": "Amount: $1,234.00" }
    ],
    "metadata": {
      "title": "Invoice",
      "date": "2024-01-15",
      "total": "$1,234.00"
    }
  },
  "meta": {
    "fileName": "invoice.pdf",
    "fileSize": 142308,
    "mimeType": "application/pdf",
    "format": "json",
    "processingTimeMs": 1243
  }
}

Error codes

Errors return a non-2xx HTTP status code with a JSON error body:

{
  "error": "Invalid or revoked API key"
}
StatusMeaning
400Bad request — missing or invalid parameters
401Unauthorized — missing or invalid API key
403Forbidden — subscription inactive or expired
413Payload too large — file exceeds 20MB limit
415Unsupported media type — file format not supported
429Too many requests — rate limit exceeded
500Server error — OCR processing failed