Skip to content

Repository files navigation

MegaConvert API Awesome

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


Contents


Quick Start

1. Get your API key

API access is included with the 12-month plan ($79/year). Once subscribed, generate your API key from the dashboard.

2. Convert a file

# 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"
}

3. Check status

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"
}

4. Download the result

curl -O https://megaconvert.io/api/v1/download/550e8400-e29b-41d4-a716-446655440000 \
  -H "X-API-Key: mc_your_api_key_here"

API Reference

Base URL: https://megaconvert.io/api/v1

Authentication: API key via X-API-Key header

Endpoints

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

POST /convert

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"
}

POST /tool

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

GET /status/{job_id}

Check the status of a conversion job.

Statuses: pendingprocessingcompleted or failed

Response:

{
  "job_id": "uuid-string",
  "status": "completed",
  "download_url": "/api/v1/download/uuid-string"
}

GET /download/{job_id}

Download the converted file. Returns the binary file content.

GET /formats

List all supported format conversion pairs.

GET /tools

List all available processing tools.

GET /usage

Check your current API usage.

Response:

{
  "rate_limit": 100,
  "requests_today": 42,
  "remaining": 58
}

Code Examples

Complete working examples in multiple languages:


Rate Limits & File Limits

Rate Limits

  • 100 requests per day per API key (configurable)
  • Resets at midnight UTC
  • Response headers:
    • X-RateLimit-Limit — Your daily limit
    • X-RateLimit-Remaining — Requests remaining today

File Limits

  • Maximum file size: 10 GB
  • File retention: 24 hours after conversion
  • Files are automatically deleted after the retention period

Security Features

  • 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.


Supported Formats

Documents

PDF, DOCX, DOC, XLSX, XLS, PPTX, PPT, ODT, ODS, ODP, TXT, CSV, HTML, RTF

Images

JPG, JPEG, PNG, GIF, WebP, BMP, SVG, TIFF, ICO, HEIC, AVIF, PSD, RAW

Video

MP4, WebM, AVI, MKV, MOV, FLV

Audio

MP3, WAV, OGG, FLAC, AAC, M4A, WMA

Ebooks

EPUB, MOBI, AZW3, FB2

Fonts

TTF, OTF, WOFF, WOFF2, EOT

Archives

ZIP, RAR, 7Z, TAR, GZ

Subtitles

SRT, VTT, ASS, SSA

Vector & CAD

SVG, EPS, DXF

Use GET /formats for the complete list.


Error Codes

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"
}

Awesome File Conversion

A curated list of tools, libraries, APIs, and resources for converting files between formats.

Online Converters

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

Image Conversion

Online Tools

  • 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

CLI Tools

  • 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)

Libraries

  • 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

Video Conversion

Online Tools

CLI Tools

  • FFmpeg — The universal multimedia framework
  • HandBrake CLI — Command line video transcoding

Libraries

Audio Conversion

Online Tools

CLI Tools

  • FFmpeg — Also handles all audio formats
  • SoX — Sound eXchange, the Swiss Army knife of audio
  • LAME — High quality MP3 encoder

Libraries

  • pydub (Python) — Simple audio manipulation
  • NAudio (.NET) — Audio library for .NET

Document Conversion

Online Tools

CLI Tools

  • LibreOffice CLIlibreoffice --headless --convert-to for 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.)

Libraries

  • python-docx (Python) — Create/modify Word documents
  • PyPDF2 (Python) — PDF manipulation
  • pdf-lib (JavaScript) — Create and modify PDFs
  • TCPDF (PHP) — PDF generation

Ebook Conversion

Online Tools

CLI Tools

  • Calibre — The ultimate ebook management and conversion tool
  • ebook-convert — Calibre's CLI tool for ebook format conversion

Libraries

  • EbookLib (Python) — Read/write EPUB files

Font Conversion

Online Tools

Libraries

  • fonttools (Python) — Manipulate font files (TTF, OTF, WOFF, WOFF2)

Archive & Compression

Online Tools

CLI Tools

  • 7-Zip — High compression ratio archiver
  • p7zip — 7-Zip for POSIX systems

Subtitle Conversion

Online Tools

Libraries

  • pysrt (Python) — SRT subtitle parser
  • webvtt-py (Python) — WebVTT parser

Vector & CAD

Online Tools

CLI Tools

  • Inkscape CLIinkscape --export-filename for vector conversion
  • potrace — Bitmap to vector tracing

Spreadsheet Conversion

Online Tools

Libraries

  • openpyxl (Python) — Read/write Excel files
  • SheetJS (JavaScript) — Spreadsheet parser and writer
  • PhpSpreadsheet (PHP) — Read/write spreadsheet files

Presentation Conversion

Online Tools

Libraries

  • python-pptx (Python) — Create/modify PowerPoint files

Conversion APIs — Price Comparison

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.

Articles & Guides


Contributing

Contributions welcome! Please read the contribution guidelines first.

Support

License

MIT — API docs and code examples.

CC0 1.0 — Awesome File Conversion list (public domain).