pandoc-server

Document conversion API — powered by Pandoc.

Note: This service only accepts POST requests. GET requests are handled by Caddy (this page).

Quick Examples

CSV → DOCX

curl -X POST https://pandoc.example.com \
  -u user:pass \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Name,Age\nAlice,30\nBob,25",
    "from": "csv",
    "to": "docx"
  }'

XLSX → Markdown (binary input)

B64=$(base64 -w0 data.xlsx)
curl -X POST https://pandoc.example.com \
  -u user:pass \
  -H "Content-Type: application/json" \
  -d "{\"text\":\"${B64}\",\"from\":\"xlsx\",\"to\":\"markdown\"}"

Markdown → PDF (via typst)

curl -X POST https://pandoc.example.com \
  -u user:pass \
  -H "Content-Type: application/json" \
  -H "Accept: application/octet-stream" \
  -d '{
    "text": "# Hello\n\nBody text.",
    "from": "markdown",
    "to": "typst",
    "standalone": true
  }' -o output.typst

# typst compile output.typst output.pdf

Batch conversions

curl -X POST https://pandoc.example.com/batch \
  -u user:pass \
  -H "Content-Type: application/json" \
  -d '[
    {"text":"Name,Age\nAlice,30","from":"csv","to":"docx"},
    {"text":"# Doc 2","from":"markdown","to":"typst"}
  ]'

Supported Formats

Primary: docx, xlsx, csv, pdf (via typst).

See the Pandoc manual for the full list of input and output formats.

API Reference

See pandoc.org/pandoc-server for the complete API specification.