Introduction

RunDocling is a managed API service that wraps the powerful Docling library, providing a simple REST API for converting PDFs and documents into structured Markdown or JSON.

With RunDocling, you can:

  • Convert complex PDFs with tables, images, and layouts
  • Extract structured data in Markdown or JSON format
  • Process scanned documents with OCR
  • Scale without managing infrastructure

Base URL: https://api.rundocling.com

Authentication

All API requests require authentication using an API key. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

You can generate API keys from your dashboard. Keep your API keys secure and never expose them in client-side code.

Quick Start

Convert your first PDF in seconds. We recommend the Async API for reliability.

Note: Typical processing time is 10-30 seconds. For large batches, always use the Async flow.

curl -X POST https://api.rundocling.com/v1/convert/file/async \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -F "[email protected]" \
  -F "to_formats=md"

Response:

{
  "task_id": "e076b2e2-f738-48a1-b61d-7e209d1e9a1b",
  "status": "pending",
  "total_pages": 5
}

POST/v1/convert/file

Upload a document for conversion and get the result immediately (Synchronous). Best for small documents.

Request Parameters

ParameterTypeRequiredDescription
filesFile | List[File]YesThe document(s) to convert
to_formatsString | List[String]NoDefault: md

Example Request

curl -X POST https://api.rundocling.com/v1/convert/file \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]" \
  -F "to_formats=md"

Response

{
  "document_result": {
    "status": "success",
    "pages": 5,
    "output": {
        "md": "# Extracted Title\n\nContent..."
    }
  }
}

POST/v1/convert/file/async

Upload a document and receive a Task ID (Asynchronous). Best for large documents or batch processing.

Request Parameters

ParameterTypeRequiredDescription
filesFile | List[File]YesThe document(s) to convert
to_formatsString | List[String]NoDefault: md

Example Request

curl -X POST https://api.rundocling.com/v1/convert/file/async \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]" \
  -F "to_formats=json_docling" \
  -F "do_ocr=true"

Response

{
  "task_id": "e076b2e2-f738-48a1-b61d-7e209d1e9a1b",
  "status": "pending",
  "total_pages": 5
}

POST/v1/convert/source

Convert a document from a URL or S3 bucket and get the result immediately (Synchronous).

Example Request

curl -X POST https://api.rundocling.com/v1/convert/source \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sources": [{"kind": "http", "url": "https://arxiv.org/pdf/2408.09869"}],
    "options": {"to_formats": ["md"]}
  }'

Response

{
  "document_result": {
    "status": "success",
    "pages": 5,
    "output": {
        "md": "# Extracted Title\n\nContent..."
    }
  }
}

POST/v1/convert/source/async

Convert a document from a URL or S3 bucket and receive a Task ID (Asynchronous).

Example Request

curl -X POST https://api.rundocling.com/v1/convert/source/async \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sources": [{"kind": "http", "url": "https://arxiv.org/pdf/2408.09869"}],
    "options": {"to_formats": ["md"]}
  }'

Response

{
  "task_id": "e076b2e2-f738-48a1-b61d-7e209d1e9a1b",
  "status": "pending",
  "total_pages": 5
}

Convert Parameters

All convert endpoints accept these optional parameters via form data (for file uploads) or JSON body (for source URLs).

Output Options

ParameterTypeDefaultDescription
to_formatsstring[]["md"]Output formats: md, json, html, text, doctags
image_export_modestringembeddedplaceholder, embedded, or referenced
include_imagesbooleantrueExtract images from document
images_scalenumber2.0Scale factor for extracted images

OCR Options

ParameterTypeDefaultDescription
do_ocrbooleantrueProcess bitmap content with OCR
force_ocrbooleanfalseReplace existing text with OCR output
ocr_enginestringeasyocrauto, easyocr (recommended), rapidocr, tesserocr, tesseract
ocr_langstring[]nullLanguage codes for OCR (e.g., ["en", "fr"])

Table Options

ParameterTypeDefaultDescription
do_table_structurebooleantrueExtract table structure
table_modestringaccuratefast or accurate

Processing Options

ParameterTypeDefaultDescription
pipelinestringstandardProcessing pipeline (standard or vlm)
pdf_backendstringdlparse_v4pypdfium2, dlparse_v1, dlparse_v2, dlparse_v4
page_range[int, int][1, max]Page range to convert [start, end]
document_timeoutnumber604800Timeout in seconds per document

Enrichment Options

ParameterTypeDefaultDescription
do_code_enrichmentbooleanfalsePerform code OCR enrichment
do_formula_enrichmentbooleanfalsePerform formula OCR, return LaTeX
do_picture_classificationbooleanfalseClassify pictures in documents
do_picture_descriptionbooleanfalseGenerate descriptions for pictures

