NAV
shell python php javascript

Welcome to MOV.to API documentation

To get a developer key please go todeveloper portal

Authorization: <api_key>

Convert MOV to and from anything and more

Replace the convert_to from mov-mp4 to any of the formats below

import requests
import time
import shutil
import json

headers = {'Authorization': 'f134382194a844c8bb589af58ef283e9'}
file_list = ['testfiles/blah.mov', 'testfiles/blah.mov', 'testfiles/blah.mov']
params = {
    'lang': 'en',
    'convert_to': 'mov-mp4',
    'ocr': False
}

api_url = 'https://api.mov.to/v1/convert/'
results_url = 'https://api.mov.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.mov.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))

Request:
curl -F "lang=en" -F "convert_to=mov-mp4" -F "files=@testfiles/blah.mov" -F "files=@testfiles/blah.mov" -F "files=@testfiles/blah.mov" -H "Authorization: <api_key>" https://api.mov.to/v1/convert/
Response:
{uuid: <conversion_uuid>}


Request:
curl -F "uuid=<conversion_uuid>" -H "Authorization: <api_key>" https://api.mov.to/v1/results/
Response:
{"files": [{"url": <url>, filename: <filename>}], "failed": [], "finished": true, "queue_count": 0, "errors": []}





<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$headers = array("Authorization: <api_key>");
$file_list = ['testfiles/blah.mov', 'testfiles/blah.mov', 'testfiles/blah.mov'];
$api_url = 'https://api.mov.to/v1/convert/';
$results_url = 'https://api.mov.to/v1/results/';
$post_data = [];

function download_file($url, $filename){
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_SSLVERSION, 3);
    $data = curl_exec($curl);
    $error = curl_error($curl);
    curl_close ($curl);
    $file = fopen("./testfiles/$filename", "w+");
    fputs($file, $data);
    fclose($file);
}

function convert_files($file_list, $headers, $api_url) {
    $post_data['lang'] = 'en';
    $post_data['convert_to'] = 'mov-mp4';

    foreach ($file_list as $index => $file) {
        $post_data['file[' . $index . ']'] = curl_file_create(
            realpath($file),
            mime_content_type($file),
            basename($file)
        );
    }

    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $api_url);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $content = curl_exec($curl);
    curl_close($curl);
    print($content);

    return $content;
}

function get_results($params, $api_url, $headers) {
    $error = json_decode($params);
    print_r($params);
    print_r($error);

    if ($error->error) {
        print_r($error->error);
        return;
    }

    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $api_url);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $content = json_decode(curl_exec($curl));
    curl_close($curl);

    while (!$content->finished) {
        if (intval($content->queue_count) > 0) {
            print_r("queue: $content->queue_count");
        }

        sleep(5);
        $results = get_results($params, $api_url, $headers);
    }

    foreach ($content->files as $f) {
        download_file($f->url, $f->filename);
    }
}

get_results(convert_files($file_list, $headers, $api_url), $api_url, $headers);
?>


const request = require('request');
const fs = require('fs');
const { initParams } = require('request');

let file_list = ['testfiles/blah.mov']
const api_url = 'https://api.mov.to/v1/convert/'
const results_url = 'https://api.mov.to/v1/results/'

function convertFiles(file_list) {
    let formData = {
        'lang': 'en',
        'convert_to': 'mov-mp4'
    };

    for (var i = 0; i < file_list.length; i ++) {
        formData['files'] = fs.createReadStream(file_list[i]);
    }

    request({
        url: api_url,
        method: 'post',
        formData: formData,
        headers: {
            'Authorization': '<api_key>',
            "Content-Type": "multipart/form-data",
        }
    }, function(e, r, body) {
        getResults(JSON.parse(body));
    });
}

function getResults(data) {
    if (data.error) {
        return data.error;
    }

    request({
        url: results_url,
        method: 'post',
        formData: data
    }, function(e, r, body) {
        response = JSON.parse(body);

        if (!response.finished) {
            setTimeout(
                function() {
                    getResults(data);
                }, 1000
            );
        }

        console.log(response);
    })
}

