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 using images, clips, text, and audio. 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

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.
teamId (optional) String ID of workspace where the exported video should be saved. If this is not specified, the video will be available in the last workspace you have opened. Please talk to your account manager to get this ID.
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 or Share object 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. If the specified object is a Share object, the video will be shared to the specified destination after it has been rendered.
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.
resolution (optional) String Resolution of the output video. Can be one of 360p, 720p, and 1080p. The numbers represent the pixels of vertical resolution in the output video.
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
videoBackground (optional) String URL of an image or video to use as the background of the entire video. This will only show up in scenes where the image does not cover the entire scene.
fadeOutVideo (optional) Boolean Specify if the video should fade to black at the end. Default value is true.
fadeOutAudio (optional) Boolean Specify if the audio should fade out at the end. Default value is true.
export-settings (optional) Export setting object Additional export settings for the video such as bitrate.

Export Settings object

Key Type Value
bitrate (optional) String The expected average bitrate of the exported video. 1M indicates 1 megabits per second quality, 1.5M indicates 1.5 megabits per second quality, and so on. You can also specify values in kilobits per second - 1000k is 1,000 kilobits per second, 1500k is 1,500 kilobits per second.

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)
access-type (optional) String Specify how the object should be accessed. Allowed value is secure-s3. Ensure that you have set the appropriate S3 policy. Please get in touch with us to get the correct S3 bucket policy.
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.
layoutId (optional) String Position for the caption from one of 9 positions in a grid. Allowed values are One of these 9 position for the caption. This will override the position that was specified in the theme. image-heading-top-left, image-heading-top, image-heading-top-right, image-heading-center-left, image-heading-center, image-heading-center-right, image-heading-bottom-left, image-heading-bottom, image-heading-bottom-right.
caption-background (optional) String Link to a background that should be applied to this caption. This can be an image file (JPG, JPEG, or PNG), webm file, or a link to a motion graphic file returned by the Create motion graphic API.

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. This can be a PNG file, webm file, or a link to a motion graphic file returned by the Create motion graphic API.
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 progress indicating the progress in generating the video.

API - Create motion graphic

Rocketium Create motion graphic API lets you programmatically create motion graphics like overlays, transitions, and caption backgrounds using images and clips.

import requests

url = "https://api.rocketium.com/motion-graphics"

payload = "{\n    \"asset\": \"https://mysite.com/assets/purple-cut-out-overlay.png\",\n    \"type\": \"overlay\",\n    \"orientation\": \"landscape\",\n    \"loop\": \"true\"\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/motion-graphics \
  --header 'Content-Type: application/json' \
  --header 'access_token: <YOUR_API_KEY>' \
  --data '{\n    "asset": "https://mysite.com/assets/purple-cut-out-overlay.png",\n    "type": "overlay",\n    "orientation": "landscape",\n    "loop": "true"\n}'
var data = JSON.stringify({
  "asset": "https://mysite.com/assets/purple-cut-out-overlay.png",
  "type": "overlay",
  "orientation": "landscape",
  "loop": "true"
});

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/motion-graphics");
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 Create Video API at https://api.rocketium.com/motion-graphics.

HTTP Method

POST request

Headers

Request

Body

Key Type Value
asset String Every motion graphic element is created from an existing asset. We support PNG and webm files. Pass a publicly-accessible link to the asset file.
type String Type of motion graphic to create. Allowed values are overlay and caption-background.
orientation (optional) String Orientation of the motion graphic. Allowed values are landscape, square, portrait, fbCover, instagram.
loop (optional) Boolean Specify if the overlay should loop after it finishes playing or freeze after reaching the end.

Response

This API might take up to 5 seconds as it involves rendering the asset into a motion graphic element.

{
    "message": "successful",
    "url": "https://rocketium.com/video_effects/videos/1234567890.webm"
}

Error codes

The message will be error if the API encountered an error. Details of the error will be in the details field. Possible values for this field are below.

details value Explanation
missing-asset No asset URL specified in the request
missing-type No type specified in the request
asset-inaccessible Asset is not accessible
asset-invalid Asset is not a PNG or webm file
orientation-invalid Asset is not one of landscape, square, portrait, fbCover, instagram
loop-invalid loop is not one of true and false

API - Share

Rocketium Share API lets you programmatically share videos, GIFs, or images to social, cloud storage, and advertising platforms.

import requests

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

