Skip to main content

Developer Guide: Using Automatic Translation Subtitles API

The Automatic Translation Subtitles API enables developers to obtain translated subtitles for videos in various languages. This guide provides detailed instructions on how to use the API to configure the native language of the video and request translated subtitles.

Configuring Video Language

Before requesting translated subtitles, you need to configure the native language of the video. This can be done by specifying the audio_language parameter during the video setup.

Example of video configuration with native language:

In this example, the video identified by "VIDEO_ID" has English as its native language ("eng").

curl --location --request PATCH '/v2/{VIDEO_ID}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'audio_language=eng'

Requesting Translated Subtitles

Once the native language of the video is configured, you can request translated subtitles in the desired language using the captions endpoint.

Example of requesting translated subtitles:

curl --location --request POST '/v2/{VIDEO_ID}/captions/ita' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'ai_generated=true'

In this request, we are asking for translated subtitles for the video in Italian (ita).

For more details, refer to the API documentation.

Review and Publishing

After the translated subtitles are generated, they are hidden by default. You can review them and decide whether to publish them using the patch endpoint of captions.

Note: Translated subtitles may take a few minutes to generate, especially for longer videos.

By following these steps, you can effectively utilize the Automatic Translation Subtitles API to obtain translated subtitles for your videos, enhancing accessibility and reach across different language demographics.