Searching...

Captions

get /videos/{videoId}/captions/{language}

Retrieve a caption

Retrieve a caption for a video in a specific language.

videoId string required

The unique identifier for the video you want captions for.

language string required

A valid language identifier using IETF language tags. You can use primary subtags like en (English), extended subtags like fr-CA (French, Canada), or region subtags like zh-Hans-CN (Simplified Chinese used in the PRC).

  • This parameter only accepts dashes for separators , for example fr-CA . If you use a different separator in your request, the API returns an error.

  • When the value in your request does not match any covered language, the API returns an error.

  • You can find the list of supported tags here .

Responses

Success

Response body Headers
uri string

The unique resource identifier of the uploaded caption.

Example
"/videos/vi1111DinStg3oBbN79GklWS/captions/sr-Cyrl"
src string

A direct URL to the uploaded caption file.

Example
"https://cdn.api.video/vod/vi1111DinStg3oBbN79GklWS/captions/sr-Cyrl.vtt"
srclang string

Indicates the language of the uploaded caption file using IETF language tags.

Example
"sr-Cyrl"
languageName string

Returns the native name of the caption language in UTF-8 encoding.

Example
"српски (ћирилица)"
default boolean

Whether you will have subtitles or not. True for yes you will have subtitles, false for no you will not have subtitles.

Default
false
Example
false
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 error

Response body Headers
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

Returns any additional problems in the request in an array of objects.

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.

Not Found

Response body Headers
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.

Too Many Requests

Response body Headers
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.

Request examples

// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/CaptionsApi.md#get

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class getExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var videoId = vi4k0jvEUuaTdRAEjQ4Prklg;  // string | The unique identifier for the video you want captions for.
            var language = en;  // string | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).
            var apiCaptionsInstance = apiInstance.Captions();
            try
            {
                // Show a caption
                Caption result = apiCaptionsInstance.get(videoId, language);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CaptionsApi.get: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
// 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/CaptionsApi.md#get

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 := "vi4k0jvEUuaTdRAEjQ4Prklg" // string | The unique identifier for the video you want captions for.
    language := "en" // string | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

    
    res, err := client.Captions.Get(videoId, language)

    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `Captions.Get``: %v\
", err)
    }
    // response from `Get`: Caption
    fmt.Fprintf(os.Stdout, "Response from `Captions.Get`: %v\
", res)
}
// 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/CaptionsApi.md#get

import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.CaptionsApi;
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);

    CaptionsApi apiInstance = client.captions();
    
    String videoId = "vi4k0jvEUuaTdRAEjQ4Prklg"; // The unique identifier for the video you want captions for.
    String language = "en"; // A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

    try {
      Caption result = apiInstance.get(videoId, language);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaptionsApi#get");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/CaptionsApi.md#get

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Prklg'; // The unique identifier for the video you want captions for.
const language = 'en'; // A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

const caption = await client.captions.get(videoId, language);
<?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/CaptionsApi.md#get

require __DIR__ . '/vendor/autoload.php';

$videoId = 'vi4k0jvEUuaTdRAEjQ4Prklg'; // The unique identifier for the video you want captions for.
$language = 'en'; // A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

$client->captions()->get($videoId, $language); 
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/CaptionsApi.md#get

import apivideo
from apivideo.api import captions_api
from apivideo.model.not_found import NotFound
from apivideo.model.caption import Caption
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 = captions_api.CaptionsApi(api_client)
    video_id = "vi4k0jvEUuaTdRAEjQ4Prklg" # str | The unique identifier for the video you want captions for.
    language = "en" # str | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

    # example passing only required values which don't have defaults set
    try:
        # Show a caption
        api_response = api_instance.get(video_id, language)
        pprint(api_response)
    except apivideo.ApiException as e:
        print("Exception when calling CaptionsApi->get: %s\n" % e)
// 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/CaptionsAPI.md#get

Response examples

Success

{
  "uri": "/videos/vi3N6cDinStg3oBbN79GklWS/captions/en",
  "src": "https://cdn.api.video/vod/vi3N6cDinStg3oBbN79GklWS/captions/en.vtt",
  "srclang": "en",
  "languageName": "English",
  "default": false
}

Bad request error

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "The \"language\" attribute must contain only letters and dashes (for example \"fr\", \"fr-BE\").",
  "name": "language"
}

This error occurs when the language tag you provided contains characters other than letters and dashes.

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "The \"language\" attribute is not valid.",
  "name": "language"
}

This error occurs when the language tag you provided does not match any supported language.

Not Found

{
  "type": "string",
  "title": "string",
  "name": "string",
  "status": 123
}

Too Many Requests

{
  "type": "https://docs.api.video/reference/too-many-requests",
  "title": "Too many requests.",
  "status": 429
}
post /videos/{videoId}/captions/{language}

Upload a caption

Upload a VTT file to add captions to your video. More information can be found here

file file required

The video text track (VTT) you want to upload.

videoId string required

The unique identifier for the video you want to add a caption to.

language string required

A valid language identifier using IETF language tags. You can use primary subtags like en (English), extended subtags like fr-CA (French, Canada), or region subtags like zh-Hans-CN (Simplified Chinese used in the PRC).

  • This parameter only accepts dashes for separators , for example fr-CA . If you use a different separator in your request, the API returns an error.

  • When the value in your request does not match any covered language, the API returns an error.

  • You can find the list of supported tags here .

Responses

Success

Response body Headers
uri string

The unique resource identifier of the uploaded caption.

Example
"/videos/vi1111DinStg3oBbN79GklWS/captions/sr-Cyrl"
src string

A direct URL to the uploaded caption file.

Example
"https://cdn.api.video/vod/vi1111DinStg3oBbN79GklWS/captions/sr-Cyrl.vtt"
srclang string

Indicates the language of the uploaded caption file using IETF language tags.

Example
"sr-Cyrl"
languageName string

Returns the native name of the caption language in UTF-8 encoding.

Example
"српски (ћирилица)"
default boolean

Whether you will have subtitles or not. True for yes you will have subtitles, false for no you will not have subtitles.

Default
false
Example
false
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 error

Response body Headers
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

Returns any additional problems in the request in an array of objects.

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.

Not Found

Response body Headers
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.

Too Many Requests

Response body Headers
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.

Request examples

// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/CaptionsApi.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 = vi4k0jvEUuaTdRAEjQ4Prklg;  // string | The unique identifier for the video you want to add a caption to.
            var language = en;  // string | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).
            var file = BINARY_DATA_HERE;  // System.IO.Stream | The video text track (VTT) you want to upload.
            var apiCaptionsInstance = apiInstance.Captions();
            try
            {
                // Upload a caption
                Caption result = apiCaptionsInstance.upload(videoId, language, file);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CaptionsApi.upload: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
// 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/CaptionsApi.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 := "vi4k0jvEUuaTdRAEjQ4Prklg" // string | The unique identifier for the video you want to add a caption to.
    language := "en" // string | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).
    file := os.NewFile(1234, "some_file") // *os.File | The video text track (VTT) you want to upload.

    
    res, err := client.Captions.UploadFile(videoId, language, file)

    // you can also use a Reader instead of a File:
    // client.Captions.Upload(videoId, language, fileName, fileReader)

    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `Captions.Upload``: %v\
", err)
    }
    // response from `Upload`: Caption
    fmt.Fprintf(os.Stdout, "Response from `Captions.Upload`: %v\
", res)
}
// 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/CaptionsApi.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.CaptionsApi;
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);

    CaptionsApi apiInstance = client.captions();
    
    String videoId = "vi4k0jvEUuaTdRAEjQ4Prklg"; // The unique identifier for the video you want captions for.
    String language = "en"; // A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

    try {
      Caption result = apiInstance.get(videoId, language);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaptionsApi#get");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/CaptionsApi.md#upload

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Prklg'; // The unique identifier for the video you want to add a caption to.
const language = 'en'; // A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).
const file = './en.vtt'; // The video text track (VTT) you want to upload.

const caption = await client.captions.upload(videoId, language, file); 
<?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/CaptionsApi.md#upload

require __DIR__ . '/vendor/autoload.php';

$videoId = 'vi4k0jvEUuaTdRAEjQ4Prklg'; // The unique identifier for the video you want to add a caption to.
$language = 'en'; // A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).
$file = new SplFileObject(__DIR__ . '/en.vtt'); // The video text track (VTT) you want to upload.

$caption = $client->captions()->upload($videoId, $language, $file); 
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/CaptionsApi.md#upload

import apivideo
from apivideo.api import captions_api
from apivideo.model.bad_request import BadRequest
from apivideo.model.not_found import NotFound
from apivideo.model.caption import Caption
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 = captions_api.CaptionsApi(api_client)
    video_id = "vi4k0jvEUuaTdRAEjQ4Prklg" # str | The unique identifier for the video you want to add a caption to.
    language = "en" # str | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).
    file = open('/path/to/file', 'rb') # file_type | The video text track (VTT) you want to upload.

    # example passing only required values which don't have defaults set
    try:
        # Upload a caption
        api_response = api_instance.upload(video_id, language, file)
        pprint(api_response)
    except apivideo.ApiException as e:
        print("Exception when calling CaptionsApi->upload: %s\n" % e)
// 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/CaptionsAPI.md#upload

Response examples

Success

{
  "uri": "/videos/vi3N6cDinStg3oBbN79GklWS/captions/en",
  "src": "https://cdn.api.video/vod/vi3N6cDinStg3oBbN79GklWS/captions/en.vtt",
  "srclang": "en",
  "languageName": "English",
  "default": false
}

Bad request error

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "The \"language\" attribute must contain only letters and dashes (for example \"fr\", \"fr-BE\").",
  "name": "language"
}

