Document conversion API — powered by Pandoc.
POST requests. GET requests are handled by Caddy (this page).
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"
}'
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\"}"
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
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"}
]'
Primary: docx, xlsx, csv, pdf (via typst).
See the Pandoc manual for the full list of input and output formats.
See pandoc.org/pandoc-server for the complete API specification.