Generate Video Via API

Build automated image and video editing workflows and applications with Shotstack.

GET STARTED FOR FREE Example

The internet's most advanced image and video editing API

Shotstack is the most user friendly, powerful and reliable infrastructure solution to programmatically generate video.

GET STARTED FOR FREE

The only thing you need is some JSON

{
"timeline": {
"soundtrack": {
"src": "https://assets.mixkit.co/music/download/mixkit-forest-treasure-138.mp3",
"effect": "fadeOut"
},
"fonts": [
{
"src": "https://templates.shotstack.io/basic/asset/font/opensans-regular.ttf"
}
],
"background": "#000000",
"tracks": [
{
"clips": [
{
"asset": {
"type": "html",
"html": "<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT</p>",
"css": "p { font-family: 'Open Sans'; color: #ffffff; font-size: 38px; text-align: center; }",
"width": 950,
"height": 200
},
"offset": {
"y": -0.1
},
"start": 0.5,
"length": 4.5,
"position": "center",
"transition": {
"in": "fade",
"out": "fade"
}
},
{
"asset": {
"type": "html",
"html": "<p>CONSECTETUR ADIPISCING ELIT</p>",
"css": "p { font-family: 'Open Sans'; color: #ffffff; font-size: 38px; text-align: center; }",
"width": 950,
"height": 200
},
"offset": {
"y": -0.1
},
"start": 5,
"length": 4.5,
"position": "center",
"transition": {
"in": "fade",
"out": "fade"
}
},
{
"asset": {
"type": "html",
"html": "<p>MAIN TEXT BLOCK</p>",
"css": "p { font-family: 'Open Sans'; color: #ffffff; font-size: 45px; text-align: center; }",
"width": 950,
"height": 200
},
"offset": {
"y": -0.1
},
"start": 10.5,
"length": 7,
"position": "center",
"effect": "zoomIn",
"transition": {
"in": "fade",
"out": "fade"
}
}
]
},
{
"clips": [
{
"asset": {
"type": "html",
"html": "<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT</p>",
"css": "p { font-family: 'Open Sans'; color: #77111111; font-size: 38px; text-align: center; }",
"width": 950,
"height": 200
},
"offset": {
"x": 0.0025,
"y": -0.104
},
"start": 0.5,
"length": 4.5,
"position": "center",
"transition": {
"in": "fade",
"out": "fade"
}
},
{
"asset": {
"type": "html",
"html": "<p>CONSECTETUR ADIPISCING ELIT</p>",
"css": "p { font-family: 'Open Sans'; color: #77111111; font-size: 38px; text-align: center; }",
"width": 950,
"height": 200
},
"offset": {
"x": 0.0025,
"y": -0.104
},
"start": 5,
"length": 4.5,
"position": "center",
"transition": {
"in": "fade",
"out": "fade"
}
}
]
},
{
"clips": [
{
"asset": {
"type": "video",
"src": "https://player.vimeo.com/external/439955856.hd.mp4?s=d4086b82e870e2f0b67bbb2037b3104075d898b9&profile_id=175&oauth2_token_id=57447761"
},
"start": 0,
"length": 10
},
{
"asset": {
"type": "video",
"src": "https://shotstack-ingest-api-stage-au.s3.ap-southeast-2.amazonaws.com/c9npc4w5c4/zzyb59sw-2slr-sp4v-xdzm-0v75wp4zknme/source.mp4"
},
"length": 7.5,
"start": 10
}
]
}
]
},
"output": {
"format": "mp4",
"size": {
"width": 1920,
"height": 1080
}
}
}

Tutorials & Resources

Learn how to programmatically generate video via API

Demo's & Code Examples

Programmatically Generate video by using demo code

Trim Video
Trim Video

Upload a video and trim the start and end to create a shortened clip using the Shotstack video editing API

Go to demo

Pexels Video Maker
Pexels Video Maker

Search the Pexels stock footage video library and the Shotstack API will automatically compile an edit with music and a title

Go to demo

Compress Video
Compress Video

Video file compressor reduces the file size of a video by reducing it's resolution, frames-per-second (fps) and compression settings

Go to demo