Skip to content
HTML/CSS to ImageDocs

Record HTML/CSS or a live webpage as an MP4, WebM, or animated GIF. Recordings use the same Chrome renderer as images, so your fonts, CSS, and JavaScript work the same way.

Use them for scrolling website walkthroughs, product demos, animated social posts, and CSS or JavaScript animations. Add a voiceover or background music to an MP4 or WebM with the optional audio parameter. GIFs do not support audio.

  • In your dashboard: open the Image Console and switch to Recording. Enter a URL or HTML/CSS, choose the duration and actions, and create the recording. It appears in Recordings with its URL, ready to share or embed.
  • Scroll through a webpage: paste a public URL into the scrolling screenshot tool and download it as an MP4, WebM, or GIF.

Once you have a recording you like, use the same settings with the API, a client library, or MCP.

Send html or url, a duration_ms, and optionally some actions to POST /v1/recording:

Terminal window
curl -X POST 'https://hcti.io/v1/recording' \
-u "$HCTI_API_ID:$HCTI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"url": "https://example.com/",
"viewport_width": 1280,
"viewport_height": 720,
"duration_ms": 10000,
"actions": [{ "type": "simple_scroll" }]
}'
{
"id": "01a1b2c3-d4e5-7f60-8a9b-0c1d2e3f4a5b",
"recording_url": "https://hcti.io/v1/recording/01a1b2c3-d4e5-7f60-8a9b-0c1d2e3f4a5b.mp4",
"status_url": "https://hcti.io/v1/recordings/01a1b2c3-d4e5-7f60-8a9b-0c1d2e3f4a5b/status"
}

Use recording_url like an image URL. Download it, or put it straight into your website, app, or email:

<video src="https://hcti.io/v1/recording/01a1b2c3-d4e5-7f60-8a9b-0c1d2e3f4a5b.mp4" autoplay muted loop playsinline></video>

If the recording isn’t finished when the URL is requested, the request waits and then returns it. In a workflow, you can optionally check its status instead.

See Using the API for the full request and response.

Choose one source per MP4 or WebM recording. Use audio.asset_id for a file in your HCTI Asset Library or audio.url for an audio file you already host.

Upload your narration and leave HCTI only selected. Use the id returned by the upload as audio.asset_id. For a file you already uploaded, list your assets with GET /v1/assets?media_type=AUDIO to find its ID. Upload guide · Assets API

For example, send this JSON to POST /v1/recording, replacing YOUR_ASSET_ID with the narration’s ID. The title fades in during the first second, then the voiceover starts. You can reuse the same ID when you update the title and record it again.

{
"html": "<h1>Introducing the Asset Library</h1>",
"css": "@keyframes reveal { from { opacity: 0; } to { opacity: 1; } } .recording h1 { animation: reveal 1s both; }",
"duration_ms": 6000,
"duration_mode": "fixed",
"actions": [{ "type": "execute_javascript", "script": "document.body.classList.add('recording')" }],
"audio": { "asset_id": "YOUR_ASSET_ID", "delay_ms": 1000 }
}

If your track is already on a website or CDN, HCTI can fetch it at render time. In this request to POST /v1/recording, replace the top-level url with the webpage to record and audio.url with a direct HTTP or HTTPS link to your audio file.

{
"url": "https://example.com/",
"duration_ms": 6000,
"duration_mode": "fixed",
"actions": [{ "type": "simple_scroll" }],
"audio": {
"url": "https://cdn.example.com/audio/intro.mp3",
"when_audio_ends": "loop"
}
}

If the track is shorter than the six-second MP4, it repeats until the video ends. To let viewers hear the soundtrack on your site, embed the returned URL with playback controls, for example <video src="RECORDING_URL" controls playsinline></video>. Audio options and examples

Parameter What it does
duration_ms Required. How long the recording is, from 500 ms to 30 seconds (90 in target mode).
actions What happens while recording: simple_scroll down a page, scroll to exact spots, click, stall, execute_javascript, and branches for elements that may not exist. Leave it out to record the page as it is.
duration_mode How the actions fit into duration_ms. at_most (default) ends when the actions finish. fixed captures for duration_ms. at_least lets the actions run long. target speeds up or slows down the video to fit.
trigger When recording starts: right away, when an element appears, or when your page calls window.RecordingReady().
output Format (mp4, webm, gif), frame rate, and scale. Defaults to MP4 at 30 fps.
audio Attach one soundtrack from your Asset Library or a public URL to an MP4 or WebM.
viewport_width / viewport_height The video size in CSS pixels. HTML recordings capture the whole viewport, so set these to the size you want.
device_scale Pixel density. 2 gives sharp, retina-quality text.
defer_render Wait to render until the recording is first requested.

Many image parameters work too, like css, google_fonts, block_consent_banners, proxy_id, and storage_destination_id. The parameters reference marks which ones work with recordings.

Recordings use the same monthly allowance as images. A recording’s cost depends on its requested duration_ms and duration_mode. Format, frame rate, and resolution don’t change it.

  • 2 credits for the first 5 seconds, plus 1 credit for each additional 5 seconds or part of 5 seconds.
  • target and at_least use twice as many, because the capture can run longer than duration_ms.
duration_ms at_most / fixed target / at_least
500–5,000 2 4
5,001–10,000 3 6
10,001–15,000 4 8
15,001–20,000 5 10
20,001–25,000 6 12
25,001–30,000 7 14
60,000 (target only) — 26
90,000 (target only) — 38

For example:

  • A 3-second GIF in fixed mode uses 2 credits.
  • A 10-second scroll in the default at_most mode uses 3 credits, even if the page reaches the bottom after 7 seconds.
  • A 12-second demo uses 4 credits in fixed mode, or 8 in at_least mode.
  • A 30-second target video uses 14 credits, however long the capture was.

Credits are used when the recording is created. Automatic retries don’t use more. A request that matches an existing recording through dedupe_duration_s uses 0 credits. The x-renders-consumed response header shows what each request used.

Every official client supports recordings, with typed requests for triggers, actions, and output:

Language Client Method
TypeScript / JavaScript @html-css-to-image/client createRecording
C# / .NET HtmlCssToImage CreateRecordingAsync
Python html-css-to-image create_recording
PHP html-css-to-image/client createRecording
Go github.com/htmlcsstoimage/go-client CreateRecording
Ruby htmlcsstoimage-api create_html_css_recording, create_url_recording

Manage existing recordings with the Recordings API, or ask an AI assistant connected to the MCP server to create them.

Need help?

Talk to a human. Email support@htmlcsstoimage.com and we’ll help you get started.