Skip to main content
POST
/
files
/
{file_id}
/
frames
Create a new frame extraction for a file
curl --request POST \
  --url https://api.cloudglue.dev/v1/files/{file_id}/frames \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "strategy": "uniform",
  "uniform_config": {
    "frames_per_second": 15.05,
    "max_width": 2080
  },
  "thumbnails_config": {
    "enable_frame_thumbnails": true
  },
  "start_time_seconds": 1,
  "end_time_seconds": 1
}
'
import requests

url = "https://api.cloudglue.dev/v1/files/{file_id}/frames"

payload = {
"strategy": "uniform",
"uniform_config": {
"frames_per_second": 15.05,
"max_width": 2080
},
"thumbnails_config": { "enable_frame_thumbnails": True },
"start_time_seconds": 1,
"end_time_seconds": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
strategy: 'uniform',
uniform_config: {frames_per_second: 15.05, max_width: 2080},
thumbnails_config: {enable_frame_thumbnails: true},
start_time_seconds: 1,
end_time_seconds: 1
})
};

fetch('https://api.cloudglue.dev/v1/files/{file_id}/frames', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cloudglue.dev/v1/files/{file_id}/frames",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'strategy' => 'uniform',
'uniform_config' => [
'frames_per_second' => 15.05,
'max_width' => 2080
],
'thumbnails_config' => [
'enable_frame_thumbnails' => true
],
'start_time_seconds' => 1,
'end_time_seconds' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.cloudglue.dev/v1/files/{file_id}/frames"

payload := strings.NewReader("{\n \"strategy\": \"uniform\",\n \"uniform_config\": {\n \"frames_per_second\": 15.05,\n \"max_width\": 2080\n },\n \"thumbnails_config\": {\n \"enable_frame_thumbnails\": true\n },\n \"start_time_seconds\": 1,\n \"end_time_seconds\": 1\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.cloudglue.dev/v1/files/{file_id}/frames")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"strategy\": \"uniform\",\n \"uniform_config\": {\n \"frames_per_second\": 15.05,\n \"max_width\": 2080\n },\n \"thumbnails_config\": {\n \"enable_frame_thumbnails\": true\n },\n \"start_time_seconds\": 1,\n \"end_time_seconds\": 1\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.cloudglue.dev/v1/files/{file_id}/frames")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"strategy\": \"uniform\",\n \"uniform_config\": {\n \"frames_per_second\": 15.05,\n \"max_width\": 2080\n },\n \"thumbnails_config\": {\n \"enable_frame_thumbnails\": true\n },\n \"start_time_seconds\": 1,\n \"end_time_seconds\": 1\n}"

response = http.request(request)
puts response.read_body
{
  "frame_extraction_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": 1,
  "file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "frame_extraction_config": {
    "strategy": "uniform",
    "uniform_config": {
      "frames_per_second": 15.05,
      "max_width": 2080
    },
    "thumbnails_config": {
      "enable_frame_thumbnails": true
    },
    "start_time_seconds": 1,
    "end_time_seconds": 1
  },
  "frame_count": 1,
  "data": {
    "object": "list",
    "total": 123,
    "limit": 123,
    "offset": 123,
    "frames": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "timestamp": 123,
        "thumbnail_url": "<string>"
      }
    ]
  }
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

file_id
string<uuid>
required

The ID of the file to extract frames from

Body

application/json

Frame extraction configuration

Frame extraction configuration (root level) with optional thumbnails configuration.

strategy
enum<string>
required

Frame extraction strategy - currently only 'uniform' is supported

Available options:
uniform
uniform_config
object

Configuration for uniform frame extraction

thumbnails_config
object

Configuration for frame thumbnails. Optional.

start_time_seconds
number

Optional: The start time of the video in seconds to start extracting frames from

Required range: x >= 0
end_time_seconds
number

Optional: The end time of the video in seconds to stop extracting frames at

Required range: x >= 0

Response

Frame extraction created successfully

frame_extraction_id
string<uuid>
required

Unique identifier for the frame extraction job

status
enum<string>
required

Status of the frame extraction job

Available options:
pending,
processing,
completed,
failed
created_at
number
required

Unix timestamp in milliseconds when the frame extraction was created

Required range: x >= 0
file_id
string<uuid>
required

ID of the file this frame extraction belongs to

frame_extraction_config
object
required

Configuration for frame extraction. Currently only supports uniform strategy.

frame_count
number

Total number of frames extracted (only present when status is completed)

Required range: x >= 0
data
object

Frame data with pagination (only present when status is completed and frames exist)