# Docling Document Converter (PDF to Markdown for AI) (`texxupport/docling-document-converter`) Actor

- **URL**: https://apify.com/texxupport/docling-document-converter.md
- **Developed by:** [Kye Williams](https://apify.com/texxupport) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $200.00 / 1,000 document converteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Docling Document Converter (PDF to Markdown for AI)

Turn PDFs, Word documents, slide decks, spreadsheets, web pages and scanned images into clean **Markdown**, **JSON**, **HTML** or **plain text** that AI models and RAG pipelines can use, with headings, reading order, lists and tables kept intact. Built on [Docling](https://github.com/docling-project/docling), the open-source document toolkit from IBM Research (MIT license).

### Why Docling

Plain PDF-to-text tools lose the structure. Columns run together, tables turn into word soup and headers repeat on every page. Docling uses layout and table-structure models to read a page the way a person does. It finds headings, paragraphs, lists, tables, figures, captions and formulas, puts them in reading order, and drops page furniture such as running headers.

### What you get

For each document:

- **A dataset row** with the title, page count, table count and status, plus the first 20,000 characters of Markdown so you can read it right in the table.
- **Files in the key-value store**, linked from the row: the full Markdown, Docling JSON (the complete structured document), HTML, plain text or DocTags.
- **Tables as rows and columns**, ready for a spreadsheet.
- **Chunks for RAG (optional).** These split the document by its structure, or by structure and token size for embedding models. Each chunk carries its section headings and page numbers.

### Supported files

PDF (digital and scanned), DOCX, PPTX, XLSX, HTML, Markdown, CSV, AsciiDoc and images (PNG, JPG, TIFF, BMP, WEBP). Scanned pages and images are read with OCR (EasyOCR, many languages).

### Tips

- **Speed.** Docling runs its layout, table and OCR models on the CPU, so it is much slower than plain text extraction. In our tests the first two pages of a research paper converted in under a minute including start-up, and a 9-page paper with OCR and table structure switched on took about 7 minutes on 4 GB of memory. Turn off OCR when your PDFs already contain text, and give big batches more memory.
- **Large files.** Limit pages with **Maximum pages per document**, or raise the per-document time limit.
- **Failed documents** are listed in the dataset with the reason, and are not charged.

### Pricing

Pay per event: one charge per converted document. Platform usage depends on the memory you choose and how long conversion takes.

### Open source

This Actor packages [Docling](https://github.com/docling-project/docling) (MIT license, © IBM Corporation and Docling contributors). It is not affiliated with or endorsed by IBM or the Docling project.

# Actor input Schema

## `documentUrls` (type: `array`):

Direct links to PDF, DOCX, PPTX, XLSX, HTML, Markdown, CSV or image files (PNG, JPG, TIFF).

## `outputFormats` (type: `array`):

Each format is saved as a file in the key-value store, linked from the result.

## `includeTextInDataset` (type: `boolean`):

The first 20,000 characters, so you can read results in the table. The full text is always in the linked file.

## `chunking` (type: `string`):

Split each document into chunks ready for AI search (RAG): none, hierarchical (by headings and sections), or hybrid (also limited by token count).

## `maxChunkTokens` (type: `integer`):

Largest size of each chunk, in tokens. Used when the chunking mode is hybrid.

## `ocr` (type: `boolean`):

Read text from scanned pages and images using OCR. Turn off for documents that already contain real text, to run faster.

## `ocrLanguages` (type: `array`):

EasyOCR codes, for example en, de, fr, es.

## `tableStructure` (type: `boolean`):

Detects rows and columns, and adds each table to the result as rows.

## `extractImages` (type: `boolean`):

Embeds figures in the JSON and HTML output. Makes files larger.

## `maxPages` (type: `integer`):

Only convert the first this-many pages of each document. Leave empty to convert all pages.

## `maxFileSizeMb` (type: `integer`):

Skip any file larger than this many megabytes.

## `timeoutSecondsPerDocument` (type: `integer`):

Give up on a document if converting it takes longer than this many seconds.

## Actor input object example

```json
{
  "documentUrls": [
    "https://arxiv.org/pdf/2408.09869"
  ],
  "outputFormats": [
    "markdown"
  ],
  "includeTextInDataset": true,
  "chunking": "none",
  "maxChunkTokens": 512,
  "ocr": true,
  "ocrLanguages": [
    "en"
  ],
  "tableStructure": true,
  "extractImages": false,
  "maxPages": 2,
  "maxFileSizeMb": 100,
  "timeoutSecondsPerDocument": 600
}
```

# Actor output Schema

## `results` (type: `string`):

One row per document, with links to the Markdown, JSON and chunk files.

## `files` (type: `string`):

Every converted file in the run's key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "documentUrls": [
        "https://arxiv.org/pdf/2408.09869"
    ],
    "maxPages": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("texxupport/docling-document-converter").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "documentUrls": ["https://arxiv.org/pdf/2408.09869"],
    "maxPages": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("texxupport/docling-document-converter").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "documentUrls": [
    "https://arxiv.org/pdf/2408.09869"
  ],
  "maxPages": 2
}' |
apify call texxupport/docling-document-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,texxupport/docling-document-converter"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/s2Mp4Ohg5bZ1lC5zH/builds/t6nWpmGGNda79dode/openapi.json
