.actor/README.md
This Actor (specification v1) wraps the Docling project to provide serverless document processing in the cloud. It can process complex documents (PDF, DOCX, images) and convert them into structured formats (Markdown, JSON, HTML, Text, or DocTags) with optional OCR support.
Actors are serverless microservices running on the Apify Platform. They are based on the Actor SDK and can be found in the Apify Store. Learn more about Actors in the Apify Whitepaper.
md, json, html, text, or doctags).OUTPUT.curl --request POST \
--url "https://api.apify.com/v2/acts/vancura~docling/run" \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--data '{
"options": {
"to_formats": ["md", "json", "html", "text", "doctags"]
},
"http_sources": [
{"url": "https://vancura.dev/assets/actor-test/facial-hairstyles-and-filtering-facepiece-respirators.pdf"},
{"url": "https://arxiv.org/pdf/2408.09869"}
]
}'
apify call vancura/docling --input='{
"options": {
"to_formats": ["md", "json", "html", "text", "doctags"]
},
"http_sources": [
{"url": "https://vancura.dev/assets/actor-test/facial-hairstyles-and-filtering-facepiece-respirators.pdf"},
{"url": "https://arxiv.org/pdf/2408.09869"}
]
}'
The Actor accepts a JSON schema matching the file .actor/input_schema.json. Below is a summary of the fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
http_sources | object | Yes | None | https://github.com/DS4SD/docling-serve?tab=readme-ov-file#url-endpoint |
options | object | No | None | https://github.com/DS4SD/docling-serve?tab=readme-ov-file#common-parameters |
{
"options": {
"to_formats": ["md", "json", "html", "text", "doctags"]
},
"http_sources": [
{"url": "https://vancura.dev/assets/actor-test/facial-hairstyles-and-filtering-facepiece-respirators.pdf"},
{"url": "https://arxiv.org/pdf/2408.09869"}
]
}
The Actor provides three types of outputs:
Processed Documents in a ZIP - The Actor will provide the direct URL to your result in the run log, looking like:
You can find your results at: 'https://api.apify.com/v2/key-value-stores/[YOUR_STORE_ID]/records/OUTPUT'
Processing Log - Available in the key-value store as DOCLING_LOG
Dataset Record - Contains processing metadata with:
You can access the results in several ways:
https://api.apify.com/v2/key-value-stores/[STORE_ID]/records/OUTPUT
apify key-value-stores get-value OUTPUT
# Document Title
## Section 1
Content of section 1...
## Section 2
Content of section 2...
{
"title": "Document Title",
"sections": [
{
"level": 1,
"title": "Section 1",
"content": "Content of section 1..."
}
]
}
<h1>Document Title</h1>
<h2>Section 1</h2>
<p>Content of section 1...</p>
DOCLING_LOG)The Actor maintains detailed processing logs including:
Access logs via:
apify key-value-stores get-record DOCLING_LOG
Common issues and solutions:
Document URL Not Accessible
OCR Processing Fails
API Response Issues
Output Format Issues
DOCLING_LOG for specific errorsThe Actor implements comprehensive error handling:
DOCLING_LOGIf you wish to develop or modify this Actor locally:
Clone the repository.
Ensure Docker is installed.
The Actor files are located in the .actor directory:
Dockerfile - Defines the container environmentactor.json - Actor configuration and metadataactor.sh - Main execution script that starts the docling-serve API and orchestrates document processinginput_schema.json - Input parameter definitionsdataset_schema.json - Dataset output format definitionCHANGELOG.md - Change log documenting all notable changesREADME.md - This documentationRun the Actor locally using:
apify run
.actor/
├── Dockerfile # Container definition
├── actor.json # Actor metadata
├── actor.sh # Execution script (also starts docling-serve API)
├── input_schema.json # Input parameters
├── dataset_schema.json # Dataset output format definition
├── docling_processor.py # Python script for API communication
├── CHANGELOG.md # Version history and changes
└── README.md # This documentation
This Actor uses a lightweight architecture based on the official quay.io/ds4sd/docling-serve-cpu Docker image:
quay.io/ds4sd/docling-serve-cpu:latest (~4GB){
"options": {
"to_formats": ["md"],
"do_ocr": true
},
"http_sources": [{"url": "https://example.com/document.pdf"}]
}
/v1alpha/convert/source endpointThis wrapper project is under the MIT License, matching the original Docling license. See LICENSE for details.