convertFiles(file_list);

Will return

/path/to/local/file_processed.docx

['pdf-csv', 'doc-jpeg', 'word-jpeg', 'pdf-pptx', 'word-xls', 'webp-doc', 'doc-xlsx', 'psd-docx', 'pdf-word', 'word-excel', 'tiff-pdf', 'xls-pdf', 'pdf-xlsx', 'doc-png', 'pdf-docx', 'html-pdf', 'word-svg', 'docx-html', 'word-epub', 'doc-xls', 'powerpoint-pdf', 'gif-pdf', 'webp-docx', 'jpg-word', 'odt-pdf', 'jpg-docx', 'docx-jpeg', 'svg-docx', 'docx-xls', 'pdf-split', 'word-pptx', 'doc-webp', 'jpg-doc', 'svg-word', 'pptx-pdf', 'pdf-jpeg', 'word-webp', 'pdf-psd', 'docx-webp', 'png-word', 'doc-tiff', 'epub-pdf', 'pdf-bmp', 'doc-svg', 'word-gif', 'docx-tiff', 'pdf-webp', 'doc-pdf', 'word-bmp', 'doc-html', 'jpg-pdf', 'pdf-gif', 'xlsx-pdf', 'jpeg-doc', 'pdf-xls', 'pdf-odt', 'pdf-compress', 'docx-svg', 'webp-pdf', 'pdf-doc', 'word-pdf', 'pdf-repair', 'pdf-epub', 'pdf-organize', 'pdf-zip', 'word-powerpoint', 'tiff-doc', 'svg-pdf', 'png-doc', 'jpeg-pdf', 'webp-word', 'doc-epub', 'word-html', 'pdf-ppt', 'docx-doc', 'pdf-powerpoint', 'docx-jpg', 'bmp-word', 'docx-gif', 'docx-bmp', 'gif-word', 'pdf-image', 'bmp-pdf', 'word-jpg', 'pdf-html', 'pdf-txt', 'bmp-docx', 'png-pdf', 'docx-epub', 'pdf-unlock', 'psd-pdf', 'doc-psd', 'psd-word', 'image-pdf', 'docx-png', 'doc-jpg', 'word-zip', 'word-ppt', 'jpeg-word', 'docx-ppt', 'bmp-doc', 'gif-doc', 'pdf-svg', 'pdf-tiff', 'png-docx', 'pdf-png', 'docx-psd', 'doc-bmp', 'tiff-docx', 'word-xlsx', 'word-png', 'docx-pdf', 'ppt-pdf', 'docx-pptx', 'doc-gif', 'csv-pdf', 'pdf-jpg', 'gif-docx', 'tiff-word', 'word-psd', 'excel-pdf', 'pdf-excel', 'psd-doc', 'jpeg-docx', 'svg-doc', 'word-tiff', 'docx-xlsx', 'txt-pdf', 'docx-zip', 'doc-zip', 'doc-powerpoint', 'docx-powerpoint', 'docx-excel', 'doc-excel', 'jpeg-png', 'jpeg-ico', 'jpeg-svg', 'jpeg-jpg', 'jpeg-bmp', 'jpeg-jfif', 'jpeg-zip', 'jpeg-tiff', 'jpeg-webp', 'jpeg-gif', 'jpeg-psd', 'jpg-jpeg', 'png-jpeg', 'bmp-jpeg', 'svg-jpeg', 'tiff-jpeg', 'webp-jpeg', 'psd-jpeg', 'gif-jpeg', 'jpeg-compress', 'jpg-png', 'jpg-ico', 'jpg-svg', 'jpg-jpeg', 'jpg-bmp', 'jpg-jfif', 'jpg-zip', 'jpg-tiff', 'jpg-webp', 'jpg-gif', 'jpg-psd', 'jpeg-jpg', 'png-jpg', 'bmp-jpg', 'svg-jpg', 'tiff-jpg', 'webp-jpg', 'psd-jpg', 'gif-jpg', 'jpg-compress', 'word-doc', 'word-docx', 'mp3-wav', 'mp3-m4a', 'mp3-flac', 'mp3-wma', 'mp3-aiff', 'mp3-aac', 'mp3-mp2', 'mp3-m4r', 'mp3-ogg', 'mp3-ac3', 'mp3-amr', 'mp3-dts', 'mp3-opus', 'mov-mp4', 'mp3-avi', 'mp3-wmv', 'mp3-mpeg', 'mp3-mov', 'mp3-mpg', 'mp3-divx', 'mp3-webm', 'mp3-flv', 'mp3-3gp', 'mp3-vob', 'mp3-av1', 'mp3-m4v', 'mp3-hls', 'mp3-m3u8', 'mp3-mkv', 'mp3-zip', 'wav-mp3', 'm4a-mp3', 'flac-mp3', 'wma-mp3', 'aiff-mp3', 'aac-mp3', 'mp2-mp3', 'm4r-mp3', 'ogg-mp3', 'ac3-mp3', 'amr-mp3', 'dts-mp3', 'opus-mp3', 'mp4-mp3', 'avi-mp3', 'wmv-mp3', 'mpeg-mp3', 'mov-mp3', 'mpg-mp3', 'divx-mp3', 'webm-mp3', 'flv-mp3', 'vob-mp3', 'av1-mp3', 'm4v-mp3', 'mkv-mp3', 'mp3-mpeg2', 'mp4-mp3', 'mp4-wav', 'mp4-m4a', 'mp4-flac', 'mp4-wma', 'mp4-aiff', 'mp4-aac', 'mp4-mp2', 'mp4-m4r', 'mp4-ogg', 'mp4-ac3', 'mp4-amr', 'mp4-dts', 'mp4-opus', 'mp4-avi', 'mp4-wmv', 'mp4-mpeg', 'mp4-mov', 'mp4-mpg', 'mp4-divx', 'mp4-webm', 'mp4-flv', 'mp4-3gp', 'mp4-vob', 'mp4-av1', 'mp4-m4v', 'mp4-hls', 'mp4-m3u8', 'mp4-mkv', 'mp4-gif', 'mp4-webp', 'mp4-zip', 'wav-mp4', 'm4a-mp4', 'flac-mp4', 'wma-mp4', 'aiff-mp4', 'aac-mp4', 'mp2-mp4', 'm4r-mp4', 'ogg-mp4', 'ac3-mp4', 'amr-mp4', 'dts-mp4', 'opus-mp4', 'mp4-mp4', 'avi-mp4', 'wmv-mp4', 'mpeg-mp4', 'mov-mp4', 'mpg-mp4', 'divx-mp4', 'webm-mp4', 'flv-mp4', 'vob-mp4', 'av1-mp4', 'm4v-mp4', 'mkv-mp4', 'webp-mp4', 'png-jpg', 'png-ico', 'png-svg', 'png-jpeg', 'png-bmp', 'png-jfif', 'png-zip', 'png-tiff', 'png-webp', 'png-gif', 'png-psd', 'jpeg-png', 'jpg-png', 'bmp-png', 'svg-png', 'tiff-png', 'webp-png', 'psd-png', 'gif-png', 'png-compress', 'webm-mp3', 'webm-wav', 'webm-m4a', 'webm-flac', 'webm-wma', 'webm-aiff', 'webm-aac', 'webm-mp2', 'webm-m4r', 'webm-ogg', 'webm-ac3', 'webm-amr', 'webm-dts', 'webm-opus', 'webm-avi', 'webm-wmv', 'webm-mpeg', 'webm-mov', 'webm-mpg', 'webm-divx', 'webm-flv', 'webm-3gp', 'webm-vob', 'webm-av1', 'webm-m4v', 'webm-hls', 'webm-m3u8', 'webm-mkv', 'webm-gif', 'webm-webp', 'webm-zip', 'webm-webp', 'wav-webm', 'm4a-webm', 'flac-webm', 'wma-webm', 'aiff-webm', 'aac-webm', 'mp2-webm', 'm4r-webm', 'ogg-webm', 'ac3-webm', 'amr-webm', 'dts-webm', 'opus-webm', 'avi-webm', 'wmv-webm', 'mpeg-webm', 'mov-webm', 'mpg-webm', 'divx-webm', 'webm-webm', 'flv-webm', 'webp-webm', 'vob-webm', 'av1-webm', 'm4v-webm', 'mkv-webm', 'gif-mp4', 'gif-webm', 'webp-jpg', 'webp-ico', 'webp-svg', 'webp-jpeg', 'webp-bmp', 'webp-jfif', 'webp-zip', 'webp-tiff', 'webp-webp', 'webp-gif', 'webp-psd', 'jpeg-webp', 'jpg-webp', 'bmp-webp', 'svg-webp', 'tiff-webp', 'webp-webp', 'psd-webp', 'gif-webp', 'webp-compress', 'mkv-mp3', 'mkv-wav', 'mkv-m4a', 'mkv-flac', 'mkv-wma', 'mkv-aiff', 'mkv-aac', 'mkv-mp2', 'mkv-m4r', 'mkv-ogg', 'mkv-ac3', 'mkv-amr', 'mkv-dts', 'mkv-opus', 'mkv-avi', 'mkv-wmv', 'mkv-mpeg', 'mkv-mov', 'mkv-mpg', 'mkv-divx', 'mkv-webm', 'mkv-flv', 'mkv-3gp', 'mkv-vob', 'mkv-av1', 'mkv-m4v', 'mkv-hls', 'mkv-m3u8', 'mkv-mkv', 'mkv-gif', 'mkv-webp', 'mkv-zip', 'wav-mkv', 'm4a-mkv', 'flac-mkv', 'wma-mkv', 'aiff-mkv', 'aac-mkv', 'mp2-mkv', 'm4r-mkv', 'ogg-mkv', 'ac3-mkv', 'amr-mkv', 'dts-mkv', 'opus-mkv', 'mkv-mkv', 'avi-mkv', 'wmv-mkv', 'mpeg-mkv', 'mov-mkv', 'mpg-mkv', 'divx-mkv', 'webm-mkv', 'flv-mkv', 'vob-mkv', 'av1-mkv', 'm4v-mkv', 'mkv-mkv', 'webp-mkv', 'epub-pdf', 'epub-mobi', 'epub-kindle', 'epub-azw3', 'epub-fb2', 'epub-cbz', 'epub-cbr', 'epub-doc', 'epub-docx', 'epub-word', 'epub-html', 'epub-rtf', 'epub-text', 'epub-png', 'epub-svg', 'epub-jpg', 'epub-bmp', 'epub-zip', 'epub-gif', 'epub-tiff', 'pdf-epub', 'image-removebackground', 'image-backgroundremover', 'png-removebackground', 'jpg-removebackground', 'jpeg-removebackground', 'mov-mp3', 'mov-wav', 'mov-m4a', 'mov-flac', 'mov-wma', 'mov-aiff', 'mov-aac', 'mov-mp2', 'mov-m4r', 'mov-ogg', 'mov-ac3', 'mov-amr', 'mov-dts', 'mov-opus', 'mov-avi', 'mov-wmv', 'mov-mpeg', 'mov-mpg', 'mov-divx', 'mov-webm', 'mov-flv', 'mov-3gp', 'mov-vob', 'mov-av1', 'mov-m4v', 'mov-hls', 'mov-m3u8', 'mov-mkv', 'mov-gif', 'mov-webp', 'mov-zip', 'wav-mov', 'm4a-mov', 'flac-mov', 'wma-mov', 'aiff-mov', 'aac-mov', 'mp2-mov', 'm4r-mov', 'ogg-mov', 'ac3-mov', 'amr-mov', 'dts-mov', 'opus-mov', 'mov-mov', 'avi-mov', 'wmv-mov', 'mpeg-mov', 'mpg-mov', 'divx-mov', 'webm-mov', 'flv-mov', 'vob-mov', 'av1-mov', 'm4v-mov', 'mkv-mov', 'webp-mov', 'gif-mov' ] To make multiple simply put more files in your list