Process multiple files in parallel with a single request
POST /api/v1/batchPOSTThe batch conversion endpoint allows you to process multiple documents simultaneously, significantly reducing processing time and API calls for bulk operations. Perfect for applications that need to convert large document sets efficiently.
All files are processed simultaneously for maximum speed and efficiency.
Combine Base64 files and URLs in the same batch request.
Individual file failures don't stop the processing of other files.
{
"files": [
{
"id": "file1",
"source_type": "file",
"file": "JVBERi0xLjQKMSAwIG9iago...",
"filename": "document1.pdf"
},
{
"id": "file2",
"source_type": "url",
"url": "https://example.com/document2.docx",
"filename": "document2.docx"
},
{
"id": "file3",
"source_type": "file",
"file": "UEsDBBQAAAAIAMF...",
"filename": "presentation.pptx"
}
],
"options": {
"ocr_type": "advanced",
"parallel_processing": true
}
}curl -X POST https://api.markdownconverters.com/api/v1/batch \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"files": [
{
"id": "doc1",
"source_type": "file",
"file": "base64_encoded_content",
"filename": "document.pdf"
},
{
"id": "doc2",
"source_type": "url",
"url": "https://example.com/file.docx",
"filename": "file.docx"
}
],
}'| Parameter | Type | Required | Description |
|---|---|---|---|
| files | array | Yes | Array of file objects to convert |
| options | object | No | Batch processing options |
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Unique identifier for this file in the batch |
| source_type | string | Yes | "file" or "url" |
| filename | string | Yes | Original filename for identification |
| file | string | Conditional | Base64-encoded content (if source_type is "file") |
| url | string | Conditional | URL to downloadable file (if source_type is "url") |
{
"batch_id": "batch_1234567890abcdef",
"status": "completed",
"total_files": 3,
"completed_files": 3,
"failed_files": 0,
"results": [
{
"id": "file1",
"job_id": "conv_1111111111111111",
"status": "completed",
"filename": "document1.pdf",
"markdown_content": "# Document 1\n\nContent from the first PDF document...",
"metadata": {
"file_size": 2048,
"pages": 3,
"processing_time_ms": 1850
},
"sas_url": "https://storage.azure.com/converted/conv_1111111111111111.md?sp=r&st=..."
},
{
"id": "file2",
"job_id": "conv_2222222222222222",
"status": "completed",
"filename": "document2.docx",
"markdown_content": "# Document 2\n\nContent from the Word document...",
"metadata": {
"file_size": 1536,
"pages": 2,
"processing_time_ms": 1200
},
"sas_url": "https://storage.azure.com/converted/conv_2222222222222222.md?sp=r&st=..."
},
{
"id": "file3",
"job_id": "conv_3333333333333333",
"status": "completed",
"filename": "presentation.pptx",
"markdown_content": "# Presentation Title\n\n## Slide 1\n\nContent from slide 1...",
"metadata": {
"file_size": 4096,
"pages": 10,
"processing_time_ms": 2400
},
"sas_url": "https://storage.azure.com/converted/conv_3333333333333333.md?sp=r&st=..."
}
],
"created_at": "2024-01-01T12:00:00Z",
"completed_at": "2024-01-01T12:00:05Z",
"total_processing_time_ms": 5450
}{
"batch_id": "batch_1234567890abcdef",
"status": "partial_failure",
"total_files": 3,
"completed_files": 2,
"failed_files": 1,
"results": [
{
"id": "file1",
"job_id": "conv_1111111111111111",
"status": "completed",
"filename": "document1.pdf",
"markdown_content": "# Document 1\n\nContent...",
"metadata": { "file_size": 2048, "pages": 3 },
"sas_url": "https://storage.azure.com/..."
},
{
"id": "file2",
"status": "failed",
"filename": "corrupted.pdf",
"error": {
"code": "CORRUPTED_FILE",
"message": "The file appears to be corrupted and cannot be processed",
"suggestion": "Please verify the file integrity and try again"
}
},
{
"id": "file3",
"job_id": "conv_3333333333333333",
"status": "completed",
"filename": "presentation.pptx",
"markdown_content": "# Presentation\n\nContent...",
"metadata": { "file_size": 4096, "pages": 10 },
"sas_url": "https://storage.azure.com/..."
}
]
}