/videos
List all the video objects that are associated with the current workspace.
title
string
The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles.
tags[]
array[string]
A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned.
string
metadata
object (metadata)
Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. Dynamic Metadata allows you to define a key that allows any value pair.
description
string
Retrieve video objects by description
.
liveStreamId
string
Retrieve video objects that were recorded from a live stream by liveStreamId
.
sortBy
string
Use this parameter to sort videos by the their created time, published time, updated time, or by title.
sortOrder
string
Use this parameter to sort results. asc
is ascending and sorts from A to Z. desc
is descending and sorts from Z to A.
currentPage
int
Choose the number of search results to return per page. Minimum value: 1
pageSize
int
Results per page. Allowed values 1-100, default is 25.
apiKey
Too Many Requests
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Bad Request
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
name
string
The name of the parameter that caused the error.
status
int
The HTTP status code.
problems
array[object (BadRequest)]
Returns any additional problems in the request in an array of objects.
BadRequest
object (BadRequest)
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
name
string
The name of the parameter that caused the error.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Success
data
array[object (Video)]
required
Video
object (Video)
videoId
string
required
The unique identifier of the video object.
createdAt
string
When a video was created, presented in ISO-8601 format.
title
string
The title of the video content.
description
string
A description for the video content.
publishedAt
string
The date and time the API created the video. Date and time are provided using ISO-8601 UTC format.
updatedAt
string
The date and time the video was updated. Date and time are provided using ISO-8601 UTC format.
tags
array[string]
One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces.
string
metadata
array[object (Metadata)]
Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. Dynamic Metadata allows you to define a key that allows any value pair.
Metadata
object (Metadata)
key
string
The constant that defines the data set.
value
string
A variable which belongs to the data set.
source
object (source)
Source information about the video.
uri
string
The URL where the video is stored.
type
string
liveStream
object (liveStream)
This appears if the video is from a Live Record.
liveStreamId
string
The unique identifier for the live stream.
links
array[object]
object
rel
string
uri
string
assets
object (assets)
Collection of details about the video object that you can use to work with the video object.
hls
string
This is the manifest URL. For HTTP Live Streaming (HLS), when a HLS video stream is initiated, the first file to download is the manifest. This file has the extension M3U8, and provides the video player with information about the various bitrates available for streaming.
iframe
string
Code to use video from a third party website
player
string
Raw url of the player.
thumbnail
string
Poster of the video.
mp4
string
Available only if mp4Support is enabled. Raw mp4 url.
playerId
string
The id of the player that will be applied on the video.
public
boolean
Defines if the content is publicly reachable or if a unique token is needed for each play session. Default is true. Tutorials on private videos.
panoramic
boolean
Defines if video is panoramic.
mp4Support
boolean
This lets you know whether mp4 is supported. If enabled, an mp4 URL will be provided in the response for the video.
pagination
object (pagination)
required
itemsTotal
int
Total number of items that exist.
pagesTotal
int
Number of items listed in the current page.
pageSize
int
Maximum number of item per page.
currentPage
int
The current page index.
currentPageItems
int
The number of items on the current page.
links
array[object (PaginationLink)]
required
PaginationLink
object (PaginationLink)
rel
string
uri
string
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/VideosApi.md#list
require __DIR__ . '/vendor/autoload.php';
$client = new \ApiVideo\Client\Client(
'https://ws.api.video',
'YOUR_API_KEY',
new \Symfony\Component\HttpClient\Psr18Client()
);
// list all videos (all pages)
$allVideos = [];
do {
$currentPage = $client->videos()->list([]);
$allVideos = array_merge($allVideos, $currentPage->getData());
} while($currentPage->getPagination()->getCurrentPage() < $currentPage->getPagination()->getPagesTotal());
// list videos that have all the given tags (only first results page)
$videosWithTag = $client->videos()->list(['tags' => ['TAG2','TAG1']]);
// list videos that have all the given metadata values (only first results page)
$videosWithMetadata = $client->videos()->list(['metadata' => ['key1' => 'key1value1', 'key2' => 'key2value1']]);
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/VideosApi.md#list
ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
VideosApi videosApi = client.videos();
// list all videos (all pages)
Page<Video> videosPages = videosApi.list().execute();
videosPages.forEach(videosPage -> videosPage.getItems().forEach(video ->
System.out.println(video.getVideoId())
));
// list videos that have all the given tags (only first results page)
List<Video> videosWithTags = videosApi.list()
.tags(Arrays.asList("tag1", "tag2"))
.execute()
.getItems();
// list videos that have all the given metadata values (only first results page)
List<Video> videosWithMetadata = videosApi.list()
.metadata(Map.of("key1", "value1", "key2", "value2"))
.execute()
.getItems();
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/VideosApi.md#list
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });
// list all videos (all pages)
let allVideos = [];
for(let currentPage=1 ; ; currentPage++) {
const res = await client.videos.list({ currentPage });
allVideos = [...allVideos, ...res.data];
if(currentPage >= res.pagination.pagesTotal) {
break;
}
}
// list videos that have all the given tags (only first results page)
const videosWithTags = await client.videos.list({ tags: ["tag1", "tag2"] });
// list videos that have all the given metadata values (only first results page)
const videosWithMetadata = await client.videos.list({ metadata: { "key1": "value1", "key2": "value2" } })
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/VideosApi.md#list
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/VideosApi.md#list
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#list
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideosAPI.md#list
Success
{
"data": [
{
"videoId": "vi4blUQJFrYWbaG44NChkH27",
"playerId": "pl45KFKdlddgk654dspkze",
"title": "Maths video",
"description": "An amazing video explaining the string theory",
"public": false,
"panoramic": false,
"mp4Support": true,
"tags": [
"maths",
"string theory",
"video"
],
"metadata": [
{
"key": "Author",
"value": "John Doe"
},
{
"key": "Format",
"value": "Tutorial"
}
],
"publishedAt": "2019-12-16T08:25:51.000Z",
"updatedAt": "2019-12-16T08:48:49.000Z",
"source": {
"uri": "/videos/c188ed58-3403-46a2-b91b-44603d10b2c9/source"
},
"assets": {
"iframe": "<iframe src=\"https://embed.api.video/vod/vi4blUQJFrYWbaG44NChkH27\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
"player": "https://embed.api.video/vod/vi4blUQJFrYWbaG44NChkH27",
"hls": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/hls/manifest.m3u8",
"thumbnail": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/thumbnail.jpg",
"mp4": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/mp4/source.mp4"
}
},
{
"videoId": "vi4blUQJFrYWbaG44NChkH27",
"title": "Video Title",
"description": "A description for your video.",
"public": false,
"panoramic": false,
"mp4Support": true,
"tags": [
"books",
"short stories"
],
"metadata": [
{
"key": "Author",
"value": "John Doe"
},
{
"key": "Science Fiction",
"value": "Cyberpunk"
},
{
"key": "Technology",
"value": "Computers"
}
],
"publishedAt": "2019-12-16T08:25:51.000Z",
"updatedAt": "2019-12-16T08:48:49.000Z",
"source": {
"uri": "/videos/vi4blUQJFrYWbaG44NChkH27/source"
},
"assets": {
"iframe": "<iframe src=\"https://embed.api.video/vod/vi4blUQJFrYWbaG44NChkH27\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
"player": "https://embed.api.video/vod/vi4blUQJFrYWbaG44NChkH27",
"hls": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/hls/manifest.m3u8",
"thumbnail": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/thumbnail.jpg",
"mp4": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/mp4/source.mp4"
}
},
{
"videoId": "vi4blUQJFrYWbaG44NChkH27",
"playerId": "pl45KFKdlddgk654dspkze",
"title": "My Video Title",
"description": "A brief description of the video.",
"public": false,
"panoramic": false,
"mp4Support": true,
"tags": [
"General",
"Videos"
],
"metadata": [
{
"key": "Length",
"value": "Short"
}
],
"publishedAt": "2019-12-16T08:25:51.000Z",
"updatedAt": "2019-12-16T08:48:49.000Z",
"source": {
"uri": "/videos/vi4blUQJFrYWbaG44NChkH27/source"
},
"assets": {
"iframe": "<iframe src=\"https://embed.api.video/vod/vi4blUQJFrYWbaG44NChkH27\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
"player": "https://embed.api.video/vod/vi4blUQJFrYWbaG44NChkH27",
"hls": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/hls/manifest.m3u8",
"thumbnail": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/thumbnail.jpg",
"mp4": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/mp4/source.mp4"
}
}
],
"pagination": {
"currentPage": 1,
"pageSize": 25,
"pagesTotal": 1,
"itemsTotal": 11,
"currentPageItems": 11,
"links": [
{
"rel": "self",
"uri": "https://ws.api.video/videos?currentPage=1"
},
{
"rel": "first",
"uri": "https://ws.api.video/videos?currentPage=1"
},
{
"rel": "last",
"uri": "https://ws.api.video/videos?currentPage=1"
}
]
}
}
Bad Request
{
"title": "This parameter is out of the allowed range of values.",
"name": "page",
"status": 400,
"range": {
"min": 1
},
"problems": [
{
"title": "This parameter is out of the allowed range of values.",
"name": "page",
"range": {
"min": 1
}
},
{
"title": "This parameter is out of the allowed range of values.",
"name": "pageSize",
"range": {
"min": 10,
"max": 100
}
}
]
}
Too Many Requests
{
"type": "https://docs.api.video/reference/too-many-requests",
"title": "Too many requests.",
"status": 429
}
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
/videos
Creates a video object. More information on video objects can be found here.
title
string
required
The title of your new video.
description
string
A brief description of your video.
source
string
You can either add a video already on the web, by entering the URL of the video, or you can also enter the videoId
of one of the videos you already have on your api.video acccount, and this will generate a copy of your video. Creating a copy of a video can be especially useful if you want to keep your original video and trim or apply a watermark onto the copy you would create.
public
boolean
Default: True. If set to false
the video will become private. More information on private videos can be found here
panoramic
boolean
Indicates if your video is a 360/immersive video.
mp4Support
boolean
Enables mp4 version in addition to streamed version.
playerId
string
The unique identification number for your video player.
tags
array[string]
A list of tags you want to use to describe your video.
string
metadata
array[object (Metadata)]
A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. Read more on dynamic metadata.
Metadata
object (Metadata)
key
string
The constant that defines the data set.
value
string
A variable which belongs to the data set.
clip
object (clip)
Use this object to create a smaller clip from a video you upload.
startTimecode
string
The timestamp that defines the beginning of the video clip you want to create. The value must follow the HH:MM:SS
format.
endTimecode
string
The timestamp that defines the end of the video clip you want to create. The value must follow the HH:MM:SS
format.
watermark
object (watermark)
id
string
id of the watermark
top
string
Distance expressed in px or % between the top-border of the video and the watermark-image.
left
string
Distance expressed in px or % between the left-border of the video and the watermark-image.
bottom
string
Distance expressed in px or % between the bottom-border of the video and the watermark-image.
right
string
Distance expressed in px or % between the right-border of the video and the watermark-image.
width
string
Width of the watermark-image relative to the video if expressed in %. Otherwise a fixed width. NOTE: To keep intrinsic watermark-image width use initial
.
height
string
Height of the watermark-image relative to the video if expressed in %. Otherwise a fixed height. NOTE: To keep intrinsic watermark-image height use initial
.
opacity
string
Opacity expressed in % only to specify the degree of the watermark-image transparency with the video.
apiKey
Too Many Requests
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Bad Request
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
name
string
The name of the parameter that caused the error.
status
int
The HTTP status code.
problems
array[object (BadRequest)]
Returns any additional problems in the request in an array of objects.
BadRequest
object (BadRequest)
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
name
string
The name of the parameter that caused the error.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Created
videoId
string
required
The unique identifier of the video object.
createdAt
string
When a video was created, presented in ISO-8601 format.
title
string
The title of the video content.
description
string
A description for the video content.
publishedAt
string
The date and time the API created the video. Date and time are provided using ISO-8601 UTC format.
updatedAt
string
The date and time the video was updated. Date and time are provided using ISO-8601 UTC format.
tags
array[string]
One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces.
string
metadata
array[object (Metadata)]
Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. Dynamic Metadata allows you to define a key that allows any value pair.
Metadata
object (Metadata)
key
string
The constant that defines the data set.
value
string
A variable which belongs to the data set.
source
object (source)
Source information about the video.
uri
string
The URL where the video is stored.
type
string
liveStream
object (liveStream)
This appears if the video is from a Live Record.
liveStreamId
string
The unique identifier for the live stream.
links
array[object]
object
rel
string
uri
string
assets
object (assets)
Collection of details about the video object that you can use to work with the video object.
hls
string
This is the manifest URL. For HTTP Live Streaming (HLS), when a HLS video stream is initiated, the first file to download is the manifest. This file has the extension M3U8, and provides the video player with information about the various bitrates available for streaming.
iframe
string
Code to use video from a third party website
player
string
Raw url of the player.
thumbnail
string
Poster of the video.
mp4
string
Available only if mp4Support is enabled. Raw mp4 url.
playerId
string
The id of the player that will be applied on the video.
public
boolean
Defines if the content is publicly reachable or if a unique token is needed for each play session. Default is true. Tutorials on private videos.
panoramic
boolean
Defines if video is panoramic.
mp4Support
boolean
This lets you know whether mp4 is supported. If enabled, an mp4 URL will be provided in the response for the video.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Accepted
videoId
string
required
The unique identifier of the video object.
createdAt
string
When a video was created, presented in ISO-8601 format.
title
string
The title of the video content.
description
string
A description for the video content.
publishedAt
string
The date and time the API created the video. Date and time are provided using ISO-8601 UTC format.
updatedAt
string
The date and time the video was updated. Date and time are provided using ISO-8601 UTC format.
tags
array[string]
One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces.
string
metadata
array[object (Metadata)]
Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. Dynamic Metadata allows you to define a key that allows any value pair.
Metadata
object (Metadata)
key
string
The constant that defines the data set.
value
string
A variable which belongs to the data set.
source
object (source)
Source information about the video.
uri
string
The URL where the video is stored.
type
string
liveStream
object (liveStream)
This appears if the video is from a Live Record.
liveStreamId
string
The unique identifier for the live stream.
links
array[object]
object
rel
string
uri
string
assets
object (assets)
Collection of details about the video object that you can use to work with the video object.
hls
string
This is the manifest URL. For HTTP Live Streaming (HLS), when a HLS video stream is initiated, the first file to download is the manifest. This file has the extension M3U8, and provides the video player with information about the various bitrates available for streaming.
iframe
string
Code to use video from a third party website
player
string
Raw url of the player.
thumbnail
string
Poster of the video.
mp4
string
Available only if mp4Support is enabled. Raw mp4 url.
playerId
string
The id of the player that will be applied on the video.
public
boolean
Defines if the content is publicly reachable or if a unique token is needed for each play session. Default is true. Tutorials on private videos.
panoramic
boolean
Defines if video is panoramic.
mp4Support
boolean
This lets you know whether mp4 is supported. If enabled, an mp4 URL will be provided in the response for the video.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
{
"title": "Maths video",
"description": "An amazing video explaining string theory.",
"public": false,
"panoramic": false,
"mp4Support": true,
"playerId": "pl45KFKdlddgk654dspkze",
"tags": [
"maths",
"string theory",
"video"
],
"metadata": [
{
"key": "Author",
"value": "John Doe"
},
{
"key": "Format",
"value": "Tutorial"
}
],
"watermark": {
"id": "watermark_1BWr2L5MTQwxGkuxKjzh6i",
"bottom": "10px",
"right": "10px",
"width": "50%",
"opacity": "70%"
}
}
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/VideosApi.md#create
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
videoCreationPayload := *apivideosdk.NewVideoCreationPayload("Maths video") // VideoCreationPayload | video to create
res, err := client.Videos.Create(videoCreationPayload)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.Create``: %v\
", err)
}
// response from `Create`: Video
fmt.Fprintf(os.Stdout, "Response from `Videos.Create`: %v\
", res)
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/VideosApi.md#create
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });
// create a simple video
const video = await client.videos.create({ title: "Maths video" });
// create a video using an existing source
const existingSourceVideo = await client.videos.create({
title: "Video using an existing source",
source: "https://www.myvideo.url.com/video.mp4",
});
// create a private video
const privateVideo = await client.videos.create({
title: "Video using an existing source",
_public: false,
});
// create a video using all available attributes
const video = await client.videos.create({
title: "Maths video", // The title of your new video.
description: "A video about string theory.", // A brief description of your video.
source: "https://www.myvideo.url.com/video.mp4", // If you add a video already on the web, this is where you enter the url for the video.
_public: true, // Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view.
panoramic: false, // Indicates if your video is a 360/immersive video.
mp4Support: true, // Enables mp4 version in addition to streamed version.
playerId: "pl45KFKdlddgk654dspkze", // The unique identification number for your video player.
tags: ["maths", "string theory", "video"], // A list of tags you want to use to describe your video.
metadata: [{"key": "Author", "value": "John Doe"}], // A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. You can also just use the pairs as another way to tag and categorize your videos.
});
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/VideosApi.md#create
require __DIR__ . '/vendor/autoload.php';
$client = new \ApiVideo\Client\Client(
'https://ws.api.video',
'YOUR_API_KEY',
new \Symfony\Component\HttpClient\Psr18Client()
);
// create a simple video
$video = $client->videos()->create((new \ApiVideo\Client\Model\VideoCreationPayload())->setTitle("Maths video"));
// create a video using an existing source
$existingSourceVideo = $client->videos()->create((new \ApiVideo\Client\Model\VideoCreationPayload())
->setTitle("Maths video")
->setSource("https://www.myvideo.url.com/video.mp4"));
// create a private video
$privateVideo = $client->videos()->create((new \ApiVideo\Client\Model\VideoCreationPayload())
->setTitle("Maths video")
->setPublic(false));
// create a video using all available attributes
$anotherVideo = $client->videos()->create((new \ApiVideo\Client\Model\VideoCreationPayload())
->setTitle("Maths video") // The title of your new video.
->setDescription("A video about string theory.") // A brief description of your video.
->setSource("https://www.myvideo.url.com/video.mp4") // If you add a video already on the web, this is where you enter the url for the video.
->setPublic(true) // Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view.
->setPanoramic(false) // Indicates if your video is a 360/immersive video.
->setMp4Support(true) // Enables mp4 version in addition to streamed version.
->setPlayerId("pl45KFKdlddgk654dspkze") // The unique identification number for your video player.
->setTags(array("TAG1", "TAG2")) // A list of tags you want to use to describe your video.
->setMetadata(array( // A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. You can also just use the pairs as another way to tag and categorize your videos.
new \ApiVideo\Client\Model\Metadata(['key' => 'key1', 'value' => 'key1value1']),
new \ApiVideo\Client\Model\Metadata(['key' => 'key2', 'value' => 'key2value1']))));
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#create
import apivideo
from apivideo.api import videos_api
from apivideo.model.video_creation_payload import VideoCreationPayload
from apivideo.model.bad_request import BadRequest
from apivideo.model.video import Video
from pprint import pprint
# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
# Create an instance of the API class
api_instance = videos_api.VideosApi(api_client)
video_creation_payload = VideoCreationPayload(
title="Maths video",
description="A video about string theory.",
source="https://www.myvideo.url.com/video.mp4",
public=True,
panoramic=False,
mp4_support=True,
player_id="pl45KFKdlddgk654dspkze",
tags=["maths", "string theory", "video"],
metadata=[
Metadata(
key="Color",
value="Green",
),
],
) # VideoCreationPayload | video to create
# example passing only required values which don't have defaults set
try:
# Create a video
api_response = api_instance.create(video_creation_payload)
pprint(api_response)
except apivideo.ApiException as e:
print("Exception when calling VideosApi->create: %s\n" % e)
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/VideosApi.md#create
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.VideosApi;
import java.util.*;
public class Example {
public static void main(String[] args) {
ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
// if you rather like to use the sandbox environment:
// ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);
VideosApi apiInstance = client.videos();
VideoCreationPayload videoCreationPayload = new VideoCreationPayload(); // video to create
videoCreationPayload.setTitle("Maths video"); // The title of your new video.
videoCreationPayload.setDescription("A video about string theory."); // A brief description of your video.
videoCreationPayload.setSource("https://www.myvideo.url.com/video.mp4"); // If you add a video already on the web, this is where you enter the url for the video.
videoCreationPayload.setPublic(true); // Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view.
videoCreationPayload.setPanoramic(false); // Indicates if your video is a 360/immersive video.
videoCreationPayload.setMp4Support(true); // Enables mp4 version in addition to streamed version.
videoCreationPayload.setPlayerId("pl45KFKdlddgk654dspkze"); // The unique identification number for your video player.
videoCreationPayload.setTags(Arrays.asList("maths", "string theory", "video")); // A list of tags you want to use to describe your video.
videoCreationPayload.setMetadata(Collections.<Metadata>emptyList()); // A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. You can also just use the pairs as another way to tag and categorize your videos.
try {
Video result = apiInstance.create(videoCreationPayload);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling VideosApi#create");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getMessage());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/VideosApi.md#create
using System.Diagnostics;
using ApiVideo.Client;
namespace Example
{
public class createExample
{
public static void Main()
{
var basePath = ApiVideoClient.Client.Environment.SANDBOX;
var apiKey = "YOUR_API_KEY";
var apiInstance = new ApiVideoClient(apiKey,basePath);
var videoCreationPayload = new VideoCreationPayload(); // VideoCreationPayload | video to create
var apiVideosInstance = apiInstance.Videos();
try
{
// Create a video
Video result = apiVideosInstance.create(videoCreationPayload);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling VideosApi.create: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideosAPI.md#create
Created
{
"videoId": "vi4blUQJFrYWbaG44NChkH27",
"title": "Maths video",
"description": "An amazing video explaining the string theory",
"public": false,
"panoramic": false,
"mp4Support": true,
"playerId": "pl4k0jvEUuaTdRAEjQ4Jfrgz",
"tags": [
"maths",
"string theory",
"video"
],
"metadata": [
{
"key": "Author",
"value": "John Doe"
},
{
"key": "Format",
"value": "Tutorial"
}
],
"publishedAt": "4665-07-14T23:36:18.598Z",
"source": {
"uri": "/videos/vi4blUQJFrYWbaG44NChkH27/source"
},
"assets": {
"iframe": "<iframe src=\"https://embed.api.video/vod/vi4blUQJFrYWbaG44NChkH27\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
"player": "https://embed.api.video/vod/vi4blUQJFrYWbaG44NChkH27",
"hls": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/hls/manifest.m3u8",
"thumbnail": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/thumbnail.jpg",
"mp4": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/mp4/source.mp4"
}
}
Accepted
{
"videoId": "vi4k0jvEUuaTdRAEjQ4Jfrgz",
"title": "Maths video",
"description": "An amazing video explaining the string theory",
"tags": [
"maths",
"string theory",
"video"
],
"metadata": [
{
"key": "Author",
"value": "John Doe"
},
{
"key": "Format",
"value": "Tutorial"
}
],
"createdAt": "4251-03-03T12:52:03.085Z",
"publishedAt": "4665-07-14T23:36:18.598Z",
"actions": [
"video_delete",
"video_download",
"video_update"
]
}
Bad Request
{
"type": "https://docs.api.video/reference/attribute-required",
"title": "This attribute is required.",
"name": "title",
"status": 400,
"problems": [
{
"type": "https://docs.api.video/reference/attribute-required",
"title": "This attribute is required.",
"name": "title"
},
{
"type": "https://docs.api.video/reference/invalid-attribute",
"title": "This attribute must be a ISO8601 date.",
"name": "scheduledAt"
},
{
"type": "https://docs.api.video/reference/invalid-attribute",
"title": "This attribute must be an array.",
"name": "tags"
},
{
"type": "https://docs.api.video/reference/invalid-attribute",
"title": "This attribute must be an array.",
"name": "metadata"
}
]
}
Too Many Requests
{
"type": "https://docs.api.video/reference/too-many-requests",
"title": "Too many requests.",
"status": 429
}
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
/videos/{videoId}/source
Ingest a video from a source or file.
file
file
required
The path to the video you would like to upload. The path must be local. If you want to use a video from an online source, you must use the "/videos" endpoint and add the "source" parameter when you create a new video.
apiKey
videoId
string
required
Enter the videoId you want to use to upload your video.
Content-Range
string
part <part>/<total_parts>
; bytes <from_byte>-<to_byte>/<total_bytes>
Not Found
type
string
title
string
name
string
status
int
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Too Many Requests
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Bad Request
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
name
string
The name of the parameter that caused the error.
status
int
The HTTP status code.
problems
array[object (BadRequest)]
Returns any additional problems in the request in an array of objects.
BadRequest
object (BadRequest)
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
name
string
The name of the parameter that caused the error.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Created
videoId
string
required
The unique identifier of the video object.
createdAt
string
When a video was created, presented in ISO-8601 format.
title
string
The title of the video content.
description
string
A description for the video content.
publishedAt
string
The date and time the API created the video. Date and time are provided using ISO-8601 UTC format.
updatedAt
string
The date and time the video was updated. Date and time are provided using ISO-8601 UTC format.
tags
array[string]
One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces.
string
metadata
array[object (Metadata)]
Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. Dynamic Metadata allows you to define a key that allows any value pair.
Metadata
object (Metadata)
key
string
The constant that defines the data set.
value
string
A variable which belongs to the data set.
source
object (source)
Source information about the video.
uri
string
The URL where the video is stored.
type
string
liveStream
object (liveStream)
This appears if the video is from a Live Record.
liveStreamId
string
The unique identifier for the live stream.
links
array[object]
object
rel
string
uri
string
assets
object (assets)
Collection of details about the video object that you can use to work with the video object.
hls
string
This is the manifest URL. For HTTP Live Streaming (HLS), when a HLS video stream is initiated, the first file to download is the manifest. This file has the extension M3U8, and provides the video player with information about the various bitrates available for streaming.
iframe
string
Code to use video from a third party website
player
string
Raw url of the player.
thumbnail
string
Poster of the video.
mp4
string
Available only if mp4Support is enabled. Raw mp4 url.
playerId
string
The id of the player that will be applied on the video.
public
boolean
Defines if the content is publicly reachable or if a unique token is needed for each play session. Default is true. Tutorials on private videos.
panoramic
boolean
Defines if video is panoramic.
mp4Support
boolean
This lets you know whether mp4 is supported. If enabled, an mp4 URL will be provided in the response for the video.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/VideosApi.md#upload
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
videoId := "vi4k0jvEUuaTdRAEjQ4Jfrgz"
// string | Enter the videoId you want to use to upload your video.
file := os.NewFile(1234, "some_file")
// *os.File | The path to the video you would like to upload. The path must be local. If you want to use a video from an online source, you must use the "/videos" endpoint and add the "source" parameter when you create a new video.
res, err := client.Videos.UploadFile(videoId, file)
// you can also use a Reader instead of a File:
// client.Videos.Upload(videoId, fileName, fileReader, fileSize)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Videos.Upload``: %v\
", err)
}
// response from `Upload`: Video
fmt.Fprintf(os.Stdout, "Response from `Videos.Upload`: %v\
", res)
}
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/VideosApi.md#upload
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });
const videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // Enter the videoId you want to use to upload your video.
const file = './my-video.mp4'; // The path to the video you would like to upload. The path must be local. If you want to use a video from an online source, you must use the "/videos" endpoint and add the "source" parameter when you create a new video.
const video = await client.videos.upload(videoId, file);
// if needed you can define an upload progress listener:
const video2 = await client.videos.upload(videoId, file, (event) => {
console.log("uploadedBytes: " + event.uploadedBytes);
console.log("totalBytes: " + event.totalBytes);
console.log("chunksCount: " + event.chunksCount);
console.log("currentChunk: " + event.currentChunk);
console.log("currentChunkTotalBytes: " + event.currentChunkTotalBytes);
console.log("currentChunkUploadedBytes: " + event.currentChunkUploadedBytes);
});
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/VideosApi.md#upload
require __DIR__ . '/vendor/autoload.php';
$client = new \ApiVideo\Client\Client(
'https://ws.api.video',
'YOUR_API_KEY',
new \Symfony\Component\HttpClient\Psr18Client()
);
// create a new video & upload a video file
$myVideo = $client->videos()->create((new \ApiVideo\Client\Model\VideoCreationPayload())->setTitle('Uploaded video'));
$client->videos()->upload($myVideo->getVideoId(), new SplFileObject(__DIR__ . '/558k.mp4'));
// create a new video & upload a video file using progressive upload (the file is uploaded by parts)
$myVideo2 = $client->videos()->create((new \ApiVideo\Client\Model\VideoCreationPayload())->setTitle('Uploaded video (progressive upload)'));
$progressiveSession = $client->videos()->createUploadProgressiveSession($myVideo2->getVideoId());
$progressiveSession->uploadPart(new SplFileObject(__DIR__ . '/10m.mp4.part.a'));
$progressiveSession->uploadPart(new SplFileObject(__DIR__ . '/10m.mp4.part.b'));
$progressiveSession->uploadLastPart(new SplFileObject(__DIR__ . '/10m.mp4.part.c'));
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#upload
import apivideo
from apivideo.api import videos_api
from apivideo.model.bad_request import BadRequest
from apivideo.model.not_found import NotFound
from apivideo.model.video import Video
from apivideo.configuration import Configuration
from pprint import pprint
# Enter a context with an instance of the API client
# When uploading a file you can change the chunk size (in octet)
configuration = Configuration(chunk_size=10 * 1024 * 1024)
with apivideo.AuthenticatedApiClient(__API_KEY__, configuration=configuration) as api_client:
# Create an instance of the API class
api_instance = videos_api.VideosApi(api_client)
video_id = "vi4k0jvEUuaTdRAEjQ4Jfrgz" # str | Enter the videoId you want to use to upload your video.
file = open('/path/to/file', 'rb') # file_type | The path to the video you would like to upload. The path must be local. If you want to use a video from an online source, you must use the "/videos" endpoint and add the "source" parameter when you create a new video.
# example passing only required values which don't have defaults set
try:
# Upload a video
api_response = api_instance.upload(video_id, file)
pprint(api_response)
except apivideo.ApiException as e:
print("Exception when calling VideosApi->upload: %s\n" % e)
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/VideosApi.md#upload
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.VideosApi;
import java.util.*;
public class Example {
public static void main(String[] args) {
ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
// if you rather like to use the sandbox environment:
// ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);
VideosApi apiInstance = client.videos();
String videoId = "vi4k0jvEUuaTdRAEjQ4Jfrgz"; // Enter the videoId you want to use to upload your video.
File file = new File("/path/to/file"); // The path to the video you would like to upload. The path must be local. If you want to use a video from an online source, you must use the "/videos" endpoint and add the "source" parameter when you create a new video.
try {
Video result = apiInstance.upload(videoId, file);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling VideosApi#upload");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getMessage());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
// First add the "video.api:android-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-android-client/blob/main/docs/VideosApi.md#upload
VideosApiStore.initialize("YOUR_API_KEY")
// if you rather like to use the sandbox environment:
// VideosApiStore.initialize("YOUR_SANDBOX_API_KEY", Environment.SANDBOX)
val workManager = WorkManager.getInstance(context) // WorkManager comes from package "androidx.work:work-runtime"
val videoId = "vi4k0jvEUuaTdRAEjQ4Jfrgz" // The videoId you want to use to upload your video.
val file = File("/path/to/file") // The path to the video you want to upload.
workManager.upload(videoId, file) // Dispatch the upload with the WorkManager
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/VideosApi.md#upload
using System.Diagnostics;
using ApiVideo.Client;
namespace Example
{
public class uploadExample
{
public static void Main()
{
var basePath = ApiVideoClient.Client.Environment.SANDBOX;
var apiKey = "YOUR_API_KEY";
var apiInstance = new ApiVideoClient(apiKey,basePath);
var videoId = vi4k0jvEUuaTdRAEjQ4Jfrgz; // string | Enter the videoId you want to use to upload your video.
var file = BINARY_DATA_HERE; // System.IO.Stream | The path to the video you would like to upload. The path must be local. If you want to use a video from an online source, you must use the "/videos" endpoint and add the "source" parameter when you create a new video.
var apiVideosInstance = apiInstance.Videos();
try
{
// Upload a video
Video result = apiVideosInstance.upload(videoId, file);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling VideosApi.upload: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideosAPI.md#upload
Created
{
"videoId": "vi4blUQJFrYWbaG44NChkH27",
"title": "Maths video",
"description": "An amazing video explaining the string theory.",
"public": false,
"panoramic": false,
"mp4Support": true,
"playerId": "pl45KFKdlddgk654dspkze",
"tags": [
"maths",
"string theory",
"video"
],
"metadata": [
{
"key": "Author",
"value": "John Doe"
},
{
"key": "Format",
"value": "Tutorial"
}
],
"publishedAt": "4665-07-14T23:36:18.598Z",
"source": {
"uri": "/videos/vi4blUQJFrYWbaG44NChkH27/source"
},
"assets": {
"iframe": "<iframe src=\"https://embed.api.video/vod/vi4blUQJFrYWbaG44NChkH27\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
"player": "https://embed.api.video/vod/vi4blUQJFrYWbaG44NChkH27",
"hls": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/hls/manifest.m3u8",
"thumbnail": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/thumbnail.jpg",
"mp4": "https://cdn.api.video/vod/vi4blUQJFrYWbaG44NChkH27/mp4/source.mp4"
}
}
Bad Request
{
"type": "https://docs.api.video/reference/video-source-already-uploaded",
"title": "The source of the video is already uploaded.",
"name": "file",
"status": 400,
"problems": [
{
"type": "https://docs.api.video/reference/video-source-already-uploaded",
"title": "The source of the video is already uploaded.",
"name": "file"
},
{
"type": "https://docs.api.video/reference/video-source-already-uploaded",
"title": "The video xxxx has already been uploaded.",
"name": "video"
},
{
"type": "https://docs.api.video/reference/uploaded-file-no-file",
"title": "There is no uploaded file in the request.",
"name": "file"
},
{
"type": "https://docs.api.video/reference/uploaded-file-multiple-files",
"title": "There is more than one uploaded file in the request.",
"name": "file"
}
]
}
Not Found
{
"type": "https://docs.api.video/reference/resource-not-found",
"title": "The requested resource was not found.",
"name": "videoId",
"status": 404
}
Too Many Requests
{
"type": "https://docs.api.video/reference/too-many-requests",
"title": "Too many requests.",
"status": 429
}
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
/videos/{videoId}/thumbnail
Upload a thumbnail for a certain video.
file
file
required
The image to be added as a thumbnail. The mime type should be image/jpeg, image/png or image/webp. The max allowed size is 8 MiB.
apiKey
videoId
string
required
Unique identifier of the chosen video
Not Found