File Conversion API
Convert Office files to PDF, PDF to images, and merge PDFs with a single HTTP request. Free with registration.
API key auth
Create keys in your Dashboard
50 requests/day
Per key, resets at 00:00 UTC+8
Zero retention
Files are processed in memory, never stored
Quick start
- Sign in and go to Dashboard → API Keys to create a key (shown in plain text only once)
- Send requests with the header Authorization: Bearer mk_xxx
- On success the response body is the converted file; on failure you get JSON { code, msg }
Endpoints
| Endpoint | Description | Parameters |
|---|---|---|
POST/api/v1/convert/office-to-pdf | Convert Office documents to PDF (docx / doc / pptx / ppt / xlsx / xls / odt / odp / ods / rtf / txt / csv) | file: the document (multipart) |
POST/api/v1/convert/html-to-pdf | Convert an HTML file or a public URL to PDF | file: .html file, or url: a public web page (one of the two; private/internal addresses are rejected) |
POST/api/v1/convert/markdown-to-pdf | Convert Markdown to a styled PDF | file: the .md file (multipart) |
POST/api/v1/convert/pdf-to-images | Convert PDF pages to images (150 DPI; single page returns an image, multiple pages return a zip) | file: the PDF; format: jpg (default) or png |
POST/api/v1/convert/merge-pdf | Merge multiple PDFs in order | files: two or more PDFs (merged in field order) |
GET/api/v1/usage | Check today's usage and remaining quota for the key | no parameters |
Examples
curl
# Convert docx to PDF
curl -X POST "https://tools.cooconsbit.com/api/v1/convert/office-to-pdf" \
-H "Authorization: Bearer mk_your_api_key" \
-F "file=@report.docx" \
-o report.pdf
# Convert PDF to PNG images
curl -X POST "https://tools.cooconsbit.com/api/v1/convert/pdf-to-images" \
-H "Authorization: Bearer mk_your_api_key" \
-F "file=@report.pdf" -F "format=png" \
-o pages.zip
# Check quota
curl "https://tools.cooconsbit.com/api/v1/usage" -H "Authorization: Bearer mk_your_api_key"Python (requests)
import requests
API_KEY = "mk_your_api_key"
BASE = "https://tools.cooconsbit.com"
# Convert docx to PDF
with open("report.docx", "rb") as f:
resp = requests.post(
f"{BASE}/api/v1/convert/office-to-pdf",
headers={"Authorization": f"Bearer {API_KEY}"},
files={"file": ("report.docx", f)},
timeout=120,
)
resp.raise_for_status()
with open("report.pdf", "wb") as out:
out.write(resp.content)
# Merge two PDFs
resp = requests.post(
f"{BASE}/api/v1/convert/merge-pdf",
headers={"Authorization": f"Bearer {API_KEY}"},
files=[
("files", ("a.pdf", open("a.pdf", "rb"))),
("files", ("b.pdf", open("b.pdf", "rb"))),
],
timeout=120,
)
resp.raise_for_status()
open("merged.pdf", "wb").write(resp.content)Node.js
// Node.js 18+(built-in fetch / FormData)
import { readFile, writeFile } from "node:fs/promises";
const API_KEY = "mk_your_api_key";
const BASE = "https://tools.cooconsbit.com";
const form = new FormData();
form.append(
"file",
new Blob([await readFile("report.docx")]),
"report.docx"
);
const resp = await fetch(`${BASE}/api/v1/convert/office-to-pdf`, {
method: "POST",
headers: { Authorization: `Bearer ${API_KEY}` },
body: form,
});
if (!resp.ok) {
console.error(await resp.json()); // { code, msg }
process.exit(1);
}
await writeFile("report.pdf", Buffer.from(await resp.arrayBuffer()));Error codes
| 401 | Missing or invalid API key |
| 422 | Bad input: missing file, unsupported type, over 20MB, or content does not match extension |
| 429 | Daily quota exceeded |
| 500 | Conversion failed (e.g. corrupted file) |
| 503 | Conversion service temporarily unavailable |
Limits
- Max file size: 20MB
- 50 requests per key per day, up to 5 keys per account
- Conversion timeout: 60 seconds
- Zero retention: files are processed in memory and released as soon as the response is sent
Prefer the web UI (no key required)? File Converter Suite