All URIs are relative to https://ws.api.video
Method | Description | HTTP request |
---|---|---|
upload() | Upload a caption | POST /videos/{videoId}/captions/{language} |
get() | Retrieve a caption | GET /videos/{videoId}/captions/{language} |
update() | Update a caption | PATCH /videos/{videoId}/captions/{language} |
delete() | Delete a caption | DELETE /videos/{videoId}/captions/{language} |
list() | List video captions | GET /videos/{videoId}/captions |
Upload a VTT file to add captions to your video. More information can be found here
Name | Type | Required | Description |
---|---|---|---|
videoId | string | yes | The unique identifier for the video you want to add a caption to. |
language | string | yes | 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. |
file | string | Readable | Buffer | yes | The video text track (VTT) you want to upload. |
Promise<Caption>.
Retrieve a caption for a video in a specific language. If the language is available, the caption is returned. Otherwise, you will get a error indicating the caption was not found.
Tutorials that use the captions endpoint.
Name | Type | Required | Description |
---|---|---|---|
videoId | string | yes | The unique identifier for the video you want captions for. |
language | string | yes | 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. |
Promise<Caption>.
To have the captions on automatically, use this method to set default: true.
Name | Type | Required | Description |
---|---|---|---|
videoId | string | yes | The unique identifier for the video you want to have automatic captions for. |
language | string | yes | 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. |
captionsUpdatePayload | CaptionsUpdatePayload | yes |
Promise<Caption>.
Delete a caption in a specific language by by video id.
Name | Type | Required | Description |
---|---|---|---|
videoId | string | yes | The unique identifier for the video you want to delete a caption from. |
language | string | yes | 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. |
Promise<void>.
Retrieve a list of available captions by video id.
Name | Type | Required | Description |
---|---|---|---|
videoId | string | yes | The unique identifier for the video you want to retrieve a list of captions for. |
currentPage | number | no | Choose the number of search results to return per page. Minimum value: 1 |
pageSize | number | no | Results per page. Allowed values 1-100, default is 25. |
Promise<CaptionsListResponse>.