Example with Parameters

curl -X POST https://api.rundocling.com/v1/convert/file \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]" \
  -F "to_formats=md" \
  -F "do_ocr=true" \
  -F "ocr_engine=easyocr" \
  -F "table_mode=accurate" \
  -F "do_table_structure=true"

POST/v1/upload

Upload a file for later conversion. Useful for large files that exceed HTTP body limits. Returns a file_id that can be used with /v1/convert/source endpoints.

curl -X POST https://api.rundocling.com/v1/upload \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]"

Response

{
  "file_id": "550e8400-e29b-41d4-a716-446655440000"
}

POST/v1/chunk/hierarchical/file

Hierarchical chunking of a document. Chunks are structured based on document hierarchy (headings, sections). Ideal for maintaining document structure in RAG applications.

curl -X POST https://api.rundocling.com/v1/chunk/hierarchical/file \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]"

POST/v1/chunk/hierarchical/file/async

Async version of hierarchical chunking. Returns a task_id for polling.

curl -X POST https://api.rundocling.com/v1/chunk/hierarchical/file/async \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]"

POST/v1/chunk/hybrid/file

Hybrid chunking combines hierarchical and token-based approaches. Balances structure preservation with chunk size control.

curl -X POST https://api.rundocling.com/v1/chunk/hybrid/file \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]"

POST/v1/chunk/hybrid/file/async

Async version of hybrid chunking. Returns a task_id for polling.

curl -X POST https://api.rundocling.com/v1/chunk/hybrid/file/async \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]"

POST/v1/chunk/hierarchical/source

Hierarchical chunking from a URL source.

curl -X POST https://api.rundocling.com/v1/chunk/hierarchical/source \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sources": [{"kind": "http", "url": "https://arxiv.org/pdf/2408.09869"}]
  }'

POST/v1/chunk/hierarchical/source/async

Async version of hierarchical chunking from URL source.

curl -X POST https://api.rundocling.com/v1/chunk/hierarchical/source/async \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sources": [{"kind": "http", "url": "https://arxiv.org/pdf/2408.09869"}]
  }'

POST/v1/chunk/hybrid/source

Hybrid chunking from a URL source.

curl -X POST https://api.rundocling.com/v1/chunk/hybrid/source \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sources": [{"kind": "http", "url": "https://arxiv.org/pdf/2408.09869"}]
  }'

POST/v1/chunk/hybrid/source/async

Async version of hybrid chunking from URL source.

curl -X POST https://api.rundocling.com/v1/chunk/hybrid/source/async \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sources": [{"kind": "http", "url": "https://arxiv.org/pdf/2408.09869"}]
  }'

GET/v1/status/poll/{task_id}

Check the status of a conversion job.

curl https://api.rundocling.com/v1/status/poll/e076b2e2-f738-48a1-b61d-7e209d1e9a1b \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "task_id": "e076b2e2-f738-48a1-b61d-7e209d1e9a1b",
  "task_type": "convert",
  "task_status": "in_progress",
  "task_position": null,
  "task_meta": null,
  "error": null,
  "received_at": "2025-12-08T18:07:52Z",
  "started_at": "2025-12-08T18:07:52Z",
  "completed_at": null,
  "duration_seconds": 7.19
}

Status values: pending, in_progress, completed, failed, not_found

GET/v1/result/{task_id}

Retrieve the converted document result.

curl https://api.rundocling.com/v1/result/e076b2e2-f738-48a1-b61d-7e209d1e9a1b \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "document_result": {
    "status": "success",
    "pages": 5,
    "output": {
        "md": "# Title\n\nContent...",
        "json_docling": {...}
    }
  }
}

Error Handling

The API uses standard HTTP status codes. Errors include a JSON body with details:

{
  "error": {
    "code": "invalid_file_type",
    "message": "Unsupported file type. Supported: PDF, DOCX, PPTX, XLSX, HTML, MD, PNG, JPG",
    "status": 400
  }
}

Common Error Codes

StatusCodeDescription
400invalid_file_typeUnsupported file format
401unauthorizedInvalid or missing API key
413file_too_largeFile exceeds size limit
429rate_limitedToo many requests
500processing_errorInternal processing failure

Rate Limits

Rate limits and quotas vary by your subscription plan:

PlanCurrencyLimits per RequestMonthly Quota
Free1 concurrent req20 pages, 20MB max50 pages
Pro20 concurrent reqs400 pages, 200MB max10,000 pages
EnterpriseUnlimitedCustomUnlimited