Endpoints

POST /api/v1/render

Starts the rendering of the Project object sent as payload.

Example request:

curl -X POST 'https://videocode.io/api/v1/render' \
-H 'Authorization: Bearer 8d5c3e12-6531-4053-bbab-example' \
-H 'Content-Type: application/json' \
-d '{
"fps": 30,
"type": "video",
"width": 500,
"height": 500,
"tracks": [
{
"start": 0,
"duration": 120,
"keyframes": [
{
"containerStyle": {
"display": "flex",
"justifyContent": "center",
"alignItems": "center",
"height": "100%",
"width": "100%",
"backgroundColor": "white"
},
"elementStyle": {
"textAlign": "center",
"opacity": "var(--spring)",
"color": "black",
"transform": "scale(var(--spring))",
"fontSize": "180px"
},
"keyframe": 0,
"variables": [
{
"name": "spring",
"outputRange": [
0,
1
],
"damping": 4,
"mass": 1,
"stiffness": 100,
"overshootClamping": false,
"type": "spring"
}
]
},
{
"containerStyle": {
"display": "flex",
"justifyContent": "center",
"alignItems": "center",
"height": "100%",
"width": "100%",
"backgroundColor": "white"
},
"elementStyle": {
"textAlign": "center",
"color": "black",
"fontSize": "180px"
},
"keyframe": 108,
"variables": []
}
],
"element": {
"type": "p",
"text": "Hello 🌎"
}
}
],
"output": "gif",
"gifRenderEveryNthFrame": 1,
"gifLoop": true
}'

Example response when project is of type video:

{
"renderId": "xu1lybc0mc",
"creditsRemaining": 98321.1
}

Example response when project is of type image or still:

{
"url": "https://s3.us-east-1.amazonaws.com...out.png",
"creditsRemaining": 8320.1
}

GET /api/v1/status

Gets the status of a render. After calling /render with a project of type video, call this endpoint to get the URL of the render.

Example request:

curl -X GET "https://videocode.io/api/v1/status?id=exampleRenderId" -H "Authorization: Bearer 8d5c3e12-6531-4053-bbab-example"

Where exampleRenderId is the renderId value from the /render endpoint response.

Example response when the video is not ready:

{
"percentageDone": 33.33333333,
"url": null,
}

Example response when the video is ready:

{
"percentageDone": 100,
"url": "https://s3.us-east-1.amazonaws.com...out.mp4",
}

HTTP response codes

The API can return different HTTP codes:

CodeDescription
200OK.
400Bad request: check the data sent in the request.
401Unauthorized: your API key is wrong.
402Payment required: you have run out of credits.
429Too many requests: limit is 60 per minute.
500Internal server error.