Skip to content

Generate Thumbnail

The thumbnail recipe captures a single frame from a video at a specified time and saves it as a JPG or PNG image. Ideal for video previews, social media cards, and content management systems.

Capture a frame 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://example.com/video.mp4"
},
"output": {
"format": "jpg"
},
"recipe": {
"name": "thumbnail",
"seekSeconds": 1
}
}'
{
"jobId": "01JXYZ1234ABCDEF56789000",
"state": "queued"
}
ParameterTypeRequiredDescription
namestringYesMust be "thumbnail"
seekSecondsnumberNoTime in seconds to capture the frame (default: 0)
FormatBest for
jpgSmaller file size, great for web thumbnails
pngLossless quality, supports transparency
{
"mode": "recipe",
"input": { "url": "https://example.com/video.mp4" },
"output": { "format": "jpg" },
"recipe": { "name": "thumbnail", "seekSeconds": 5 }
}
{
"mode": "recipe",
"input": { "url": "https://example.com/video.mp4" },
"output": { "format": "png" },
"recipe": { "name": "thumbnail", "seekSeconds": 3 }
}

For a 10-minute video, grab a frame at the halfway point:

{
"mode": "recipe",
"input": { "url": "https://example.com/webinar.mp4" },
"output": { "format": "jpg" },
"recipe": { "name": "thumbnail", "seekSeconds": 300 }
}

When the job finishes, you get a signed URL to the image:

{
"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",
"width": 1920,
"height": 1080,
"storage_url": "https://cdn.xora.sh/...signed-url..."
}
}
}
ScenarioseekSecondsFormat
Video preview card12jpg
Social media share image35jpg
High-quality screenshotAnypng
E-commerce product video preview0.5jpg