Robust Video API

Create automatic workflows, compress or convert videos. From anywhere to anywhere.

Configuration API BUILDER
Operation
Storage
Settings
Advanced
Video Operation
Compress Video
Compress MP4
Compress AVI
Compress MOV
Convert Video
MP4 to MOV
MP4 to AVI
MP4 to WebM
MOV to MP4
AVI to MP4
WebM to MP4
MKV to MP4
Convert Video to GIF
Storage Configuration
Video Settings
23
Lower values = higher quality (0-51, 23 is default)
Leave empty to use automatic bitrate
Advanced Options

API Examples
cURL
Python
Node.js
Javascript
Go
cURL Example

curl -X POST "http://process.contentor.app/api/process-video/"
  -H "Content-Type: application/json" \
  -H "X-User-Access-Key: YOUR_ACCESS_KEY" \
  -H "X-User-Access-Token: YOUR_ACCESS_TOKEN" \
  -d '{
    "download_provider": "aws",
    "upload_provider": "aws",
    "download_url": "",
    "upload_url": "",
    "download_access_key": "",
    "download_access_secret": "",
    "upload_access_key": "",
    "upload_access_secret": "",
    "resolution": "original"
  }'
Python Client Example

import requests
import json

# API Configuration
API_URL = "http://process.contentor.app/api/process-video/"

# API Authentication
headers = {
    "Content-Type": "application/json",
    "X-User-Access-Key": "YOUR_ACCESS_KEY",    # Required
    "X-User-Access-Token": "YOUR_ACCESS_TOKEN" # Required
}

# Configuration from form (this will be updated dynamically)
config = {
    "download_provider": "aws",
    "upload_provider": "aws",
    "download_url": "",
    "upload_url": "",
    "download_access_key": "",
    "download_access_secret": "",
    "upload_access_key": "",
    "upload_access_secret": "",
    "resolution": "original"
}

# Send the request
response = requests.post(API_URL, headers=headers, json=config)

# Check the response
if response.status_code == 200:
    result = response.json()
    print("Video processing job submitted successfully!")
    print(f"Job ID: {result.get('id')}")
    print(f"Status: {result.get('status')}")
    print(f"Message: {result.get('message')}")
else:
    print(f"Error: {response.status_code} - {response.text}")
                        
Node.js Client Example

const axios = require('axios');

// API Configuration
const API_URL = "http://process.contentor.app/api/process-video/"

// API Authentication
const headers = {
    "Content-Type": "application/json",
    "X-User-Access-Key": "YOUR_ACCESS_KEY",    // Required
    "X-User-Access-Token": "YOUR_ACCESS_TOKEN" // Required
};

// Configuration from form (this will be updated dynamically)
const config = {
    "download_provider": "aws",
    "upload_provider": "aws",
    "download_url": "",
    "upload_url": "",
    "download_access_key": "",
    "download_access_secret": "",
    "upload_access_key": "",
    "upload_access_secret": "",
    "resolution": "original"
};

// Send the request
async function processVideo() {
    try {
        const response = await axios.post(API_URL, config, { headers });

        console.log("Video processing job submitted successfully!");
        console.log(`Job ID: ${response.data.id}`);
        console.log(`Status: ${response.data.status}`);
        console.log(`Message: ${response.data.message}`);

        return response.data;
    } catch (error) {
        console.error(`Error: ${error.response ? error.response.status : 'Network error'}`);
        console.error(error.response ? error.response.data : error.message);
        throw error;
    }
}

// Execute the function
processVideo();
                        
JavaScript Client Example

// API Configuration
const API_URL = "http://process.contentor.app/api/process-video/"

// API Authentication
const headers = {
    "Content-Type": "application/json",
    "X-User-Access-Key": "YOUR_ACCESS_KEY",    // Required
    "X-User-Access-Token": "YOUR_ACCESS_TOKEN" // Required
};
javascript
// Configuration from form (this will be updated dynamically)
const config = {
    "download_provider": "aws",
    "upload_provider": "aws",
    "download_url": "",
    "upload_url": "",
    "download_access_key": "",
    "download_access_secret": "",
    "upload_access_key": "",
    "upload_access_secret": "",
    "resolution": "original"
};

// Send the request
fetch(API_URL, {
    method: 'POST',
    headers: headers,
    body: JSON.stringify(config)
})
.then(response => {
    if (!response.ok) {
        throw new Error(`Error: ${response.status} - ${response.statusText}`);
    }
    return response.json();
})
.then(result => {
    console.log("Video processing job submitted successfully!");
    console.log(`Job ID: ${result.id}`);
    console.log(`Status: ${result.status}`);
    console.log(`Message: ${result.message}`);
})
.catch(error => {
    console.error("Error:", error);
});
Go Client Example

package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	// API Configuration
	apiURL := "http://process.contentor.app/api/process-video/"

	// API Authentication
	headers := map[string]string{
		"Content-Type":        "application/json",
		"X-User-Access-Key":   "YOUR_ACCESS_KEY",    // Required
		"X-User-Access-Token": "YOUR_ACCESS_TOKEN",  // Required
	}

	// Configuration from form (this will be updated dynamically)
	config := map[string]interface{}{
		"download_provider":             "aws",
		"upload_provider":             "aws",
		"download_url":         "",
		"upload_url":           "",
		"download_access_key":  "",
		"download_access_secret": "",
		"upload_access_key":    "",
		"upload_access_secret": "",
		"resolution":           "original",
	}

	// Convert config to JSON
	jsonData, err := json.Marshal(config)
	if err != nil {
		fmt.Println("Error marshaling JSON:", err)
		return
	}

	// Create request
	req, err := http.NewRequest("POST", apiURL, bytes.NewBuffer(jsonData))
	if err != nil {
		fmt.Println("Error creating request:", err)
		return
	}

	// Add headers
	for key, value := range headers {
		req.Header.Set(key, value)
	}

	// Send the request
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Error sending request:", err)
		return
	}
	defer resp.Body.Close()

	// Read response
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		fmt.Println("Error reading response:", err)
		return
	}

	// Check the response
	if resp.StatusCode == 200 {
		var result map[string]interface{}
		if err := json.Unmarshal(body, &result); err != nil {
			fmt.Println("Error parsing response:", err)
			return
		}

		fmt.Println("Video processing job submitted successfully!")
		fmt.Printf("Job ID: %v\n", result["id"])
		fmt.Printf("Status: %v\n", result["status"])
		fmt.Printf("Message: %v\n", result["message"])
	} else {
		fmt.Printf("Error: %d - %s\n", resp.StatusCode, string(body))
	}
}