NAV Navbar
shell python javascript

Introduction

The Rocketium video API opens up parts of the Rocketium platform so third-party developers can create and manipulate videos programmatically. The APIs enable you to not only carry out simple video creation tasks, but complex operations like video trimming, cropping, changing video speed, and reversing clips.

Authentication

To authorize, use this code:

import requests

url = "https://api.rocketium.com"

payload = ""
headers = {
    'access_token': "<YOUR_API_KEY>",
    'Content-Type': "application/json"
    }

response = requests.request("GET", url, data=payload, headers=headers)

print(response.text)
# With shell, you can just pass the correct header with each request
curl "https://api.rocketium.com"
  --header "access_token: <YOUR_API_KEY>"
  --header "Content-Type: application/json"
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.rocketium.com");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send(data);

Rocketium uses API keys to allow access its various APIs. Please refer the Quick Starter Guide to get your unique API key. You can use this API key to try our APIs in our Sandbox.

Quickstart

Welcome to the Quickstart Guide for trying out Rocketium’s APIs. Please follow the steps below to create sample automated videos using APIs for free.

Step 1. Sign up

You need to be a signed up user to obtain an API key (no credit card required). In case you do not have an account with Rocketium, please head to Signup page and create a free account. If you already have an account with Rocketium, please login here.

Step 2. Generate API Key

Once you sign up or login, please head to your account settings. Go to the API tab to generate your personal API key.

Step 3. Try out video creation in our Sandbox

You can use your unique API key in our sandbox to call video APIs. For detailed information on the APIs and related parameters please go through the documentation in the next section.

Step 4. Create custom videos

You can change the parameters in the sandbox to generate custom videos by using the API for "Create Video". Click "Submit" and the generated video will be available in your Rocketium dashboard. As a free user you will be able to make up to 10 videos with the Rocketium watermark. Click on "Get Code" to copy the code to run it outside the sandbox.

API - Create video

Rocketium Create video API lets you programmatically create videos by sending along various data points with your request. The Header should contain the access token, which you generated in the previous section. If you do not have an access token, please head to Quickstart section to generate one.

import requests

url = "https://api.rocketium.com/videos"

