Extract Video Frames
curl --request POST \
--url https://mavi-backend.memories.ai/serve/api/v2/video/extract-frames \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"asset_id": "re_657739295220518912"
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/video/extract-frames"
payload = { "asset_id": "re_657739295220518912" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({asset_id: 're_657739295220518912'})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/video/extract-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://mavi-backend.memories.ai/serve/api/v2/video/extract-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([
'asset_id' => 're_657739295220518912'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://mavi-backend.memories.ai/serve/api/v2/video/extract-frames"
payload := strings.NewReader("{\n \"asset_id\": \"re_657739295220518912\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://mavi-backend.memories.ai/serve/api/v2/video/extract-frames")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"asset_id\": \"re_657739295220518912\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/video/extract-frames")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset_id\": \"re_657739295220518912\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"task_id": "1e8ae1075e054e8abb58e7598c53cbf1"
},
"failed": false,
"success": true
}
{
"code": 200,
"message": "SUCCESS",
"data": {
"asset_ch_ids": [
"imc_666914042514116608_0",
"imc_666914042514116608_1",
"imc_666914042514116608_2",
"..."
],
"asset_id": "im_666914042514116608"
},
"task_id": "90b7eaf351824f3ba88229eaf2bf7c3d"
}
Asset Management
Extract Video Frames
Extract individual frames from a video asset
POST
/
video
/
extract-frames
Extract Video Frames
curl --request POST \
--url https://mavi-backend.memories.ai/serve/api/v2/video/extract-frames \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"asset_id": "re_657739295220518912"
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/video/extract-frames"
payload = { "asset_id": "re_657739295220518912" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({asset_id: 're_657739295220518912'})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/video/extract-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://mavi-backend.memories.ai/serve/api/v2/video/extract-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([
'asset_id' => 're_657739295220518912'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://mavi-backend.memories.ai/serve/api/v2/video/extract-frames"
payload := strings.NewReader("{\n \"asset_id\": \"re_657739295220518912\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://mavi-backend.memories.ai/serve/api/v2/video/extract-frames")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"asset_id\": \"re_657739295220518912\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/video/extract-frames")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset_id\": \"re_657739295220518912\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"task_id": "1e8ae1075e054e8abb58e7598c53cbf1"
},
"failed": false,
"success": true
}
{
"code": 200,
"message": "SUCCESS",
"data": {
"asset_ch_ids": [
"imc_666914042514116608_0",
"imc_666914042514116608_1",
"imc_666914042514116608_2",
"..."
],
"asset_id": "im_666914042514116608"
},
"task_id": "90b7eaf351824f3ba88229eaf2bf7c3d"
}
Product: Visual Intelligence — Asset Management
Use case: Upload, manage, and download video/image assets used by other Visual Intelligence APIs
Host:
https://mavi-backend.memories.ai/serve/api/v2
Auth: Authorization: sk-mavi-... (no Bearer prefix)This is an async endpoint. You must configure a webhook URL in Webhooks Settings before calling this endpoint, otherwise you will not receive the processing results. See Webhooks Configuration Guide for details.
Pricing:
- $0.01/second of video
Code Examples
const BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2";
const API_KEY = "sk-mavi-...";
const response = await fetch(`${BASE_URL}/video/extract-frames`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': API_KEY
},
body: JSON.stringify({
asset_id: 're_657739295220518912'
})
});
const data = await response.json();
console.log(data);
import axios from 'axios';
const BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2";
const API_KEY = "sk-mavi-...";
const response = await axios.post(`${BASE_URL}/video/extract-frames`, {
asset_id: 're_657739295220518912'
}, {
headers: {
'Authorization': API_KEY
}
});
console.log(response.data);
import requests
BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2"
API_KEY = "sk-mavi-..."
HEADERS = {
"Authorization": f"{API_KEY}"
}
def extract_frames(asset_id):
url = f"{BASE_URL}/video/extract-frames"
data = {"asset_id": asset_id}
response = requests.post(url, json=data, headers=HEADERS)
return response.json()
# Usage example
result = extract_frames("re_657739295220518912")
print(result)
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| asset_id | string | Yes | The video asset ID to extract frames from |
Response
Returns task information for the frame extraction operation.{
"code": 200,
"msg": "success",
"data": {
"task_id": "1e8ae1075e054e8abb58e7598c53cbf1"
},
"failed": false,
"success": true
}
{
"code": 200,
"message": "SUCCESS",
"data": {
"asset_ch_ids": [
"imc_666914042514116608_0",
"imc_666914042514116608_1",
"imc_666914042514116608_2",
"..."
],
"asset_id": "im_666914042514116608"
},
"task_id": "90b7eaf351824f3ba88229eaf2bf7c3d"
}
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | string | Response code indicating the result status |
| msg | string | Response message describing the operation result |
| data | object | Response data object containing task information |
| data.task_id | string | Unique identifier of the frame extraction task |
| success | boolean | Indicates whether the operation was successful |
| failed | boolean | Indicates whether the operation failed |
Callback Response Parameters
When the frame extraction is complete, a callback will be sent to your configured webhook URL.| Parameter | Type | Description |
|---|---|---|
| code | string | Response code (200 indicates success) |
| message | string | Status message (e.g., “SUCCESS”) |
| data | object | Response data object containing the extracted frame information |
| data.asset_ch_ids | array | Array of individual frame asset IDs. Use any asset_ch_id with the Download or Get Metadata endpoint to download or query a single frame image. |
| data.asset_id | string | The parent group asset ID for the entire frame collection. Use this ID with the Download endpoint to download all frames as a zip package, or with Get Metadata to list all frames in this collection. |
| task_id | string | The task ID associated with this frame extraction request |
Using the Returned IDs
Frame IDs follow the patternimc_<parent_id>_<frame_index> (0-indexed).
| ID | Download returns | Get Metadata returns |
|---|---|---|
data.asset_id (e.g. im_666914042514116608) | Zip of all frames | List of all frames in the collection |
data.asset_ch_ids[n] (e.g. imc_666914042514116608_0) | Single frame image | Metadata for that frame |
download_asset("imc_666914042514116608_0") # single frame
download_asset("im_666914042514116608") # all frames as zip
Authorizations
Body
application/json
The video asset ID to extract frames from
Example:
"re_657739295220518912"
Response
200 - application/json
Frame extraction initiated successfully
Response code indicating the result status
Example:
200
Response message describing the operation result
Example:
"success"
Response data object containing task information
Show child attributes
Show child attributes
Indicates whether the operation was successful
Example:
true
Indicates whether the operation failed
Example:
false
⌘I
