Skip to content

Quickstart

This guide takes you from zero to a completed transcoding job. You’ll generate a thumbnail from a sample video using a single API call.

  1. Create a thumbnail job

    Send a POST to /api/v1/jobs with the thumbnail recipe. This captures a single frame from a video at the 1-second mark:

    Terminal window
    curl -X POST https://api.xora.sh/v1/jobs \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "mode": "recipe",
    "input": {
    "url": "https://samplelib.com/lib/preview/mp4/sample-5s.mp4"
    },
    "output": {
    "format": "jpg"
    },
    "recipe": {
    "name": "thumbnail",
    "seekSeconds": 1
    }
    }'

    You’ll get a 202 Accepted response with the job ID:

    {
    "jobId": "01JXYZ1234ABCDEF56789000",
    "state": "queued"
    }
  2. Check job status

    Poll the job to see its progress. Replace JOB_ID with the jobId from step 1:

    Terminal window
    curl https://api.xora.sh/v1/jobs/JOB_ID \
    -H "Authorization: Bearer YOUR_API_KEY"

    While processing, you’ll see states like probing, transcoding, etc. with a progress percentage:

    {
    "jobId": "01JXYZ1234ABCDEF56789000",
    "state": "transcoding",
    "progress": 50
    }
  3. Download the output

    When state is "completed", the response includes a signed download URL:

    {
    "jobId": "01JXYZ1234ABCDEF56789000",
    "state": "completed",
    "progress": 100,
    "output": {
    "signedUrl": "https://cdn.xora.sh/...signed-url..."
    },
    "output_files": {
    "output": {
    "filename": "output.jpg",
    "file_type": "image",
    "file_format": "jpg",
    "mime_type": "image/jpeg",
    "storage_url": "https://cdn.xora.sh/...signed-url..."
    }
    }
    }

    Open the signedUrl in your browser or download it with curl:

    Terminal window
    curl -o thumbnail.jpg "SIGNED_URL_HERE"

If you’ve saved a preset in the dashboard, you can run a job with just its ID:

Terminal window
curl -X POST https://api.xora.sh/v1/jobs \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"presetId": "YOUR_PRESET_ID",
"input": { "url": "https://example.com/video.mp4" }
}'

Instead of polling, you can pass a webhookUrl to get notified when the job finishes:

Terminal window
curl -X POST https://api.xora.sh/v1/jobs \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "recipe",
"input": { "url": "https://example.com/video.mp4" },
"output": { "format": "jpg" },
"recipe": { "name": "thumbnail", "seekSeconds": 1 },
"webhookUrl": "https://your-server.com/webhook"
}'

Xora will POST the job result to your URL when it reaches a terminal state. See Webhooks.