payload = "{\n        \"title\": \"Benefits of using Rocketium\",\n        \"themeId\": \"5def8jfe7edkkwsdjekcm2\",\n        \"scenes\": [{\n          \"text\" : \"Rocketium is easy to use\",\n          \"image\" : \"https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4\"\n        },\n        {\n          \"text\" : \"Rocketium has its own API\",\n          \"image\" : \"https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4\"\n        }]\n}"
headers = {
    'access_token': "<YOUR_API_KEY>",
    'Content-Type': "application/json"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
curl --request POST \
  --url https://api.rocketium.com/videos \
  --header 'Content-Type: application/json' \
  --header 'access_token: <YOUR_API_KEY>' \
  --data '{"title": "Benefits of using Rocketium", "themeId": "5a15310cabc5e17e6bf29525", "scenes": [{"text" : "Rocketium is easy to use", "image" : "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4"}, { "text" : "Rocketium has its own API", "image" : "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4" }]}'
var data = JSON.stringify({
  "title": "Benefits of using Rocketium",
  "themeId": "5def8jfe7edkkwsdjekcm2",
  "scenes": [
    {
      "text": "Rocketium is easy to use",
      "image": "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4"
    },
    {
      "text": "Rocketium has its own API",
      "image": "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4"
    }
  ]
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.rocketium.com/videos");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send(data);

Make sure to replace <YOUR_API_KEY> with your API key along with themeId and scenes data.

URL

Access the Create Video API at https://api.rocketium.com/videos. Try in Sandbox.

HTTP Method

POST request

Headers

Request

Body

You can pass the following parameters in your data block to create a video.

Key Type Value
scenes Array of Scene objects Every video consists of multiple scenes, each with media (image, video, or GIF), voice-over, and captions. This field has details of the scenes.
themeId String ID of theme to be used to apply styles. You can get this by calling the Get Themes API.
title (optional) String Title of the video. This will be visible in your workspace.
logoImage (optional) String URL of image to be used as logo.
metadata (optional) JSON String A custom object that can be sent to be associated with this video. This entire object will be sent in the response to a webhook callback, if any. This is useful for associating videos with users, products, or any other internal identifiers.
audio (optional) String URL of an audio file. If this is not provided, audio from the specified theme will be used.
draftOnly (optional) boolean Passing true will only create a draft in the Rocketium library but not render it as an mp4 video file. The default value is false i.e. without any input for this parameter a video will be generated and count against the 10 videos for a free user.
id (optional) String The unique ID of a video returned from an earlier create API call. This can be used to make a copy of an existing video.
audio_mood (optional) String One of cheerful, dramatic, serious, inspirational, bright, comical, country. If this is present, the file specified in audio will be ignored and we will randomly select an audio track from Rocketium's free audio library in the specified category.
orientation (optional) String One of landspace, square, portrait, fbCover, instagramAd

Scene object

Key Type Value
image String, Media object, Search result object The image, GIF, or video to be shown in the scene. If a string is passed, it should be a publicly accessible link to the file.
text (optional) String, Array of String, Text object, Array of Text object Captions in the scene. Text can include HTML formatting tags h1, strong, and em.
delay (optional) Number Number of seconds by which all the captions in this scene should be delayed
multiplier (optional) Number Speed at which the text should be shown. See note on speed and calculation of caption duration.
styles (optional) Scene styles object Additional styles that should be applied to this scene. These styles will override styles specified in the theme.
audio (optional) String, Text-to-speech API request data URL of an mp3 file containing the voice-over for this scene. Can also share text and voice to create voice-over automatically by passing parameters for the text-to-speech API.

Media object

Key Type Value
url String URL of the image, GIF, or video. This should be publicly accessible. If using Google Drive, Dropbox, or other cloud storage links, ensure that the link is to the direct file not a page with comments and download / share buttons.
fullDuration (optional) Boolean If true, the video in the scene will play for its full duration. If false, it will play as long as the captions.
loop (optional) Boolean If true, the video in the scene will loop when its duration is shorter than the duration of the scene. If false, it will stop at its last frame instead of looping.
mute (optional) Boolean If true, the audio in the video in this scene will be muted
user (optional) String Text attribution for the content owner. For example, Aaron (Unsplash) or HBO (Youtube)
icon (optional) String An icon to indicate the source of this image or video. This should be passed as an HTML snippet - <i class="ICON"></i>. Allowed values for ICON are:-
  • r-credits-icon-image - image
  • r-credits-icon-video-camera - video
  • r-credits-icon-globe - webpage
  • r-credits-icon-facebook - Facebook
  • r-credits-icon-instagram - Instagram
  • r-credits-icon-youtube - Youtube

Search result object

Key Type Value
image String, Search result object, Media object URL of the image, GIF, or video to be shown in the scene
text (optional) String, Array of String, Text object, Array of Text object The captions to be shown over the media. This can include HTML formatting tags h1, strong, and em

Text object

Key Type Value
text (optional) String, Array of String Captions in the scene. Text can include HTML formatting tags h1, strong, and em.
type (optional) String Can be one of caption, sticky, and lower-third
delay (optional) Number Number of seconds by which all the caption should be delayed
multiplier (optional) Number Speed at which the text should be shown. See note on speed and calculation of caption duration.
styles (optional) Text styles object Additional styles that should be applied to this caption. These styles will override styles specified in the theme and the scene.

Text styles object

Key Type Value
captionPosition (optional) Position object Custom position for the caption. This will override the position that was specified in the theme.

Position object

Key Type Value
top Integer percentage value from 0 (topmost) to 100 (bottommost) for the right corner
bottom Integer percentage value from 0 (topmost) to 100 (bottommost) for the right corner
left Integer percentage value from 0 (leftmost) to 100 (rightmost) for the right corner
right Integer percentage value from 0 (leftmost) to 100 (rightmost) for the right corner

Scene styles object

Key Type Value
mediaPosition (optional) Position object Custom position for the media (image, video, or GIF) in the scene. This will override the position that was specified in the theme.
overlay (optional) String Link to the animated overlay that should be applied to this scene
transition (optional) - String Link to the animated transition that should be applied to this scene

Response

{
    "message": "successful",
    "videoId": "video1234567890",
    "videoUrl": "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4"
}

The response from the API will contain a message indication successful or error, along with the videoId which you can use to retrieve the video.

API - Get video

Once your video is created, you can easily retrieve it with a simple API call.

import requests

url = "https://api.rocketium.com/videos/<ID>"

payload = ""
headers = {
    'access_token': "<YOUR_API_KEY>",
    'Content-Type': "application/json"
    }

response = requests.request("GET", url, data=payload, headers=headers)

print(response.text)
curl "https://api.rocketium.com/videos/<ID>" --header "access_token: <YOUR_API_KEY>"
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.rocketium.com/videos/<ID>");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send(data);

Make sure to replace <YOUR_API_KEY> with your API key along with <id> with your video Id.

URL

Access the Retrieve video API here: https://api.rocketium.com/videos/<id>. Try in Sandbox

Method

GET Request

Headers

Request

URL parameter

Response

{
    "message": "successful",
    "url": "https://rocketium.com/videos/1234567890/resized/abcdefgh.mp4"
}

The response from the API will contain a message indication successful, in_progress or error. If the message was successful the response will have the url which you can use to access the video. If the message was in_progress the response will have percent indicating the progress in generating the video.

API - Get themes

This API returns themes associated with your account and public themes available to all users.

import requests

url = "https://api.rocketium.com/api/v2/themes"

payload = ""
headers = {
    'access_token': "<YOUR_API_KEY>",
    'Content-Type': "application/json"
    }

response = requests.request("GET", url, data=payload, headers=headers)

print(response.text)
curl --request GET \
  --url https://api.rocketium.com/api/v2/themes \
  --header 'Content-Type: application/json' \
  --header 'access_token: <YOUR_API_KEY>'
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.rocketium.com/api/v2/themes");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send(data);

Make sure to replace <YOUR_API_KEY> with your API key.

URL

Access the Retrieve themes API here: https://api.rocketium.com/api/v2/themes

Method

GET Request

Headers

Available Public Themes

Rocketium users get access to public themes designed for many use cases. Both public themes and your own private themes are returned when you call this API. In the sandbox the below mentioned theme IDs can be used for testing.

Example theme name Theme ID Theme preview
Insider 5a15310cabc5e17e6bf29525 Link
Elegant Green 599ec30b27855975ab36a1b9 Link
Chalkboard 5a0ab21aabc5e17e6bf28c2b Link

API - Search footage

Rocketium Search Footage API allows you to search millions of stock images with a simple line of code.

import requests

url = "https://api.rocketium.com/assets/video/search"

querystring = {"query":"Hurricane%20Irma"}

payload = ""
headers = {
    'access_token': "<YOUR_API_KEY>",
    'Content-Type': "application/json"
    }

response = requests.request("GET", url, data=payload, headers=headers, params=querystring)

print(response.text)
curl --request GET \
  --url 'https://api.rocketium.com/assets/video/search?query=Hurricane%20Irma' \
  --header 'Content-Type: application/json' \
  --header 'access_token: <YOUR_API_KEY>'
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.rocketium.com/assets/video/search?query=Hurricane%20Irma");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send(data);

Make sure to replace <YOUR_API_KEY> with your API key.

URL

Access the Search stock footage API here: https://api.rocketium.com/assets/video/search

Method

GET Request

Request

Query parameters

Response

{
  message: "successful", 
  images: [{
    thumbnail: String - URL of a thumbnail for preview
    url: String - URL of the image or video
    title: String - title of the image or video
    source: String - this will always be VideoBlocks and can be ignored
    source_url: String - prefix of the URL and can be ignored
    user: String - this will always be videoblocks and can be ignored
    videoId: String - this is the internal identifier for the video and can be ignored
    tags: String[] - tags related to the video
  },
  {...}]
}

The response from the API will contain a message indication successful or error, along with the images which you can use to access the media.

API - Text-to-speech

Rocketium text-to-speech API allows you to create natural-sounding voice-overs for use in your videos using text.

import requests

url = "https://api.rocketium.com/speech"

payload = "{\n  \"text\": \"Rocketium is easy to use\",\n  \"voice\": \"uk-female1\"\n}"
headers = {
    'access_token': "<YOUR_API_KEY>",
    'Content-Type': "application/json"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
curl --request POST \
  --url https://api.rocketium.com/speech \
  --header 'Content-Type: application/json' \
  --header 'access_token: <YOUR_API_KEY>' \
  --data '{\n "text": "Rocketium is easy to use",\n "voice": "uk-female1"\n}'
var data = JSON.stringify({
  "text": "Rocketium is easy to use",
  "voice": "uk-female1"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.rocketium.com/speech");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send(data);

Make sure to replace <YOUR_API_KEY> with your API key.

Method

POST Request

Headers

Request

Body

You can pass the following parameters in your data block to create the speech.

Key Type Value
text String Text to convert automatically to speech
voice String Voice in which the voice should speak. Supported values are - in-female1, us-female1, us-male1, uk-female1, uk-male1.

Response

{
    "message": "successful",
    "url": "https://rocketium.com/textToSpeech/abcd_speech.mp3"
}

The response from the API will contain a message indication successful or error, along with the url containing the link to the voice-over audio.