- A Datalab account with an API key (new accounts include $5 in free credits)
- Python 3.10+ installed
- The Datalab SDK:
pip install datalab-python-sdk - Your
DATALAB_API_KEYenvironment variable set
Quick Start
How It Works
- Upload your form (PDF or image) with field data
- The API detects form fields and matches them to your data
- Fields are filled and the form is returned as PDF or PNG
Field Data Format
Provide field names with values and descriptions:Examples
Basic fields:"yes", "true", "1", "checked", "x" will check boxes.
Compound data:
Options
| Option | Type | Default | Description |
|---|---|---|---|
field_data | dict | Required | Field names mapped to values and descriptions |
context | str | None | Additional context to help match fields |
confidence_threshold | float | 0.5 | Minimum confidence for field matching (0.0-1.0) |
max_pages | int | None | Maximum pages to process |
page_range | str | None | Specific pages to process |
skip_cache | bool | False | Skip cached results |
Context Parameter
Usecontext to improve matching for specific form types:
Response
| Field | Type | Description |
|---|---|---|
status | str | processing, complete, or failed |
success | bool | Whether filling succeeded |
output_format | str | pdf or png |
output_base64 | str | Base64-encoded filled form |
fields_filled | list | Field names that were filled |
fields_not_found | list | Field names that couldn’t be matched |
page_count | int | Pages processed |
runtime | float | Processing time in seconds |
cost_breakdown | dict | Cost details |
Supported Form Types
- PDF with native AcroForm fields - Uses PDF form fields directly
- PDF with visual fields - Detects field locations and adds text overlays
- Images (PNG, JPG) - Detects field locations and draws text on image
Next Steps
SDK Form Filling
Complete SDK reference for form filling
File Upload
Upload forms for reuse across requests
Workflows
Chain form filling with other processing steps
Webhooks
Get notified when form filling completes