DeepSwapAI Logo - Professional Face Swap Platform
Deep Swap AI
GET

/v1/status/{job_id}

Check the processing status of asynchronous jobs (video swap, batch processing) and retrieve results when complete.

Path Parameters

ParameterTypeDescription
job_idstringThe job ID returned from video-swap or batch-swap requests

Status Values

queuedJob is waiting in the processing queue
processingJob is actively being processed
completedJob finished successfully, results available
failedJob failed, check error field for details

Code Examples

PyPython - Polling

import deepswapai
import time

client = deepswapai.Client(api_key="YOUR_API_KEY")

job_id = "vjob_xyz789abc"

while True:
    status = client.get_status(job_id)
    print(f"Status: {status.status}, Progress: {status.progress}%")
    
    if status.status == "completed":
        print(f"Output URL: {status.output_url}")
        break
    elif status.status == "failed":
        print(f"Error: {status.error}")
        break
    
    time.sleep(5)  # Poll every 5 seconds

$cURL

curl -X GET "https://api.deepswapai.com/v1/status/vjob_xyz789abc" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Examples

Video Job - Processing

{
  "success": true,
  "job_id": "vjob_xyz789abc",
  "type": "video_swap",
  "status": "processing",
  "progress": 45,
  "current_frame": 270,
  "total_frames": 600,
  "estimated_remaining": 55
}

Video Job - Completed

{
  "success": true,
  "job_id": "vjob_xyz789abc",
  "type": "video_swap",
  "status": "completed",
  "progress": 100,
  "output_url": "https://cdn.deepswapai.com/results/xyz789.mp4",
  "output_format": "mp4",
  "resolution": "1920x1080",
  "duration": 45.2,
  "file_size": 28456789,
  "processing_time": 118500,
  "credits_used": 48,
  "expires_at": "2026-01-29T12:00:00Z"
}

Batch Job - Partial Complete

{
  "success": true,
  "job_id": "batch_abc123",
  "type": "batch_swap",
  "status": "processing",
  "total_images": 50,
  "completed": 35,
  "failed": 2,
  "progress": 74,
  "partial_results": [
    {
      "index": 0,
      "success": true,
      "output_url": "https://cdn.deepswapai.com/batch/abc_0.png"
    }
    // ... available results
  ]
}

⚡ Polling Best Practices

  • Use exponential backoff - Start at 2s, increase to max 30s between polls
  • Prefer webhooks for production - Eliminates polling overhead entirely
  • Cache job IDs - Store them to resume status checks after app restart
  • Download immediately - Output URLs expire after 24 hours

Related