Bulk Import Status
GET
/api/v1/media/videos/bulk-import/{job_id}Get the current status of a bulk video import job, including progress percentage and per-video results when complete.
Path Parameters
job_idstringrequiredJob ID returned from the bulk import request
Response
job_idstringThe job ID
statusstringJob status: queued, processing, completed, or failed
totalintegerTotal number of videos in the job
completedintegerNumber of videos successfully imported
failedintegerNumber of videos that failed to import
progress_percentnumberProgress percentage (0-100)
resultsarrayPer-video results (only included when job is complete). Each result contains:
url: Original video URLsuccess: Whether import succeededvideo_id: PeerTube video ID (if successful)error: Error message (if failed)
Example
- cURL
- Python
- JavaScript
curl "https://spideriq.ai/api/v1/media/videos/bulk-import/bulk_1234567890" \
-H "Authorization: Bearer cli_abc123:sk_xxx:secret_xxx"
import requests
import time
url = "https://spideriq.ai/api/v1/media/videos/bulk-import/bulk_1234567890"
headers = {"Authorization": "Bearer cli_abc123:sk_xxx:secret_xxx"}
# Poll until complete
while True:
response = requests.get(url, headers=headers)
status = response.json()
print(f"Progress: {status['progress_percent']}%")
if status['status'] in ['completed', 'failed']:
print(f"Final: {status['completed']} succeeded, {status['failed']} failed")
break
time.sleep(30) # Check every 30 seconds
async function waitForCompletion(jobId) {
const url = `https://spideriq.ai/api/v1/media/videos/bulk-import/${jobId}`;
const headers = {"Authorization": "Bearer cli_abc123:sk_xxx:secret_xxx"};
while (true) {
const response = await fetch(url, {headers});
const status = await response.json();
console.log(`Progress: ${status.progress_percent}%`);
if (status.status === 'completed' || status.status === 'failed') {
console.log(`Final: ${status.completed} succeeded, ${status.failed} failed`);
return status;
}
await new Promise(r => setTimeout(r, 30000)); // Wait 30 seconds
}
}
Response Example
{
"job_id": "bulk_1234567890",
"status": "processing",
"total": 10,
"completed": 3,
"failed": 0,
"progress_percent": 30.0,
"results": null
}
{
"job_id": "bulk_1234567890",
"status": "completed",
"total": 10,
"completed": 9,
"failed": 1,
"progress_percent": 100.0,
"results": [
{"url": "https://youtube.com/watch?v=abc", "success": true, "video_id": 123},
{"url": "https://youtube.com/watch?v=def", "success": true, "video_id": 124},
{"url": "https://youtube.com/watch?v=ghi", "success": false, "error": "Video unavailable"}
]
}
note
Polling Recommendation: Check status every 30-60 seconds. More frequent polling provides no benefit as videos take time to download and process.
tip
Webhook Support: For production workflows, consider implementing a webhook endpoint to receive notifications when the job completes, rather than polling.