API v1 — Free & Open
Convert Markdown to Office documents via API
Integrate Markpresso into your scripts, CI/CD pipelines, or applications. Simple REST API — send Markdown, get back .docx or .pptx files.
Quick Start
Generate a Word document with cURL:
bash
curl -X POST https://markpresso.pro/api/v1/convert/docx \
-H "Content-Type: application/json" \
-d '{
"markdown": "# Hello World\n\nThis is **Markpresso**.",
"title": "My Document"
}' \
-o my-document.docxGenerate a PowerPoint presentation:
bash
curl -X POST https://markpresso.pro/api/v1/convert/pptx \
-H "Content-Type: application/json" \
-d '{
"markdown": "# Slide 1\n\n## Key Points\n\n- Point A\n- Point B",
"title": "My Presentation"
}' \
-o my-presentation.pptxBase URL
text
https://markpresso.pro/api/v1All endpoints accept POST requests with Content-Type: application/json. CORS is enabled for all origins.
Endpoints
POST
/api/v1/convert/docxConvert Markdown to Word (.docx) document
Request Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
markdown | string | Yes | Markdown content to convert |
title | string | No | Document title (default: "Document") |
style.primaryColor | string | No | Hex color (default: #D92027) |
style.fontHeading | string | No | Heading font (default: Arial) |
style.fontBody | string | No | Body font (default: Arial) |
style.companyName | string | No | Company name for footer |
Response
Binary .docx file with Content-Disposition: attachment
Example with custom style
bash
curl -X POST https://markpresso.pro/api/v1/convert/docx \
-H "Content-Type: application/json" \
-d '{
"markdown": "# Quarterly Report\n\n## Revenue\n\n| Q1 | Q2 | Q3 |\n|---|---|---|\n| 100k | 150k | 200k |",
"title": "Q3 Report",
"style": {
"primaryColor": "#1E40AF",
"fontHeading": "Georgia",
"fontBody": "Calibri",
"companyName": "Acme Corp"
}
}' \
-o report.docxPOST
/api/v1/convert/pptxConvert Markdown to PowerPoint (.pptx) presentation
Request Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
markdown | string | Yes | Markdown content to convert |
title | string | No | Presentation title (default: "Presentation") |
style.primaryColor | string | No | Hex color for slides |
style.fontHeading | string | No | Heading font |
style.fontBody | string | No | Body font |
style.companyName | string | No | Company name |
Example
bash
curl -X POST https://markpresso.pro/api/v1/convert/pptx \
-H "Content-Type: application/json" \
-d '{
"markdown": "# Welcome\n\n## Agenda\n\n- Introduction\n- Demo\n- Q&A\n\n## Thank You\n\nContact: hello@acme.com",
"title": "Team Meeting",
"style": {
"primaryColor": "#7C3AED",
"companyName": "Acme Corp"
}
}' \
-o meeting.pptxCode Examples
Python
python
import requests
response = requests.post(
"https://markpresso.pro/api/v1/convert/docx",
json={
"markdown": "# My Report\n\n## Summary\n\nThis is a **test** document.",
"title": "Report",
"style": {
"primaryColor": "#1E40AF",
"companyName": "My Company"
}
}
)
with open("report.docx", "wb") as f:
f.write(response.content)
print("Document saved!")JavaScript / Node.js
javascript
const response = await fetch("https://markpresso.pro/api/v1/convert/docx", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
markdown: "# Hello\n\nGenerated via **Markpresso API**.",
title: "API Test",
style: { primaryColor: "#059669" }
})
});
const blob = await response.blob();
// In Node.js:
// const fs = require("fs");
// fs.writeFileSync("output.docx", Buffer.from(await response.arrayBuffer()));Bash — Batch convert multiple files
bash
#!/bin/bash
# Convert all .md files in a folder to .docx
for file in docs/*.md; do
name=$(basename "$file" .md)
echo "Converting $name..."
curl -s -X POST https://markpresso.pro/api/v1/convert/docx \
-H "Content-Type: application/json" \
-d "{\"markdown\": $(jq -Rs . < "$file"), \"title\": \"$name\"}" \
-o "output/$name.docx"
done
echo "Done! All documents saved to output/"PHP
php
<?php
$ch = curl_init("https://markpresso.pro/api/v1/convert/docx");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"markdown" => "# Invoice\n\n| Item | Price |\n|------|-------|\n| Service A | 500€ |",
"title" => "Invoice",
"style" => ["primaryColor" => "#000000", "companyName" => "My Corp"]
])
]);
$result = curl_exec($ch);
curl_close($ch);
file_put_contents("invoice.docx", $result);
echo "Invoice generated!\n";Error Handling
| Status | Meaning | Response |
|---|---|---|
200 | Success | Binary .docx or .pptx file |
400 | Bad Request | {"error": "Missing required field: markdown"} |
500 | Server Error | {"error": "Conversion failed", "details": "..."} |