This error occurs when the language tag you provided contains characters other than letters and dashes.

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "The \"language\" attribute is not valid.",
  "name": "language"
}

This error occurs when the language tag you provided does not match any supported language.

Not Found

{
  "type": "string",
  "title": "string",
  "name": "string",
  "status": 123
}

Too Many Requests

{
  "type": "https://docs.api.video/reference/too-many-requests",
  "title": "Too many requests.",
  "status": 429
}
delete /videos/{videoId}/captions/{language}

Delete a caption

Delete a caption in a specific language by by video id.

videoId string required

The unique identifier for the video you want to delete a caption from.

language string required

A valid language identifier using IETF language tags. You can use primary subtags like en (English), extended subtags like fr-CA (French, Canada), or region subtags like zh-Hans-CN (Simplified Chinese used in the PRC).

  • This parameter only accepts dashes for separators , for example fr-CA . If you use a different separator in your request, the API returns an error.

  • When the value in your request does not match any covered language, the API returns an error.

  • You can find the list of supported tags here .

Responses

No Content

Response body Headers

This response is empty

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 error

Response body Headers
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

Returns any additional problems in the request in an array of objects.

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.

Not Found

Response body Headers
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.

Too Many Requests

Response body Headers
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.

Request examples

// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/CaptionsApi.md#delete

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class deleteExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var videoId = vi4k0jvEUuaTdRAEjQ4Prklgc;  // string | The unique identifier for the video you want to delete a caption from.
            var language = en;  // string | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).
            var apiCaptionsInstance = apiInstance.Captions();
            try
            {
                // Delete a caption
                apiCaptionsInstance.delete(videoId, language);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CaptionsApi.delete: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
// 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/CaptionsApi.md#delete

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 := "vi4k0jvEUuaTdRAEjQ4Prklgc" // string | The unique identifier for the video you want to delete a caption from.
    language := "en" // string | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

    
    err := client.Captions.Delete(videoId, language)

    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `Captions.Delete``: %v\
", err)
    }
}
// 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/CaptionsApi.md#delete

import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.CaptionsApi;
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);

    CaptionsApi apiInstance = client.captions();
    
    String videoId = "vi4k0jvEUuaTdRAEjQ4Prklgc"; // The unique identifier for the video you want to delete a caption from.
    String language = "en"; // A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

    try {
      apiInstance.delete(videoId, language);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaptionsApi#delete");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/CaptionsApi.md#delete

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Prklgc'; // The unique identifier for the video you want to delete a caption from.
const language = 'en'; // A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

await client.captions.delete(videoId, language);
 
<?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/CaptionsApi.md#delete

require __DIR__ . '/vendor/autoload.php';

$videoId = 'vi4k0jvEUuaTdRAEjQ4Prklgc'; // The unique identifier for the video you want to delete a caption from.
$language = 'en'; // A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

$client->captions()->delete($videoId, $language); 
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/CaptionsApi.md#delete

import apivideo
from apivideo.api import captions_api
from apivideo.model.not_found import NotFound
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 = captions_api.CaptionsApi(api_client)
    video_id = "vi4k0jvEUuaTdRAEjQ4Prklgc" # str | The unique identifier for the video you want to delete a caption from.
    language = "en" # str | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

    # example passing only required values which don't have defaults set
    try:
        # Delete a caption
        api_instance.delete(video_id, language)
    except apivideo.ApiException as e:
        print("Exception when calling CaptionsApi->delete: %s\n" % e)
// 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/CaptionsAPI.md#delete

Response examples

Bad request error

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "The \"language\" attribute must contain only letters and dashes (for example \"fr\", \"fr-BE\").",
  "name": "language"
}

This error occurs when the language tag you provided contains characters other than letters and dashes.

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "The \"language\" attribute is not valid.",
  "name": "language"
}

This error occurs when the language tag you provided does not match any supported language.

Not Found

{
  "type": "string",
  "title": "string",
  "name": "string",
  "status": 123
}

Too Many Requests

{
  "type": "https://docs.api.video/reference/too-many-requests",
  "title": "Too many requests.",
  "status": 429
}
patch /videos/{videoId}/captions/{language}

Update a caption

Update caption settings.

default boolean

Set this parameter to true to define a caption as the default for a video.

videoId string required

The unique identifier for the video you want to have automatic captions for.

language string required

A valid language identifier using IETF language tags. You can use primary subtags like en (English), extended subtags like fr-CA (French, Canada), or region subtags like zh-Hans-CN (Simplified Chinese used in the PRC).

  • This parameter only accepts dashes for separators , for example fr-CA . If you use a different separator in your request, the API returns an error.

  • When the value in your request does not match any covered language, the API returns an error.

  • You can find the list of supported tags here .

Responses

Success

Response body Headers
uri string

The unique resource identifier of the uploaded caption.

Example
"/videos/vi1111DinStg3oBbN79GklWS/captions/sr-Cyrl"
src string

A direct URL to the uploaded caption file.

Example
"https://cdn.api.video/vod/vi1111DinStg3oBbN79GklWS/captions/sr-Cyrl.vtt"
srclang string

Indicates the language of the uploaded caption file using IETF language tags.

Example
"sr-Cyrl"
languageName string

Returns the native name of the caption language in UTF-8 encoding.

Example
"српски (ћирилица)"
default boolean

Whether you will have subtitles or not. True for yes you will have subtitles, false for no you will not have subtitles.

Default
false
Example
false
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 error

Response body Headers
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

Returns any additional problems in the request in an array of objects.

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.

Not Found

Response body Headers
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.

Too Many Requests

Response body Headers
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.

Request examples

{
  "default": true
}
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/CaptionsApi.md#update

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class updateExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var videoId = vi4k0jvEUuaTdRAEjQ4Prklg;  // string | The unique identifier for the video you want to have automatic captions for.
            var language = en;  // string | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).
            var captionsUpdatePayload = new CaptionsUpdatePayload(); // CaptionsUpdatePayload | 
            var apiCaptionsInstance = apiInstance.Captions();
            try
            {
                // Update caption
                Caption result = apiCaptionsInstance.update(videoId, language, captionsUpdatePayload);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CaptionsApi.update: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
// 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/CaptionsApi.md#update

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 := "vi4k0jvEUuaTdRAEjQ4Prklg" // string | The unique identifier for the video you want to have automatic captions for.
    language := "en" // string | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).
    captionsUpdatePayload := *apivideosdk.NewCaptionsUpdatePayload() // CaptionsUpdatePayload | 

    
    res, err := client.Captions.Update(videoId, language, captionsUpdatePayload)

    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `Captions.Update``: %v\
", err)
    }
    // response from `Update`: Caption
    fmt.Fprintf(os.Stdout, "Response from `Captions.Update`: %v\
", res)
}
// 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/CaptionsApi.md#update

