Use cases

What to use DocumenTo.MD for in your projects and automations

RAG and LLM pipelines

Language models (GPT, Claude, Llama) cannot read PDFs or DOCX directly. DocumenTo.MD normalizes them to clean Markdown before you feed them into your chunking and embeddings pipeline.

  • Preserves headings, lists and tables in structured format
  • Clean output without junk metadata
  • Synchronous API for streaming processing
  • Compatible with LangChain, LlamaIndex and any vector DB
rag_pipeline.py
import requests

def document_to_markdown(file_path, api_key):
    with open(file_path, "rb") as f:
        resp = requests.post(
            "https://documento.md/v1/convert",
            headers={"Authorization": f"Bearer {api_key}"},
            files={"file": f},
            data={"wait": "true"},
        )
    return resp.json()["markdown"]

# 1. Convertir PDF a Markdown
markdown = document_to_markdown("informe.pdf", api_key)

# 2. Chunking + embeddings (LangChain, LlamaIndex...)
# 3. Almacenar en tu vector DB (Pinecone, Weaviate, Qdrant...)
# 4. Retrieval + generation con tu LLM
migrar_docs.sh
# Convertir todos los .docx de una carpeta
for file in *.docx; do
  curl -X POST "https://documento.md/v1/convert" \
    -H "Authorization: Bearer $DTMD_KEY" \
    -F "file=@$file" \
    -F "wait=true" \
    | jq -r '.markdown' \
    > "${file%.docx}.md"
done

# Commit a git para tu wiki/docs
git add *.md && git commit -m "migración docx → md"

Legacy documentation migration

You have hundreds of documents in Word, PDFs or internal wikis. Convert them to Markdown at once and move them to a git repo, a modern CMS or a static site generator (Astro, Hugo, MkDocs).

  • Batch conversion with a one-line script
  • Preserves hierarchical structure (H1-H6)
  • GitHub-flavored Markdown compatible
  • Versioned in git from now on

Search indexing

Binary files (PDF, PPTX, XLSX) are invisible to Elasticsearch, Meilisearch or Algolia. Convert them to indexable text and make your documents appear in search results.

  • Pure text extraction without binary format
  • Compatible with any search engine
  • Parallel processing of document queues
index_pipeline.py
from elasticsearch import Elasticsearch
import requests

es = Elasticsearch()

def index_document(file_path, doc_id, api_key):
    with open(file_path, "rb") as f:
        resp = requests.post(
            "https://documento.md/v1/convert",
            headers={"Authorization": f"Bearer {api_key}"},
            files={"file": f},
        )
    markdown = resp.json()["markdown"]
    es.index(index="docs", id=doc_id, document={
        "content": markdown,
        "filename": file_path,
    })
Step-by-step guide

Automation with n8n

Connect DocumenTo.MD a cualquier herramienta usando n8n. Convierte archivos automáticamente cuando lleguen por email, se suban a Google Drive o se envíen por webhook.

1

Create your API Key

Register at documento.md, go to Dashboard → API Keys and create a new key. Copy the full value (dtmd_live_...).

2

Create a workflow in n8n

In n8n, create a new workflow. Start with a trigger depending on your file source:

Google Drive
"On file added"
Email (IMAP)
"On email with attachment"
Webhook
"On HTTP request"
3

Add an HTTP Request node

Configure the node with these exact values:

Method POST
URL https://documento.md/v1/convert
Authentication Header Auth
Header Name Authorization
Header Value Bearer dtmd_live_tu_api_key
Body Content-Type multipart/form-data
Field: file $json.binary.data
Field: wait true
4

Use the output Markdown

The HTTP Request node returns JSON. The field markdown contiene el resultado. Conéctalo a cualquier nodo de destino:

Notion
Create page
Slack
Send message
Google Drive
Save .md

Full workflow (copy and import into n8n)

{
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "url": "https://documento.md/v1/convert",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            { "name": "Authorization", "value": "Bearer dtmd_live_TU_API_KEY" }
          ]
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            { "parameterType": "organizationBinaryData", "inputDataFieldName": "data", "name": "file" },
            { "name": "wait", "value": "true" }
          ]
        }
      },
      "name": "Convertir a Markdown",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [460, 300]
    }
  ],
  "connections": {}
}

Change dtmd_live_TU_API_KEY with your real API Key. Connect a trigger node before and a destination node after.

batch_convert.py
import requests
from pathlib import Path
from concurrent.futures import ThreadPoolExecutor

API_KEY = "dtmd_live_tu_key"
API_URL = "https://documento.md/v1/convert"

def convert_one(file_path):
    with open(file_path, "rb") as f:
        resp = requests.post(API_URL,
            headers={"Authorization": f"Bearer {API_KEY}"},
            files={"file": f},
            data={"wait": "true"},
        )
    md = resp.json()["markdown"]
    Path(file_path).with_suffix(".md").write_text(md)
    print(f"✓ {file_path}")

files = list(Path(".").glob("*.pdf"))
with ThreadPoolExecutor(max_workers=5) as pool:
    pool.map(convert_one, files)

Batch processing

Got a folder full of documents? Convert them all in parallel with a simple script. The endpoint /v1/convert/batch acepta hasta 10 archivos por petición, o usa threads para más.

  • Up to 10 files per request with /v1/convert/batch
  • Parallel conversion with ThreadPoolExecutor
  • Individual failures don't abort the batch

Ready to automate?

Create your account, generate an API Key and start converting in under a minute.