Quick Start
First, make sure you have Cloudglue set up by following the setup guide.
Using Cloudglue’s Extract API, transform your video content into programmable, structured data that you can easily integrate into your applications. In this guide, we’ll demonstrate a simple schema that extracts basic concepts like people, objects, and locations - but you can define any custom schema that matches your specific needs and downstream applications.
from cloudglue import CloudGlue
# Initialize client (API key will be loaded from environment)
client = CloudGlue()
# Upload your video file
uploaded = client.files.upload(
'path/to/local/video.mp4',
wait_until_finish=True
)
# Define the extraction schema
schema = {
"people": ["string"],
"objects": ["string"],
"locations": ["string"]
}
# Start extraction using the uploaded file URI
extraction = client.extract.run(
url=uploaded.uri,
prompt="Extract all people, notable objects, and locations that appear in this video",
schema=schema,
)
# Print the results
print(extraction.data)
For more details about the Python SDK, check out our Python SDK Documentation.
from cloudglue import CloudGlue
# Initialize client (API key will be loaded from environment)
client = CloudGlue()
# Upload your video file
uploaded = client.files.upload(
'path/to/local/video.mp4',
wait_until_finish=True
)
# Define the extraction schema
schema = {
"people": ["string"],
"objects": ["string"],
"locations": ["string"]
}
# Start extraction using the uploaded file URI
extraction = client.extract.run(
url=uploaded.uri,
prompt="Extract all people, notable objects, and locations that appear in this video",
schema=schema,
)
# Print the results
print(extraction.data)
For more details about the Python SDK, check out our Python SDK Documentation.
/// <reference lib="dom" />
import { CloudGlue } from '@aviaryhq/cloudglue-js';
import * as fs from 'fs';
import * as path from 'path';
const client = new CloudGlue();
const filePath = 'path/to/video.mp4';
// Read and prepare file for upload
const fileBuffer = await fs.promises.readFile(filePath);
const file = new File([fileBuffer], path.basename(filePath));
// Upload and wait for file processing
const uploadResult = await client.files.uploadFile({ file });
const fileDetails = await client.files.waitForReady(uploadResult.id);
// Define the extraction schema
const schema = {
people: ["string"],
objects: ["string"],
locations: ["string"]
};
// Start extraction and wait for completion
const job = await client.extract.createExtract(
fileDetails.uri,
{
prompt: "Extract all people, notable objects, and locations that appear in this video",
schema: schema
}
);
const extractJob = await client.extract.waitForReady(extractJob.job_id);
console.log(extractJob.data);
For more details about the Node.js SDK, check out our JavaScript SDK Documentation.
For more detailed examples and advanced usage, check out our API Reference.