import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.CaptionsApi;
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);

    CaptionsApi apiInstance = client.captions();
    
    String videoId = "vi4k0jvEUuaTdRAEjQ4Prklg"; // The unique identifier for the video you want to have automatic captions for.
    String language = "en"; // A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).
    CaptionsUpdatePayload captionsUpdatePayload = new CaptionsUpdatePayload(); // 
    captionsUpdatePayload.setDefault(); // 


    try {
      Caption result = apiInstance.update(videoId, language, captionsUpdatePayload);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaptionsApi#update");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/CaptionsApi.md#update

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Prklg'; // The unique identifier for the video you want to have automatic captions for.
const language = 'en'; // A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).
const captionsUpdatePayload = {
  _default: true,
}; 
 
const caption = await client.captions.update(videoId, language, captionsUpdatePayload);
        
<?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/CaptionsApi.md#update

require __DIR__ . '/vendor/autoload.php';

$videoId = 'vi4k0jvEUuaTdRAEjQ4Prklg'; // The unique identifier for the video you want to have automatic captions for.
$language = 'en'; // A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

$captionsUpdatePayload = (new \ApiVideo\Client\Model\CaptionsUpdatePayload())
    ->setDefault(true);
 
$caption = $client->captions()->update($videoId, $language, $captionsUpdatePayload); 
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/CaptionsApi.md#update

import apivideo
from apivideo.api import captions_api
from apivideo.model.bad_request import BadRequest
from apivideo.model.captions_update_payload import CaptionsUpdatePayload
from apivideo.model.not_found import NotFound
from apivideo.model.caption import Caption
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 = captions_api.CaptionsApi(api_client)
    video_id = "vi4k0jvEUuaTdRAEjQ4Prklg" # str | The unique identifier for the video you want to have automatic captions for.
    language = "en" # str | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).
    captions_update_payload = CaptionsUpdatePayload(
        default=True,
    ) # CaptionsUpdatePayload | 

    # example passing only required values which don't have defaults set
    try:
        # Update caption
        api_response = api_instance.update(video_id, language, captions_update_payload)
        pprint(api_response)
    except apivideo.ApiException as e:
        print("Exception when calling CaptionsApi->update: %s\
" % e)
// 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/CaptionsAPI.md#update

Response examples

Success

{
  "uri": "/videos/vi3N6cDinStg3oBbN79GklWS/captions/en",
  "src": "https://cdn.api.video/vod/vi3N6cDinStg3oBbN79GklWS/captions/en.vtt",
  "srclang": "en",
  "languageName": "English",
  "default": true
}

Bad request error

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "The \"language\" attribute must contain only letters and dashes (for example \"fr\", \"fr-BE\").",
  "name": "language"
}

