Text-to-Video by API

Convert text-based content, such as tips, quotes, blog articles, and more, into compelling videos generated through an API. Whether you want to add animated text captions to your existing videos or leverage AI technology to create new content, you can automate it using Node.js, PHP, Ruby, Python or no-code tools like Zapier.
  • Turn text to video by API
  • Generate video content for social media
  • Create text-based videos at scale

Tutorial: How to Convert Text to Video by API

Below is a brief overview of how to turn text into videos using Creatomate's API. Let's consider social media video. First, you need a template to automate these videos. Once you have that template, you can use it to auto-generate videos based on the text you provide through the API.

Start with a video template

There are several ready-made templates you can use, but you can also create your own video designs using the editor. With support for text animations, emojis, and auto-sizing content, you can automate virtually any text-based video you can think of.

A template consists of dynamic elements, such as text captions, images, video clips, and more. These elements can be replaced with other text and media using the API in the next step.

curl -s -X POST https://api.creatomate.com/v1/renders \
  -H 'Authorization: Bearer Your-API-Key' \
  -H 'Content-Type: application/json' \
  --data-binary @- << EOF
  "template_id": "Your Video Template ID",
  "modifications": {
    "Question": "What did the polar bear say when he saw the igloo 🐻‍❄️ ?",
    "Answer": " "It looks like a cool place to chill!" 🤣 "

Generate videos using the API

Generating unique videos is as easy as calling a single REST endpoint. Your application can invoke this request using a simple HTTP request (using Node.js, PHP, Ruby, or Python) or using Creatomate's official libraries. Alternatively, you can set up an automated workflow in Zapier such as the one described in this text-to-video tutorial.

By supplying the template ID and dynamic values to the REST API, you can create a video based on the template from step one. In response to this HTTP request, the URL of the generated video is returned.

Generate videos automatically

Whatever kind of text-based video you want to make, the API provides a means of automating the process.

If you don't need a fully automated workflow, you can also create videos using a simple spreadsheet or form. These methods do not require API integration, so be sure to check out those tutorials as well.

Want to try it yourself? Get started for free in minutes:

Frequently asked questions

How do I turn text into videos using an API?

Start by making a template in the editor, which will serve as a base for your videos. Then, any element of that template can then be replaced with other content by calling the API using a programming language or no-code automation tool.

What kind of videos can I automate?

There's no limit to what kind of video can be automated. Think about social media videos, promotional videos, personalized videos, and more. The easiest way is to make a template in the video editor. Alternatively, you can use the JSON-to-video script to generate text-based videos completely from scratch.

Can I use AI with the Text-to-Video API?

Yes, you can use AI technology in your workflow, such as OpenAI's ChatGPT, to generate video content. Here are two step-by-step tutorials on how to do this using code and Zapier.

What’s the best API to generate video from text?

We believe Creatomate is the most comprehensive and cost-efficient API to turn text into videos. It offers all the tools you need to automate videos, including auto-sizing content, emoji support, and various pre-set (text) animations. Take a look at our article about the best Video Generation APIs for a more detailed comparison.

Quickly get started

Learn how to automate your videos by following our practical tutorials.

Start automating today

Start with a full-featured trial with 50 credits, no credit card required.
Get started for free