Official documentation and code examples for the MegaConvert.io File Conversion API.
Convert 300+ file format pairs programmatically — images, video, audio, documents, ebooks, fonts, subtitles, archives, vector graphics, and more.
Full interactive documentation: megaconvert.io/docs/api
- Quick Start
- API Reference
- Code Examples
- Rate Limits & File Limits
- Security Features
- Supported Formats
- Error Codes
- Awesome File Conversion — Curated list of conversion tools, libraries & resources
API access is included with the 12-month plan ($79/year). Once subscribed, generate your API key from the dashboard.
# Upload and convert a PNG to WebP
curl -X POST https://megaconvert.io/api/v1/convert \
-H "X-API-Key: mc_your_api_key_here" \
-F "[email protected]" \
-F "output_format=webp"{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending",
"message": "Job created successfully"
}curl https://megaconvert.io/api/v1/status/550e8400-e29b-41d4-a716-446655440000 \
-H "X-API-Key: mc_your_api_key_here"{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"download_url": "/api/v1/download/550e8400-e29b-41d4-a716-446655440000"
}curl -O https://megaconvert.io/api/v1/download/550e8400-e29b-41d4-a716-446655440000 \
-H "X-API-Key: mc_your_api_key_here"Base URL: https://megaconvert.io/api/v1
Authentication: API key via X-API-Key header
| Method | Endpoint | Description |
|---|---|---|
POST |
/convert |
Convert a file to another format |
POST |
/tool |
Process a file with a tool (compress, resize, merge, etc.) |
GET |
/status/{job_id} |
Check job status |
GET |
/download/{job_id} |
Download completed file |
GET |
/formats |
List all supported format conversions |
GET |
/tools |
List all available processing tools |
GET |
/usage |
Check your API usage and limits |
Convert a file from one format to another.
Request: multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
file |
file | Yes | The file to convert |
output_format |
string | Yes | Target format (e.g., webp, pdf, mp3) |
Response:
{
"job_id": "uuid-string",
"status": "pending",
"message": "Job created successfully"
}Process a file using a specific tool.
Request: multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
file |
file | Yes | The file to process |
tool |
string | Yes | Tool name (see available tools below) |
| Additional params vary by tool (see below) |
Available tools:
| Tool | Description | Extra Parameters |
|---|---|---|
compress-pdf |
Compress PDF files | — |
merge-pdf |
Merge multiple PDFs | Multiple file fields |
split-pdf |
Extract page range | pages (e.g., "1-5") |
rotate-pdf |
Rotate PDF pages | angle (90, 180, 270) |
protect-pdf |
Password-protect PDF | password |
unlock-pdf |
Remove PDF password | password (current password) |
compress-image |
Compress images | — |
resize-image |
Resize images | width, height |
crop-image |
Crop images | width, height, x, y |
compress-video |
Compress videos | — |
trim-video |
Trim video | start, end |
video-to-gif |
Convert video to GIF | — |
extract-audio |
Extract audio from video | — |
Check the status of a conversion job.
Statuses: pending → processing → completed or failed
Response:
{
"job_id": "uuid-string",
"status": "completed",
"download_url": "/api/v1/download/uuid-string"
}Download the converted file. Returns the binary file content.
List all supported format conversion pairs.
List all available processing tools.
Check your current API usage.
Response:
{
"rate_limit": 100,
"requests_today": 42,
"remaining": 58
}Complete working examples in multiple languages:
- cURL — Shell scripts
- Python — Using
requests - JavaScript — Using
fetch(Node.js 18+) - PHP — Using
cURL
- 100 requests per day per API key (configurable)
- Resets at midnight UTC
- Response headers:
X-RateLimit-Limit— Your daily limitX-RateLimit-Remaining— Requests remaining today
- Maximum file size: 10 GB
- File retention: 24 hours after conversion
- Files are automatically deleted after the retention period
- IP Whitelist — Restrict API access to specific IPs (configurable per key)
- Domain Whitelist — Restrict API access to specific domains (configurable per key)
- API Key Hashing — Keys are stored as SHA256 hashes
Configure these settings in your API dashboard.
PDF, DOCX, DOC, XLSX, XLS, PPTX, PPT, ODT, ODS, ODP, TXT, CSV, HTML, RTF
JPG, JPEG, PNG, GIF, WebP, BMP, SVG, TIFF, ICO, HEIC, AVIF, PSD, RAW
MP4, WebM, AVI, MKV, MOV, FLV
MP3, WAV, OGG, FLAC, AAC, M4A, WMA
EPUB, MOBI, AZW3, FB2
TTF, OTF, WOFF, WOFF2, EOT
ZIP, RAR, 7Z, TAR, GZ
SRT, VTT, ASS, SSA
SVG, EPS, DXF
Use GET /formats for the complete list.
| Code | Description |
|---|---|
400 |
Bad request — missing parameters or unsupported format |
401 |
Unauthorized — missing or invalid API key |
403 |
Forbidden — no active subscription or IP/domain not whitelisted |
404 |
Not found — job doesn't exist or doesn't belong to you |
413 |
File too large — exceeds size limit |
429 |
Rate limit exceeded — try again tomorrow or upgrade |
500 |
Server error — please retry or contact support |
Error response format:
{
"error": "Human-readable error message",
"code": "error_code_identifier"
}A curated list of tools, libraries, APIs, and resources for converting files between formats.
| Tool | Formats | Free Tier | API | Languages |
|---|---|---|---|---|
| MegaConvert.io | 300+ pairs (images, video, audio, docs, ebooks, fonts, subtitles, archives, vector) | 3/day, 25MB | Yes | 47 |
| CloudConvert | 200+ formats | 25 min/day | Yes | ~15 |
| Convertio | 300+ formats | 100MB, 10 min/day | Yes | ~10 |
| Zamzar | 1200+ formats | 2 files/day, 50MB | Yes | 1 (EN) |
| Online-Convert | 200+ formats | Limited | Yes | ~10 |
| FreeConvert | 200+ formats | 1GB | No | ~5 |
- MegaConvert Image Converter — JPG, PNG, WebP, AVIF, HEIC, SVG, BMP, TIFF, ICO, PSD, RAW and more
- Squoosh — Google's image compression/conversion tool (client-side)
- TinyPNG — PNG and JPEG compression
- ImageMagick — The Swiss Army knife of image processing. Supports 200+ formats
- libvips — Fast image processing library, lower memory than ImageMagick
- Sharp — High-performance Node.js image processing (powered by libvips)
- sharp (Node.js) — Resize, convert, compress images
- Pillow (Python) — Read/write many image formats
- image (Rust) — Pure Rust image processing
- Intervention Image (PHP) — OOP image handling
- MegaConvert Video Converter — MP4, WebM, AVI, MKV, MOV, FLV and more
- HandBrake — Open source video transcoder (desktop app)
- FFmpeg — The universal multimedia framework
- HandBrake CLI — Command line video transcoding
- fluent-ffmpeg (Node.js) — FFmpeg wrapper
- ffmpeg-python (Python) — Pythonic FFmpeg bindings
- PHP-FFMpeg (PHP) — FFmpeg wrapper for PHP
- MegaConvert Audio Converter — MP3, WAV, FLAC, AAC, OGG, M4A, WMA and more
- FFmpeg — Also handles all audio formats
- SoX — Sound eXchange, the Swiss Army knife of audio
- LAME — High quality MP3 encoder
- MegaConvert Document Converter — PDF, DOCX, DOC, ODT, RTF, TXT, HTML and more
- iLovePDF — Comprehensive PDF toolkit
- SmallPDF — PDF tools suite
- LibreOffice CLI —
libreoffice --headless --convert-tofor document conversion - Pandoc — Universal document converter (Markdown, LaTeX, DOCX, HTML, EPUB, etc.)
- Ghostscript — PostScript/PDF interpreter and converter
- poppler-utils — PDF rendering library (pdftotext, pdftohtml, etc.)
- python-docx (Python) — Create/modify Word documents
- PyPDF2 (Python) — PDF manipulation
- pdf-lib (JavaScript) — Create and modify PDFs
- TCPDF (PHP) — PDF generation
- MegaConvert Ebook Converter — EPUB, MOBI, AZW3, FB2, PDF and more
- Calibre — The ultimate ebook management and conversion tool
ebook-convert— Calibre's CLI tool for ebook format conversion
- EbookLib (Python) — Read/write EPUB files
- MegaConvert Font Converter — TTF, OTF, WOFF, WOFF2, EOT and more
- fonttools (Python) — Manipulate font files (TTF, OTF, WOFF, WOFF2)
- MegaConvert Archive Converter — ZIP, RAR, 7Z, TAR, GZ and more
- MegaConvert Subtitle Converter — SRT, VTT, ASS, SSA and more
- MegaConvert Vector Converter — SVG, EPS, DXF, AI and more
- Inkscape CLI —
inkscape --export-filenamefor vector conversion - potrace — Bitmap to vector tracing
- MegaConvert Spreadsheet Converter — XLS, XLSX, CSV, ODS, TSV and more
- openpyxl (Python) — Read/write Excel files
- SheetJS (JavaScript) — Spreadsheet parser and writer
- PhpSpreadsheet (PHP) — Read/write spreadsheet files
- MegaConvert Presentation Converter — PPT, PPTX, ODP, PDF and more
- python-pptx (Python) — Create/modify PowerPoint files
| API | Plan | Requests Included | Cost/Request | Max File Size |
|---|---|---|---|---|
| MegaConvert API | $79/year | 36,500/year (100/day) | $0.002 | 10 GB |
| CloudConvert API | $8/500 min | ~500/month | $0.016 | 5 GB |
| Zamzar API | $8/month ($96/yr) | 100/month | $0.080 | 50 MB |
| ConvertAPI | $15/month ($180/yr) | 1,500/month | $0.010 | 1 GB |
MegaConvert is up to 40x cheaper per request than alternatives, with the largest file size limit (10 GB) and no monthly billing — one flat annual fee.
- FFmpeg Cheat Sheet — Common FFmpeg commands
- Pandoc User's Guide — Complete guide to document conversion
- ImageMagick Examples — Comprehensive ImageMagick tutorial
Contributions welcome! Please read the contribution guidelines first.
- Documentation: megaconvert.io/docs/api
- Issues: GitHub Issues
- Email: [email protected]
MIT — API docs and code examples.
CC0 1.0 — Awesome File Conversion list (public domain).