This error occurs when the language tag you provided contains characters other than letters and dashes.

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "The \"language\" attribute is not valid.",
  "name": "language"
}

This error occurs when the language tag you provided does not match any supported language.

Not Found

{
  "type": "Lorem sit culpa non",
  "title": "sunt do fugiat tempor",
  "name": "irure mollit aute",
  "status": 85925135
}

Too Many Requests

{
  "type": "https://docs.api.video/reference/too-many-requests",
  "title": "Too many requests.",
  "status": 429
}
get /videos/{videoId}/captions

List video captions

Retrieve a list of available captions by video id.

currentPage int

Choose the number of search results to return per page. Minimum value: 1

Default
1
pageSize int

Results per page. Allowed values 1-100, default is 25.

Default
25
videoId string required

The unique identifier for the video you want to retrieve a list of captions for.

Responses

Success

Response body Headers
data array required
pagination object (Pagination) required
Example
{ "itemsTotal": 123, "pagesTotal": 7, "pageSize": 20, "currentPage": 3, "currentPageItems": 20, "links": { "first": { "rel": "first", "uri": "/videos/search?currentPage=1&pageSize=20" }, "previous": { "rel": "previous", "uri": "/videos/search?currentPage=2&pageSize=20" }, "next": { "rel": "next", "uri": "/videos/search?currentPage=4&pageSize=20" }, "last": { "rel": "last", "uri": "/videos/search?currentPage=6&pageSize=20" } } }
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 required
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.

Not Found

Response body Headers
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.

Too Many Requests

Response body Headers
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.

Request examples

// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/CaptionsApi.md#list

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class getExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var videoId = vi4k0jvEUuaTdRAEjQ4Prklg;  // string | The unique identifier for the video you want captions for.
            var language = en;  // string | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).
            var apiCaptionsInstance = apiInstance.Captions();
            try
            {
                // Show a caption
                Caption result = apiCaptionsInstance.get(videoId, language);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CaptionsApi.get: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
// 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/CaptionsApi.md#list

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 := "vi4k0jvEUuaTdRAEjQ4Prklg" // string | The unique identifier for the video you want captions for.
    language := "en" // string | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

    
    res, err := client.Captions.Get(videoId, language)

    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `Captions.Get``: %v\
", err)
    }
    // response from `Get`: Caption
    fmt.Fprintf(os.Stdout, "Response from `Captions.Get`: %v\
", res)
}
// 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/CaptionsApi.md#list

import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.CaptionsApi;
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);

    CaptionsApi apiInstance = client.captions();
    
    String videoId = "vi4k0jvEUuaTdRAEjQ4Prklg"; // The unique identifier for the video you want captions for.
    String language = "en"; // A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

    try {
      Caption result = apiInstance.get(videoId, language);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaptionsApi#get");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/CaptionsApi.md#list

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const captions = await client.captions.list({
  videoId 'vi4k0jvEUuaTdRAEjQ4Prklg', // The unique identifier for the video you want to retrieve a list of captions for.
  currentPage: 2, // Choose the number of search results to return per page. Minimum value: 1
  pageSize: 30, // Results per page. Allowed values 1-100, default is 25.
); 
<?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/CaptionsApi.md#list

require __DIR__ . '/vendor/autoload.php';

$videoId = 'vi4k0jvEUuaTdRAEjQ4Prklg'; // The unique identifier for the video you want to retrieve a list of captions for.

$captions = $client->captions()->list($videoId, array(
    'currentPage' => 2, // Choose the number of search results to return per page. Minimum value: 1)
    'pageSize' => 30 // Results per page. Allowed values 1-100, default is 25.)
)); 
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/CaptionsApi.md#list

import apivideo
from apivideo.api import captions_api
from apivideo.model.not_found import NotFound
from apivideo.model.caption import Caption
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 = captions_api.CaptionsApi(api_client)
    video_id = "vi4k0jvEUuaTdRAEjQ4Prklg" # str | The unique identifier for the video you want captions for.
    language = "en" # str | A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC).

    # example passing only required values which don't have defaults set
    try:
        # Show a caption
        api_response = api_instance.get(video_id, language)
        pprint(api_response)
    except apivideo.ApiException as e:
        print("Exception when calling CaptionsApi->get: %s\n" % e)
// 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/CaptionsAPI.md#list

Response examples

Success

{
  "data": [
    {
      "uri": "/videos/vi3N6cDinStg3oBbN79GklWS/captions/en",
      "src": "https://cdn.api.video/vod/vi3N6cDinStg3oBbN79GklWS/captions/en.vtt",
      "srclang": "en",
      "languageName": "English",
      "default": false
    },
    {
      "uri": "/videos/vi3N6cDinStg3oBbN79GklWS/captions/fr",
      "src": "https://cdn.api.video/vod/vi3N6cDinStg3oBbN79GklWS/captions/fr.vtt",
      "srclang": "fr",
      "languageName": "Française",
      "default": false
    }
  ],
  "pagination": {
    "currentPage": 1,
    "currentPageItems": 2,
    "pageSize": 25,
    "pagesTotal": 1,
    "itemsTotal": 2,
    "links": [
      {
        "rel": "self",
        "uri": "/videos/vi3N6cDinStg3oBbN79GklWS/captions?currentPage=1&pageSize=25"
      },
      {
        "rel": "first",
        "uri": "/videos/vi3N6cDinStg3oBbN79GklWS/captions?currentPage=1&pageSize=25"
      },
      {
        "rel": "last",
        "uri": "/videos/vi3N6cDinStg3oBbN79GklWS/captions?currentPage=1&pageSize=25"
      }
    ]
  }
}

Not Found

{
  "type": "string",
  "title": "string",
  "name": "string",
  "status": 123
}

Too Many Requests

{
  "type": "https://docs.api.video/reference/too-many-requests",
  "title": "Too many requests.",
  "status": 429
}