Detect document corners
Return corner coordinates for document cropping and perspective correction.
COMPUTER VISION
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.
Perspective correction

[13.2, 701.6][560.4, 579.3][640.9, 912.9][80.6, 1045.9]ACCESS
Use a sample or upload your own image. No account needed.
Create a key and run a Python or curl example.
Compare versions and download free Community weights.
Check the published releases, test conditions, and license terms before integrating.
Research articles explain a wider range of methods. The available products are DocAligner and MRZScanner. Blog
AVAILABLE MODELS
Document boundaries and MRZ text, available through the API or as open-source downloads.
Return corner coordinates for document cropping and perspective correction.
Locate the machine-readable zone and return its coordinates and recognized text lines.
API
Send an image and use the returned coordinates or text in your application.
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.
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 0Sample 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 documentationTell us what you’re building, your deployment environment, and the capabilities you need. We will review your request and reply by email.