Introduction
The DataParse API provides a single endpoint for extracting structured data from documents and images using AI-powered parsing.
Base URL
Section titled “Base URL”https://api.datapar.seAuthentication
Section titled “Authentication”All API requests require authentication using an API key in the x-api-key header.
x-api-key: YOUR_API_KEY Authentication Learn how to authenticate your API requests with API keys
Supported File Types
Section titled “Supported File Types”- Images: JPEG, PNG, WebP, GIF
- Documents: PDF
Request Format
Section titled “Request Format”Send a JSON object with a schema defining the data structure you want to extract and the files to process:
{ "schema": { "type": "object", "properties": { "field_name": { "type": "string", "description": "Description of what this field represents" } } }, "contents": [ { "filename": "document.pdf", "mimeType": "application/pdf", "data": "base64_encoded_data" } ]} Request Format Detailed guide to request structure, schemas, and file encoding
Response Format
Section titled “Response Format”Returns extracted data as JSON matching your provided schema:
{ "field_name": "extracted_value"} Response Format Understand response structure, status codes, and error handling
Example
Section titled “Example”curl -X POST https://api.datapar.se/v1/ \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "schema": { "type": "object", "properties": { "vendor_name": { "type": "string", "description": "Name of the company or person who issued the invoice" }, "total_amount": { "type": "number", "description": "Final amount due including all taxes and fees" } } }, "contents": [{ "mimeType": "application/pdf", "data": "base64_encoded_file_data" }] }'