Skip to main content

Download Video

Get a pre-signed URL to download a completed video.

Endpoint

GET /api/v1/video/download/{projectId}

Headers

HeaderRequiredDescription
X-API-KeyYesYour API key

Path Parameters

ParameterTypeDescription
projectIdstringThe project ID returned from /video/generate

Prerequisites

The video must have status: "completed" before calling this endpoint.

Check status first:

curl https://reelbot.space/api/v1/video/status/{projectId} \
-H "X-API-Key: rb_live_your_key_here"

Response

Success Response (200)

{
"success": true,
"downloadUrl": "https://reelbot-assets.s3.amazonaws.com/users/abc123/output/video-xyz789.mp4?X-Amz-Algorithm=...",
"expiresAt": "2025-01-21T17:30:00.000Z"
}

Response Fields

FieldTypeDescription
successbooleanAlways true for success
downloadUrlstringPre-signed S3 URL for download
expiresAtstringISO 8601 timestamp when URL expires

URL Expiration

PropertyValue
Expiration time1 hour from request
RenewableYes, call endpoint again for new URL

Using the Download URL

Direct Download (Browser)

Simply open the downloadUrl in a browser to download the file.

cURL Download

# Get the download URL
RESPONSE=$(curl -s https://reelbot.space/api/v1/video/download/abc123def456 \
-H "X-API-Key: rb_live_your_key_here")

# Extract the URL (using jq)
DOWNLOAD_URL=$(echo $RESPONSE | jq -r '.downloadUrl')

# Download the file
curl -o my-video.mp4 "$DOWNLOAD_URL"

Node.js Download

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

async function downloadVideo(projectId, apiKey, outputPath) {
// Get download URL
const response = await fetch(
`https://reelbot.space/api/v1/video/download/${projectId}`,
{ headers: { 'X-API-Key': apiKey } }
);

const { downloadUrl } = await response.json();

// Download file
return new Promise((resolve, reject) => {
const file = fs.createWriteStream(outputPath);
https.get(downloadUrl, (response) => {
response.pipe(file);
file.on('finish', () => {
file.close();
resolve(outputPath);
});
}).on('error', reject);
});
}

// Usage
await downloadVideo('abc123def456', 'rb_live_...', './output.mp4');

Python Download

import requests

def download_video(project_id, api_key, output_path):
# Get download URL
response = requests.get(
f'https://reelbot.space/api/v1/video/download/{project_id}',
headers={'X-API-Key': api_key}
)
data = response.json()

# Download file
video_response = requests.get(data['downloadUrl'], stream=True)
with open(output_path, 'wb') as f:
for chunk in video_response.iter_content(chunk_size=8192):
f.write(chunk)

return output_path

# Usage
download_video('abc123def456', 'rb_live_...', './output.mp4')

Error Responses

400 Bad Request (Video Not Ready)

{
"success": false,
"message": "Video is not ready for download. Current status: processing",
"code": "VIDEO_NOT_READY",
"details": {
"status": "processing"
}
}

Solution: Wait for status to be completed before requesting download.

401 Unauthorized

{
"success": false,
"message": "Unauthorized. Please provide a valid API key via the X-API-Key header.",
"code": "UNAUTHORIZED"
}

404 Not Found

{
"success": false,
"message": "Project not found",
"code": "NOT_FOUND"
}

429 Too Many Requests

{
"success": false,
"message": "Rate limit exceeded. Please try again later.",
"code": "RATE_LIMITED",
"details": {
"resetAt": "2025-01-21T17:00:00.000Z"
}
}

Output File Details

PropertyValue
FormatMP4 (H.264)
AudioAAC
ResolutionDepends on aspectRatio
Filenamereelbot-video-{projectId}.mp4

Resolution by Aspect Ratio

Aspect RatioResolution
9:161080 x 1920
16:91920 x 1080
1:11080 x 1080

Complete Workflow Example

#!/bin/bash
API_KEY="rb_live_your_key_here"
PROJECT_ID="abc123def456"

# 1. Check if video is ready
STATUS=$(curl -s "https://reelbot.space/api/v1/video/status/$PROJECT_ID" \
-H "X-API-Key: $API_KEY" | jq -r '.status')

if [ "$STATUS" != "completed" ]; then
echo "Video not ready. Status: $STATUS"
exit 1
fi

# 2. Get download URL
DOWNLOAD_URL=$(curl -s "https://reelbot.space/api/v1/video/download/$PROJECT_ID" \
-H "X-API-Key: $API_KEY" | jq -r '.downloadUrl')

# 3. Download the video
curl -o "video-$PROJECT_ID.mp4" "$DOWNLOAD_URL"

echo "Downloaded: video-$PROJECT_ID.mp4"

Next Steps

Error Handling — Handle errors gracefully

Examples — Complete end-to-end examples