COMPUTER VISION

Find document corners.Read passport MRZs.

Send a document photo to get four corner coordinates for cropping, or a passport photo to extract its machine-readable lines. Try your image in the browser, then connect the API.

Free during beta. API access requires an account.

EXAMPLE RESULT
Input image

Perspective correction

Sample identity card after perspective correction using detected corners
Corner coordinates · pixels
1[13.2, 701.6]
2[560.4, 579.3]
3[640.9, 912.9]
4[80.6, 1045.9]
Model details
Correction uses the returned corner coordinates.MIDV-2020 sample · CC BY-SA 2.5
DocAligner MRZScannerView available models

ACCESS

Choose how to get started

Versions, benchmarks, and licenses

Check the published releases, test conditions, and license terms before integrating.

AVAILABLE MODELS

Choose a model for your task

Document boundaries and MRZ text, available through the API or as open-source downloads.

DocAlignerpolygon

Detect document corners

Return corner coordinates for document cropping and perspective correction.

MRZScannermrz_texts

Locate and read the MRZ

Locate the machine-readable zone and return its coordinates and recognized text lines.

API

From an image to an API response

Send an image and use the returned coordinates or text in your application.

Preview an API request and result

Use a separate directory for each new job. This command creates an ID file and refuses to overwrite an existing one. Both examples read that file on every attempt. Keep the file, input and settings together.

Create the operation ID once
python3 -c 'import uuid; from pathlib import Path; f = Path("docsaid-operation-id.txt").open("x"); f.write(str(uuid.uuid4())); f.close()'

Request

DOCSAID_OPERATION_ID=$(cat docsaid-operation-id.txt)
DOCSAID_CURL_STATUS=0
curl --fail-with-body --connect-timeout 10 --max-time 30 'https://docsaid.org/api/v1/models/docaligner/predict' \
  --dump-header docsaid-response.headers --output docsaid-response.json \
  --write-out 'HTTP %{http_code}\n' \
  -H "Authorization: Bearer ${DOCSAID_API_KEY:?Set DOCSAID_API_KEY first}" \
  -H "Idempotency-Key: ${DOCSAID_OPERATION_ID:?Create an operation ID first}" \
  -F 'model_version=docaligner-1.1.1-fastvit-sa24-7f9f5a89' \
  -F 'do_center_crop=false' \
  -F '[email protected]' || DOCSAID_CURL_STATUS=$?
awk 'tolower($0) ~ /^(http|x-request-id:|x-error-code:|retry-after:)/' docsaid-response.headers
test "$DOCSAID_CURL_STATUS" -eq 0

Sample responseSelected fields

{
  "polygon": [
    [13.2,701.6],
    [560.4,579.3],
    [640.9,912.9],
    [80.6,1045.9]
  ]
}

Create an API key, set DOCSAID_API_KEY, and create the operation ID file before running. Python also requires requests. Download a compatible sample and follow the complete guide.

API documentation

Let’s talk about your integration.

Tell us what you’re building, your deployment environment, and the capabilities you need. We will review your request and reply by email.

Talk to us