Overview
The form filling API lets you programmatically fill forms in PDFs and images. It works with both:- Native PDF forms - Forms with actual form fields
- Image-based forms - Scanned forms or images with visual form layouts
Basic Usage
Form Filling Options
Field Data Format
Each field infield_data is a dictionary with:
description helps the API match your field key to the actual form field, especially when field names in the PDF don’t match your data structure.
Example with Multiple Field Types
Using Context
Thecontext parameter provides additional information to improve field matching:
Form Filling Result
Result Fields
Billing
Form filling runs an agent over your document, so its cost follows the work the document needs rather than its page count. Almost every document bills the form fill rate on the pricing page and nothing more; an unusually demanding one bills what the work actually cost instead. The rate is a floor, not something a surcharge adds to, so you’re never charged twice for the same run.cost_breakdown on the result shows the charge.
Saving the Filled Form
Filling Image Forms
The API also works with image-based forms (PNG, JPG, etc.):From URL
Fill a form from a URL:Async Usage
Handling Unmatched Fields
Check which fields couldn’t be matched:Example: Tax Form
Next Steps
Form Filling Recipe
Detailed guide on form filling with field matching and templates.
File Management
Upload, list, and manage files in Datalab storage.
Conversion SDK
Convert documents to Markdown, HTML, JSON, or chunks.
Pipelines
Chain processors into versioned, reusable pipelines.