Video Generation API

Create videos Programmatically

Convert HTML, CSS and Javascript to .mp4

1. Get a Free API Key, This is a free service, so I have to control the usage

Here is a shared API Key 8a662946-13d6-4cfd-9044-b05c21e8bf23

2. Create a Video Generation Job by calling the Video Create API

POST https://api.reelscript.dev/api/video-job/create
Headers:
Authorization: Your API Key
Body:
  • length is the duration to record in miliseconds
  • mode can be "video" or "screenshot"
{ "url": "https://www.youtube.com/watch?v=EEWVJ4RZ4Xg", "fps": 60, "videoBitrate": 6000, "mode": "video", "useEventForStartEnd": false, "length": 20000, "video_height": 1080, "video_width": 1920, "aspectRatio": "16:9" }
Custom Start End / Custom Screenshot time:
  • Instead of using length to control, you can also dispatch javascript Event to control start and end too, just change "useEventForStartEnd" to true, skip the "length" option, and dispatch the relevant JS events
Body:
{ "url": "https://www.youtube.com/watch?v=EEWVJ4RZ4Xg", "fps": 60, "videoBitrate": 6000, "mode": "video", "useEventForStartEnd": true, "video_height": 1080, "video_width": 1920, "aspectRatio": "16:9" }
Events:
  • Video
new CustomEvent("reelscript-event", { bubbles: true, detail: { action: "record-start" } }); new CustomEvent("reelscript-event", { bubbles: true, detail: { action: "record-end" } });
  • Screenshot
new CustomEvent("reelscript-event", { bubbles: true, detail: { action: "take-screenshot" } });

3. Call the Job Status API regularly until the file url is available

GET https://api.reelscript.dev/api/video-job/retrieve/{Job ID}
Headers:
Authorization: Your API Key