Add a Text

🔤 Add customized text to your videos.

You can add text to the scenes using our API. Adding text is similar to adding any other asset. Follow these easy-breezy steps to learn how to add text to a scene:

  1. Set the type of asset item you want to add.
  2. Specify the font name and fontSize.
  3. Enter the text you want to add to the video.
  4. Define the position of the text asset in the scene using the variables xPosition and yPosition.

🚧

Caution:

Don't forget to replace the placeholder "YOUR_API_KEY" with your unique API key in the header. If you haven't obtained one yet, please contact us at [email protected], and we will provide one as soon as possible.

A request example to add text as an asset in a single-scene video is as follows:

curl --request POST \
     --url https://api.yepic.ai/v1/videos \
     --header 'X-Api-Key: YOUR_API_KEY' \
     --header 'content-type: application/json' \
     --data @- <<EOF
{
     "slides": [
          {
               "overlays": [
                    {
                         "type": "AvatarOverlay",
                         "assetId": "1a901a33-8783-418e-af6a-a66dae945673",
                         "script": "Well done! This is your first video using Yepic's API.",
                         "voiceId": "en-US-JennyMultilingualNeural",               
                         "xPosition": 448,
                         "yPosition": 56,
                         "width": 1024,
                         "height": 1024

                    },
                    {
                         "type": "TextOverlay",
                         "font": "Montserrat",
                         "fontSize": 120,
                         "text": "Yepic API",
                         "xPosition": 59,
                         "yPosition": 66
                    }
               ],
               "backgroundColor": "#fc0a41"
          }
     ],
     "videoTitle": "My first video"
}

For details of the text asset fields, refer to the table below:

FieldsData TypeRequiredDescription
typestringYesThe type of the asset overlay, for example, "AvatarOverlay", "ImageOverlay", "TextOverlay", etc.
fontstringNoThe font type of the text asset.
fontSizenumberNoThe font size of the text asset.
textstringYesThe user-defined text string.
xPositionnumberNoThe x-coordinate of the text's position.
yPositionnumberNoThe y-coordinate of the text's position.

Here's your generated video with the text you just specified:

✅Congratulations! You have successfully added text to your video using our API!

📌 Need help?

If you require assistance or encounter any issues, we recommend referring to our FAQ page first. If you are still unable to resolve your issue, please don't hesitate to contact us for further support.