apyhub
Back
▣ INGESTION KIT · MEDIA KIT

Extract Video Frames API

What it does

The Video Frame Extractor API returns still frames from one or more video links. Send mode as count, scenes, interval, or timestamps. Use frameCount in count mode, everySeconds in interval mode, and timestamps for exact times. You can also set width, format, quality, contactSheet, maxVideoMinutes, and maxFramesPerVideo.

Send public links to MP4, MOV, WebM, MKV, or M4V files in videoUrls. The API skips non file page links like YouTube or Instagram. width keeps the aspect ratio and never upscales. sceneThreshold controls how sensitive scene detection is.

Teams use the Video Frame Extractor API to build keyframes for review screens and video search. They also make contact sheets for fast checks and moderation. The response gives the frame count and an items list with the extracted frame results.

POST
Extract Frames from Video - Keyframes, Scene Detection, MCP
https://api.eu.apyhub.com/martin10291/extract-video-frames

QUICKSTART

GUIDE

Quickstart

Extract a few frames from a video URL using the default count mode.

curl -X POST "https://api.eu.apyhub.com/martin10291/extract-video-frames" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "count",
    "format": "jpg",
    "videoUrls": [
      "https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4"
    ],
    "frameCount": 8
  }'

What you'll get back

Returns a JSON object with a count integer and an items array: one row per extracted frame, plus one contact sheet per video (send "contactSheet": false to skip it). Example (shortened to 2 of the 8 frames):

{
  "count": 3,
  "items": [
    {
      "type": "frame",
      "videoUrl": "https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4",
      "mode": "count",
      "frameIndex": 0,
      "timestampSec": 0.625,
      "timecode": "00:00:00.625",
      "width": 640,
      "height": 360,
      "imageUrl": "https://radarbg.com/m/f/q0CSpN4g3oH7X6lIC/1-001.jpg?s=e99wycjQG7CPh1PuVXLH",
      "key": "1-001.jpg",
      "sceneScore": null,
      "videoWidth": 640,
      "videoHeight": 360,
      "durationSec": 10,
      "fps": 30,
      "extractedAt": "2026-11-25T10:51:43Z"
    },
    {
      "type": "frame",
      "videoUrl": "https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4",
      "mode": "count",
      "frameIndex": 1,
      "timestampSec": 1.875,
      "timecode": "00:00:01.875",
      "width": 640,
      "height": 360,
      "imageUrl": "https://radarbg.com/m/f/q0CSpN4g3oH7X6lIC/1-002.jpg?s=iFkt0pCcFph6LVUCG2EK",
      "key": "1-002.jpg",
      "sceneScore": null,
      "videoWidth": 640,
      "videoHeight": 360,
      "durationSec": 10,
      "fps": 30,
      "extractedAt": "2026-11-25T10:51:43Z"
    },
    {
      "type": "contact_sheet",
      "videoUrl": "https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4",
      "mode": "count",
      "frames": 8,
      "width": 1310,
      "height": 378,
      "imageUrl": "https://radarbg.com/m/f/q0CSpN4g3oH7X6lIC/1-sheet.jpg?s=MrXdjOet9Qe9DVP9XHMN",
      "key": "1-sheet.jpg",
      "videoWidth": 640,
      "videoHeight": 360,
      "durationSec": 10,
      "fps": 30,
      "extractedAt": "2026-11-25T10:51:44Z"
    }
  ]
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body
scenes = a frame at every scene change (ffmpeg scene detection). interval = one frame every N seconds. count = N evenly spaced frames. timestamps = exact times you list.
Resize frames to this width, keeping the aspect ratio. Never upscales. 0 keeps the original size.
Image format of the extracted frames. jpg is smallest, png is lossless, webp is a good compromise.

About this endpoint

What it does

Extracts frames from one or more video URLs and returns a JSON object containing the total frame count and an items array of result objects.

Request Body

ParameterTypeMandatoryDescription
modeENUMYesExtraction mode. Allowed values: count (extract frameCount evenly spaced frames), scenes (extract a frame at every scene change), interval (extract one frame every everySeconds seconds), timestamps (extract frames at the exact times listed in timestamps).
widthIntegerNoResize frames to this width while keeping aspect ratio. Never upscales. 0 keeps the original size.
formatENUMNoOutput image format. Allowed values: jpg, png, webp. jpg is smallest, png is lossless, webp is a compromise.
qualityIntegerNoQuality for jpg and webp, from 1 to 100. Higher values produce better quality and larger files. Ignored for png.
videoUrlsString ArrayNoDirect links to video files. Supported file types include mp4, mov, webm, mkv, and m4v. Links must be public and point directly to the file. YouTube, TikTok, Instagram, and Facebook page links are not supported and are skipped.
frameCountIntegerNoUsed in count mode. Number of evenly spaced frames to extract per video, limited by maxFramesPerVideo.
timestampsString ArrayNoUsed in timestamps mode. Times to extract, as seconds such as 12.5 or as HH:MM:SS such as 00:01:02.5. Times beyond the video end are skipped.
contactSheetBooleanNoAlso creates one tiled grid image per video with all frames and their timecodes. This adds one extra result row of type contact_sheet.
everySecondsNumberNoUsed in interval mode. Extracts one frame every this many seconds, starting at 0.
sceneThresholdNumberNoUsed in scenes mode. Sensitivity from 0.01 to 1. Lower values detect more scene changes; higher values detect only hard cuts.
maxVideoMinutesIntegerNoSkips videos longer than this many minutes. Safety guard against huge files and surprise cost.
maxFramesPerVideoIntegerNoHard cap on frames per video in any mode. Maximum 500.

Response

Returns a JSON object with a count integer field and an items array. Each item is one extracted frame (type: frame) or one contact sheet per video (type: contact_sheet). Success response uses 200.

ParameterTypeDescription
countIntegerTotal number of result rows in items (frames plus contact sheets).
itemsObject ArrayArray of result rows, one per extracted frame and one per contact sheet.
items[].typeStringframe for an extracted frame, or contact_sheet for the tiled overview image.
items[].videoUrlStringThe video URL this row came from.
items[].modeStringExtraction mode used: count, scenes, interval or timestamps.
items[].frameIndexIntegerPosition of the frame in the results for this video, starting at 0. null for contact sheets.
items[].timestampSecNumberTime of the frame in the video, in seconds. null for contact sheets.
items[].timecodeStringTime of the frame as HH:MM:SS.mmm. null for contact sheets.
items[].sceneScoreNumberScene-change score (0–1) in scenes mode. null in other modes.
items[].framesIntegerNumber of frames in the contact sheet (contact_sheet rows only).
items[].imageUrlStringLink to the extracted image (jpg, png or webp).
items[].keyStringFile name of the image, e.g. 1-001.jpg or 1-sheet.jpg.
items[].widthIntegerWidth of the output image in pixels.
items[].heightIntegerHeight of the output image in pixels.
items[].videoWidthIntegerWidth of the source video in pixels.
items[].videoHeightIntegerHeight of the source video in pixels.
items[].durationSecNumberLength of the source video in seconds.
items[].fpsNumberFrame rate of the source video.
items[].extractedAtStringTime the image was extracted (ISO 8601, UTC).
items[].cachedBooleantrue if the result was served from cache.
items[].cacheAgeSecondsIntegerAge of the cached result in seconds (only when cached is true).
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.