JSON2Video API is the easiest way to create, edit and customise videos programmatically. Its dead simple approach, similar to the web development mindset, makes it the ultimate solution for developers that want to create or customise videos in an automated way.

Additionally, the simple integration of real HTML5+CSS elements, the already built-in templates, animations and voice generation (TTS) converts JSON2Video in the best video editing API solution.

Authentication

All calls to the API require authentication.

You must pass your API key in the x-api-key header of your request.

How to create a movie?

The resulting video of a JSON2Video API call is called movie. A movie is created from a JSON document that specifies the properties of the resulting video as well as the content of the video.

Check JSON2Video API specification to learn about all properties of this JSON document.

To create a movie, you just call the endpoint /v2/movies with a POST request passing the JSON as payload:

curl --location --request POST 'https://api.json2video.com/v2/movies' \
--header 'x-api-key: [[YOUR_APIKEY]]' \
--header 'Content-Type: application/json' \
--data-raw '[[YOUR_JSON]]'

The request returns immediately, but not before starting a server-side job that will create the movie. The job can take several minutes, depending on the complexity of the JSON script. The endpoint returns a project ID for that job.

{
    "success": true,
    "project": "[[YOUR_PROJECT_ID]]",
    "timestamp": "2022-08-01T10:49:52.924Z"
}

Once the job started remotely, you can check the status, if it finished or if an error occurred:

curl --location --request GET 'https://api.json2video.com/v2/movies?project=[[YOUR_PROJECT_ID]]' \
--header 'x-api-key: [[YOUR_APIKEY]]'

You can also get notified when the movie is ready via a webhook, or automate the publication to YouTube, to a FTP or SFTP server, or send an email. Check the Exports documentation for more details.

The movie document

Movie JSON documents have the following structure:


Fatal error: Uncaught TypeError: substr(): Argument #1 ($string) must be of type string, array given in /var/www/json2video.com/html/tpl/common.php:1146 Stack trace: #0 /var/www/json2video.com/html/tpl/common.php(1146): substr() #1 /var/www/json2video.com/html/docs/tutorial/getting-started/index.php(86): show_code() #2 {main} thrown in /var/www/json2video.com/html/tpl/common.php on line 1146