payload = "[\n  {\n    \"platform\": \"facebook\",\n\t\"page-id\": \"1637158723183379\",\n\t\"description\": \"This is an overview video of Citadel Corp.\",\n\t\"publish-at\": \"2019-03-12T08:34:37.621Z\",\n\t\"title\": \"Citadel Corp overview\",\n\t\"thumbnail\": \"http://citadel.com/images/thumbnail.jpg\",\n\t\"media\": \"http://citadel.com/videos/overview.mp4\"\n  },\n  {\n    \"platform\": \"youtube\",\n\t\"channel-id\": \"UCvtl87vJeCZfQO7HaKzLpfw\",\n\t\"description\": \"This is an overview video of Citadel Corp.\",\n\t\"title\": \"Citadel Corp overview\",\n\t\"tags\": [\"Citadel\", \"corporate\"],\n\t\"visibility\": \"public\",\n\t\"thumbnail\": \"http://citadel.com/images/thumbnail.jpg\",\n\t\"media\": \"http://citadel.com/videos/overview.mp4\"\n  }\n]"
headers = {
    'access_token': "<YOUR_API_KEY>",
    'Content-Type': "application/json",
    'cache-control': "no-cache",
    'Postman-Token': "d00d2983-aec9-4c63-8397-f69f4a4576ea"
    }

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

print(response.text)
curl --request POST \
  --url https://api.rocketium.com/share \
  --header 'Content-Type: application/json' \
  --header 'Postman-Token: 35efbc24-268b-4f7c-8d1b-65c29a26c6f5' \
  --header 'access_token: <YOUR_API_KEY>' \
  --header 'cache-control: no-cache' \
  --data '[\n  {\n    "platform": "facebook",\n "page-id": "1637158723183379",\n  "description": "This is an overview video of Citadel Corp.",\n  "publish-at": "2019-03-12T08:34:37.621Z",\n "title": "Citadel Corp overview",\n "thumbnail": "http://citadel.com/images/thumbnail.jpg",\n "media": "http://citadel.com/videos/overview.mp4"\n  },\n  {\n    "platform": "youtube",\n  "channel-id": "UCvtl87vJeCZfQO7HaKzLpfw",\n "description": "This is an overview video of Citadel Corp.",\n  "title": "Citadel Corp overview",\n "tags": ["Citadel", "corporate"],\n "visibility": "public",\n "thumbnail": "http://citadel.com/images/thumbnail.jpg",\n "media": "http://citadel.com/videos/overview.mp4"\n  }\n]'
var data = JSON.stringify([
  {
    "platform": "facebook",
    "page-id": "1637158723183379",
    "description": "This is an overview video of Citadel Corp.",
    "publish-at": "2019-03-12T08:34:37.621Z",
    "title": "Citadel Corp overview",
    "thumbnail": "http://citadel.com/images/thumbnail.jpg",
    "media": "http://citadel.com/videos/overview.mp4"
  },
  {
    "platform": "youtube",
    "channel-id": "UCvtl87vJeCZfQO7HaKzLpfw",
    "description": "This is an overview video of Citadel Corp.",
    "title": "Citadel Corp overview",
    "tags": [
      "Citadel",
      "corporate"
    ],
    "visibility": "public",
    "thumbnail": "http://citadel.com/images/thumbnail.jpg",
    "media": "http://citadel.com/videos/overview.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/share");
xhr.setRequestHeader("access_token", "<YOUR_API_KEY>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.setRequestHeader("Postman-Token", "beb64f70-4ffe-403a-89c9-0d7f64194691");

xhr.send(data);

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

URL

Access the Share API at https://api.rocketium.com/share.

HTTP Method

POST request

Headers

Request

Body

Key Type Value
videoId String ID of the video you want to retrieve. This is the same as the videoId field returned in the response of the Create Video API.
targets Array of Share objects An array of objects representing individual shares.

Share object

Key Type Value
platform String Platform where the media should be shared. Allowed values are facebook-page and youtube.
pageId String ID of the page to which image or video should be shared. Only applicable when platform is facebook-page.
description String Text description of the media. Can contain emoji. 🎉
publishAt (optional) String Time when the image or video should be published. Should be specified in the ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. Only applicable when platform is facebook-page.
title String Text description of the media. Can contain emoji. 🎉
thumbnail (optional) String Publicly accessible link to an image to be shown as thumbnail. Only applicable when platform is youtube.
tags Array of String Keywords for the video that help in discovery by users. Only applicable when platform is youtube.
visibility String Controls who can see the video. Allowed values are public, private, and unlisted. Only applicable when platform is youtube.

Response

{
    "message": "successful",
    "details": "Your video was shared successfully to Youtube"
}

Error codes

The message will be error if the API encountered an error. Details of the error will be in the details field. Possible values for this field are below.

details value Explanation
platform-invalid platform is not one of facebook-page and youtube
access-invalid The account does not have access to the specified page or channel
asset-inaccessible Asset is not accessible
asset-invalid Asset is not a PNG or webm file
visibility-invalid visibility is not one of private, public, unlisted

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

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.