Skip to main content

Quickstart

Extract structured data from a document in under 2 minutes.

Prerequisites​

Step 1: Extract Data from a Document​

curl -X POST https://developer-api.qomplement.com/v1/extract \
-H "Authorization: Bearer sd_YOUR_API_KEY" \
-F "file=@invoice.pdf"

Step 2: Read the Response​

For small documents (≤5 pages), you get the result immediately:

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"result": {
"model": "qomplement-OCR-v1",
"document_type": "invoice",
"language": "en",
"confidence": 95,
"fields": {
"invoice_number": "INV-2025-001234",
"total_amount": "1500.50",
"invoice_date": "2025-02-26",
"vendor_name": "ABC Corp"
},
"tables": [],
"pages_processed": 1,
"processing_time_ms": 3456
}
}

The fields object contains all extracted key-value pairs as a flat dictionary. Access values directly:

fields = result["result"]["fields"]
print(f"Invoice: {fields['invoice_number']}")
print(f"Total: ${fields['total_amount']}")

Step 3: Extract with a Schema (Optional)​

Tell the API exactly which fields you want for higher accuracy:

curl -X POST https://developer-api.qomplement.com/v1/extract \
-H "Authorization: Bearer sd_YOUR_API_KEY" \
-F "file=@invoice.pdf" \
-F 'schema=[{"name":"invoice_number","type":"string"},{"name":"total","type":"number"},{"name":"date","type":"date"}]'

Step 4: Fill a PDF Form​

Upload a source document and a target PDF form:

curl -X POST https://developer-api.qomplement.com/v1/fill/pdf \
-H "Authorization: Bearer sd_YOUR_API_KEY" \
-F "source_files=@invoice.pdf" \
-F "target_pdf=@form_template.pdf"

This returns a job ID (always async):

{
"id": "job-uuid-here",
"status": "processing",
"poll_url": "/v1/jobs/job-uuid-here"
}

Step 5: Fill an Excel Template​

Upload a source document and an Excel template:

curl -X POST https://developer-api.qomplement.com/v1/fill/excel \
-H "Authorization: Bearer sd_YOUR_API_KEY" \
-F "source_files=@invoice.pdf" \
-F "target_excel=@report_template.xlsx" \
-F "fill_mode=smart"

Step 6: Poll for Results​

curl https://developer-api.qomplement.com/v1/jobs/job-uuid-here \
-H "Authorization: Bearer sd_YOUR_API_KEY"

When complete, download the filled file:

{
"id": "job-uuid-here",
"status": "completed",
"result": {
"download_url": "/v1/jobs/job-uuid-here/download",
"fields_filled": 8,
"fields_total": 12
}
}

What's Next​

  • Extract Endpoint — Full parameter reference with Python, JavaScript, and Go examples
  • Fill PDF — PDF form filling details and examples
  • Fill Excel — Excel template filling with fill modes
  • Jobs — Async job management
  • Code Examples — Complete workflows including AI integration