services / doc-convert
textoperational · 142 ms
Document Conversion (pandoc)
Convert documents between formats with pandoc: Markdown, HTML, DOCX, ODT, EPUB, RST, LaTeX, RTF, plain text and PDF. Input as text (content), file (file_base64, max 10 MB: docx, odt, epub, rtf) or url. Input format is detected automatically or set with from. Text outputs come back as content, binary outputs (docx, odt, epub, pdf) as file_base64. Local file includes and remote images are not loaded. Params: to (required), content or file_base64 or url, from, title.
Run free trial ↗1 free call per day with the example input. Paid: $0.006 USDC, no limit.
Call it
Input
| Field | Type | Description |
|---|---|---|
| to * | markdown | html | docx | odt | epub | rst | latex | plain | rtf | pdf | |
| content | string | Document text (markdown, html, rst, latex, org, csv ...) |
| file_base64 | string | Binary document (docx, odt, epub, rtf), base64 |
| url | string | URL of the document (max 10 MB) |
| from | string | Input format, e.g. markdown, html, docx, rst, latex; detected if omitted |
| title | string |
Output
| Field | Type | Description |
|---|---|---|
| from | string | |
| to | string | |
| mime_type | string | |
| size_bytes | integer | |
| content | string | |
| source | string |
Example response (data)
{
"from": "markdown",
"to": "html",
"mime_type": "text/html",
"size_bytes": 3872,
"content": "<!DOCTYPE html>\n<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"\" xml:lang=\"\">\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"generator\" content=\"pandoc\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=yes\" />\n <title>document</title>\n <style>\n html…",
"source": "content"
}