For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
StatusSupportDiscussionsLog inSign Up
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
  • ACTIVATE ACCOUNT
    • Create account
  • PRODUCT OS API
    • Overview
  • ERROR CODES
    • Error codes
  • VIDEO ON DEMAND API
    • Overview
      • GETGet list of all media
      • GETGet all clips of a live stream
      • GETGet a media by ID
      • DELDelete a media by ID
      • PATCHUpdate a media by ID
      • POSTAdd audio / subtitle track
      • PUTCancel ongoing upload
      • DELDelete audio / subtitle track
      • PATCHUpdate audio / subtitle track
      • POSTGenerate track subtitle
      • GETGet the summary of a video
      • PATCHUpdate the source access of a media by ID
      • PATCHUpdate the mp4Support of a media by ID
      • GETGet info of media inputs
      • GETGet all unused upload URLs
      • GETGet all clips of a media
  • LIVE STREAM API
    • Overview
  • VIDEO DATA API
    • Overview
LogoLogo
StatusSupportDiscussionsLog inSign Up
VIDEO ON DEMAND APIManage videos

Generate track subtitle

POST
https://api.fastpix.com/v1/on-demand/:mediaId/tracks/:trackId/generate-subtitles
POST
/v1/on-demand/:mediaId/tracks/:trackId/generate-subtitles
$curl -X POST https://api.fastpix.com/v1/on-demand/4fa85f64-5717-4562-b3fc-2c963f66afa6/tracks/d46f5df9-1a8f-4f0a-b56e-9f5b5d5b9e21/generate-subtitles \
> -H "Content-Type: application/json" \
> -u "<username>:<password>" \
> -d '{
> "languageName": "Italian",
> "languageCode": "en-US"
>}'
200Successful
1{
2 "success": true,
3 "data": {
4 "id": "ace60fc7-e876-4fc6-b9d9-c33fa242f84b",
5 "type": "subtitle",
6 "languageCode": "ar-SA",
7 "languageName": "Italian"
8 }
9}
This endpoint allows you to generate subtitles for an existing audio track in a media file. By calling this API, you can generate subtitles automatically using speech recognition #### How it works 1. Send a `POST` request to this endpoint, replacing `{mediaId}` with the media ID and `{trackId}` with the track ID. 2. Provide the necessary details in the request body, including the languageName and languageCode. 3. You receive a response containing a unique subtitle track ID and its details. #### Webhook Events 1. After the subtitle track is generated and ready, you receive the webhook event <a href="https://docs.fastpix.io/docs/transform-media-events#videomediasubtitlegeneratedready">video.media.subtitle.generated.ready</a>. 2. Finally the <a href="https://docs.fastpix.io/docs/media-events#videomediaupdated">video.media.updated</a> event notifies your system about the media’s updated status. </br> Related guide: <a href="https://docs.fastpix.io/docs/add-auto-generated-subtitles-to-videos">Add auto-generated subtitles</a>
Was this page helpful?
Previous

Get the summary of a video

Next
Built with

This endpoint allows you to generate subtitles for an existing audio track in a media file. By calling this API, you can generate subtitles automatically using speech recognition

How it works

  1. Send a POST request to this endpoint, replacing {mediaId} with the media ID and {trackId} with the track ID.

  2. Provide the necessary details in the request body, including the languageName and languageCode.

  3. You receive a response containing a unique subtitle track ID and its details.

Webhook Events

  1. After the subtitle track is generated and ready, you receive the webhook event video.media.subtitle.generated.ready.

  2. Finally the video.media.updated event notifies your system about the media’s updated status.

Related guide: Add auto-generated subtitles

Authentication

AuthorizationBasic

FastPix APIs are secured with Basic Authentication. Use your Access Token ID as the username and Secret Key as the password in the Authorization header of each API request.

  • Username: Access Token ID
  • Password: Secret Key

Activate your FastPix account to generate your API credentials. See the guide here

Path parameters

mediaIdstringRequiredformat: "uuid"
The unique identifier assigned to the media when created. The value must be a valid UUID.
trackIdstringRequiredformat: "uuid"

A universally unique identifier (UUID) assigned to the specific track for which subtitles must be generated.

Request

This endpoint expects an object.
languageNamestringRequiredDefaults to English
The full name of the language used to generate the subtitles.
languageCodeenumRequiredDefaults to en-US
Language code for content localization
metadatamap from strings to stringsOptional

You can search for videos with specific key value pairs using metadata, when you tag a video in “key” : “value” pairs. Dynamic metadata allows you to define a key that allows any value pair. You can have maximum of 255 characters and upto 10 entries are allowed.

Response

Media details updated successfully
successboolean
Demonstrates whether the request is successful or not.
dataobject
Represents the response for a successfully generated subtitle track.