Send any HTML payload to our endpoint and receive a temporary link to download a native Word (.docx) file β converted by Pandoc, with real headings, lists, tables and formatting.
Free β 20/week, or $20/mo unlimited βConverts HTML to a .docx file and returns a temporary download link (valid for 1 hour, single-use).
Streams the generated .docx file. Link expires after 1 hour or upon first download.
| Header | Value |
|---|---|
Content-Type | application/json |
X-API-Key | Your API key (required) |
| Field | Type | Description |
|---|---|---|
html |
string | Full HTML string to convert. Max 5 MB. Headings, paragraphs, bold/italic, lists, tables and inline (data-URI) images are supported. |
curl -X POST https://trilogicppp.com/api/html-to-docx \
-H "Content-Type: application/json" \
-H "X-API-Key: your-key" \
-d '{
"html": "<h1>Hello Word</h1><p>Generated from <b>HTML</b>.</p>"
}'
{
"url": "https://trilogicppp.com/api/download-docx/550e8400-e29b-41d4-a716-...",
"expires_at": "2026-02-28T14:30:00.000Z",
"token": "550e8400-e29b-41d4-a716-446655440000"
}
| Status | Meaning |
|---|---|
400 | Missing or invalid html field |
401 | Missing or invalid API key |
404 | Download token not found or expired |
413 | HTML payload exceeds 5 MB |
429 | Weekly free limit or paid rate limit reached |
500 | Conversion failure β see detail field |
const res = await fetch('https://trilogicppp.com/api/html-to-docx', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-key',
},
body: JSON.stringify({ html: '<h1>Hello</h1>' }),
});
const { url } = await res.json();
window.open(url); // opens the .docx download
import requests
r = requests.post(
'https://trilogicppp.com/api/html-to-docx',
headers={'X-API-Key': 'your-key'},
json={'html': '<h1>Hello</h1>'},
)
print(r.json()['url']) # temporary download link
$ch = curl_init('https://trilogicppp.com/api/html-to-docx');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'X-API-Key: your-key'],
CURLOPT_POSTFIELDS => json_encode(['html' => '<h1>Hello</h1>']),
]);
$data = json_decode(curl_exec($ch), true);
echo $data['url'];