MediaFormatter API

Convert, compress, and process media files programmatically. Built for developers.

curl -X POST https://www.mediaformatter.com/api/v1/convert \
  -H "Authorization: Bearer mf_your_api_key" \
  -F "file=@video.mp4" \
  -F "operation=convert_video" \
  -F "targetFormat=webm" \
  -F "permissionAccepted=true"

How it works

1

Get your API key

Subscribe to the Business plan, then generate a key in your dashboard.

2

Make a request

POST your file with the operation you want to perform.

3

Poll and download

Check job status, then download the result when it's complete.

API reference

POST/api/v1/convert

Submit a file for processing. Request body is multipart/form-data.

ParameterTypeRequiredDescription
fileFileYesThe media file to process
operationstringYesThe operation to perform
permissionAcceptedbooleanYesMust be true
targetFormatstringNoOutput format (e.g. mp4, mp3)
presetstringNofast, balanced, or quality
startTimestringNoTrim start (HH:MM:SS)
endTimestringNoTrim end (HH:MM:SS)

Response

{
  "jobId": "550e8400-e29b-41d4-a716-446655440000",
  "status": "queued",
  "operation": "convert_video",
  "pollUrl": "https://www.mediaformatter.com/api/v1/jobs/550e8400...",
  "docsUrl": "https://www.mediaformatter.com/developers"
}

Code examples

const formData = new FormData();
formData.append('file', fileInput.files[0]);
formData.append('operation', 'convert_video');
formData.append('targetFormat', 'mp4');
formData.append('permissionAccepted', 'true');

const response = await fetch('https://www.mediaformatter.com/api/v1/convert', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer mf_your_api_key' },
  body: formData
});
const { jobId, pollUrl } = await response.json();
"tok-com">
// Poll for completion
const poll = async () => {
  const status = await fetch(pollUrl, {
    headers: { 'Authorization': 'Bearer mf_your_api_key' }
  }).then(r => r.json());

  if (status.status === 'completed') {
    window.location.href = status.downloadUrl;
  } else if (status.status === 'failed') {
    console.error('Job failed');
  } else {
    setTimeout(poll, 2000);
  }
};
poll();