Product announcements
Animate a headline and feature list for a launch post, then export a GIF for the changelog.
HTML to Video API
Send HTML and CSS with a list of actions. The API loads the page in headless Chrome, records it, and returns a hosted MP4, WebM, or GIF URL.
Live demo
Edit this example or paste in your own HTML and CSS, then record it.
HTML recording API
Recording begins once the page has loaded. Start your animation from the first action, so the first frame of the video is the first frame of the animation.
Keyframes, transitions, and script-driven changes are recorded as Chrome renders them.
An execute_javascript action runs after capture begins. Use it to add the class that starts your animation.
Set output.format, and optionally output.fps and output.scale.
The response has the recording_url, and a status_url to poll while it renders.
Recording actions
Actions run in order while the page is recorded: scroll, click, run JavaScript, wait. A locate_selector action branches on whether an element is on the page.
if_found and if_not_found are each an array of actions. This clicks .show-details when it exists and moves on when it doesn't.
{
"type": "locate_selector",
"selector": ".show-details",
"if_found": [
{ "type": "click", "selector": ".show-details" }
],
"if_not_found": []
}Each step has its own target, duration, and easing. This one takes two seconds to reach #features.
{
"type": "scroll",
"steps": [{
"to": { "type": "selector", "selector": "#features" },
"duration_ms": 2000,
"easing": "ease_in_out_cubic"
}]
}The script is an async function body. The next action waits until it finishes, including anything it awaits.
{
"type": "execute_javascript",
"script": "document.querySelector('#features').classList.add('highlight');",
"timeout_ms": 1000
}A stall can go anywhere in the sequence. This one keeps the highlighted section on screen for one second before the recording ends.
{ "type": "stall", "duration_ms": 1000 }Use cases
Animate a headline and feature list for a launch post, then export a GIF for the changelog.
Draw a chart or counter from your data with JavaScript and record it as it animates.
Record a transition or interaction once and embed the clip in docs, release notes, or email.
Turn a customer's activity, milestones, or results into a short, branded video using your HTML and CSS.
Output
Set output.format. The HTML, CSS, and actions stay the same.
MP4, WebM, and animated GIF. Recordings do not include audio. Video defaults to 30 FPS; GIF defaults to 15 FPS.
Set output.scale to 0.5 to halve the exported width and height while keeping the same page layout. A shorter duration or a lower output.fps also makes the file smaller.
Yes. Send url instead of html. See the Scrolling Screenshots API, or try a URL in the scrolling screenshot tool.
Ready to record?
Paste HTML and CSS into the console, add an action, and get back an MP4, WebM, or GIF URL.
Related features
Learn about related options for image and PDF generation, storage, security, and team access.