MagicTools

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

  1. Sign in and go to Dashboard → API Keys to create a key (shown in plain text only once)
  2. Send requests with the header Authorization: Bearer mk_xxx
  3. On success the response body is the converted file; on failure you get JSON { code, msg }

Endpoints

EndpointDescriptionParameters
POST/api/v1/convert/office-to-pdfConvert 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-pdfConvert an HTML file or a public URL to PDFfile: .html file, or url: a public web page (one of the two; private/internal addresses are rejected)
POST/api/v1/convert/markdown-to-pdfConvert Markdown to a styled PDFfile: the .md file (multipart)
POST/api/v1/convert/pdf-to-imagesConvert 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-pdfMerge multiple PDFs in orderfiles: two or more PDFs (merged in field order)
GET/api/v1/usageCheck today's usage and remaining quota for the keyno 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

401Missing or invalid API key
422Bad input: missing file, unsupported type, over 20MB, or content does not match extension
429Daily quota exceeded
500Conversion failed (e.g. corrupted file)
503Conversion service temporarily unavailable

Limits

Prefer the web UI (no key required)? File Converter Suite