Skip to main content
GET
/
videos
/
{video_id}
/
download
Download video file
curl --request GET \
  --url https://api.elytron.com/v1/videos/{video_id}/download \
  --header 'Authorization: Bearer <token>'
"<string>"
Download the generated video file in your preferred format.

Path Parameters

ParameterTypeRequiredDescription
video_idstringYesUnique identifier for the video (UUID format)

Query Parameters

ParameterTypeRequiredDescription
formatstringNoVideo format: mp4, webm, or mov (default: mp4)

Example Request

curl -X GET "https://api.elytron.com/v1/videos/550e8400-e29b-41d4-a716-446655440000/download?format=mp4" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o "my_video.mp4"

Response

Returns a 200 OK status with the video file as binary data. The response includes appropriate headers:
Content-Type: video/mp4
Content-Length: 15728640
Content-Disposition: attachment; filename="video_550e8400-e29b-41d4-a716-446655440000.mp4"

Supported Formats

FormatMIME TypeDescription
mp4video/mp4MP4 container with H.264 codec (recommended)
webmvideo/webmWebM container with VP9 codec (web-optimized)
movvideo/quicktimeQuickTime container with H.264 codec (Apple devices)

Download URLs

When a video is completed, you can also get a direct download URL from the video details:
{
  "download_url": "https://api.elytron.com/v1/videos/550e8400-e29b-41d4-a716-446655440000/download"
}
This URL can be used directly in browsers or applications without additional authentication headers.

Error Responses

404 Not Found

{
  "error": {
    "code": "VIDEO_NOT_FOUND",
    "message": "Video not found"
  }
}

400 Bad Request

{
  "error": {
    "code": "VIDEO_NOT_READY",
    "message": "Video is not ready for download. Status: processing"
  }
}

401 Unauthorized

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid API key"
  }
}

File Size Considerations

Video files can be large depending on duration and quality:
  • SD Quality: ~1-2 MB per second
  • HD Quality: ~3-5 MB per second
  • 4K Quality: ~8-15 MB per second
For large files, consider implementing resumable downloads or streaming.

Example Usage in Different Languages

JavaScript/Node.js

const fs = require('fs');
const https = require('https');

const downloadVideo = async (videoId, apiKey) => {
  const options = {
    hostname: 'api.elytron.com',
    path: `/v1/videos/${videoId}/download`,
    headers: {
      'Authorization': `Bearer ${apiKey}`
    }
  };

  const file = fs.createWriteStream(`video_${videoId}.mp4`);
  
  https.get(options, (response) => {
    response.pipe(file);
    file.on('finish', () => {
      file.close();
      console.log('Video downloaded successfully');
    });
  });
};

Python

import requests

def download_video(video_id, api_key, filename=None):
    url = f"https://api.elytron.com/v1/videos/{video_id}/download"
    headers = {"Authorization": f"Bearer {api_key}"}
    
    response = requests.get(url, headers=headers, stream=True)
    response.raise_for_status()
    
    if not filename:
        filename = f"video_{video_id}.mp4"
    
    with open(filename, 'wb') as f:
        for chunk in response.iter_content(chunk_size=8192):
            f.write(chunk)
    
    print(f"Video downloaded as {filename}")

PHP

<?php
function downloadVideo($videoId, $apiKey, $filename = null) {
    $url = "https://api.elytron.com/v1/videos/{$videoId}/download";
    $headers = ["Authorization: Bearer {$apiKey}"];
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    $videoData = curl_exec($ch);
    curl_close($ch);
    
    if (!$filename) {
        $filename = "video_{$videoId}.mp4";
    }
    
    file_put_contents($filename, $videoData);
    echo "Video downloaded as {$filename}";
}
?>

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

video_id
string<uuid>
required

Unique identifier for the video

Query Parameters

format
enum<string>
default:mp4

Video format preference

Available options:
mp4,
webm,
mov

Response

Video file

The response is of type file.