Render

Render a scrolling website preview

Loads and settles a website, preloads lazy content, then records a top-to-bottom browser motion at 30 frames per second. per_page moves one viewport at a time and pauses for 750ms between steps. single_sweep makes one continuous eased pass. Sticky and fixed elements behave as they do in the browser.

The response is one multipart/form-data payload containing the first video frame as poster.jpg and the H.264 video as preview.mp4. Ironfang Render calculates the duration from the page height and selected motion, up to a 60 second hard limit. A preview counts its output seconds, rounded up, against render.site_preview_second: the 60 second limit is reserved before the recording starts and the real length is committed when the preview is delivered. Failed work counts nothing and cached repeats are free.

This endpoint is available on the product-partitioned Ironfang Render URL only. It has no unprefixed /v1/site-preview compatibility route.

post/v1/site-preview

Request

  • Base URL: https://api.ironfang.com/render
  • URL: https://api.ironfang.com/render/v1/site-preview
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Makes a synchronous render happen, and count, at most once. Any string up to 255 characters, remembered per account. The first request under a key is admitted and rendered as usual; a synchronous result is not kept, so the same request again under the key is a 409 idempotency_key_used and reserves nothing - send a new key to render again. A different request under a used key is a 409 idempotency_conflict. An identical request inside the cache window is still served from cache.

Request body

authorizationstring

Sets the Authorization header - the common case, spelled once. An explicit Authorization in headers wins over this.

block_adsboolean

Drop requests to known ad and tracker networks before they load. Stopped as network requests rather than hidden afterwards, so the page never spends time fetching them.

block_cookie_bannersboolean

Hide common consent banners, and undo the scroll lock they set - without which a full-page capture is one viewport tall.

Hidden, not accepted. Clicking "accept" would be a decision made on the site owner's behalf and recorded as theirs.

cssstring

Custom stylesheet, at most 65536 UTF-8 bytes. Applied after normal load/wait conditions and built-in hiding, before script, actions, settling and capture. Supports screenshots and PDFs, including @media print rules. Malformed stylesheet syntax is a 400 bad_request; Chromium determines supported properties and values.

device_scale_factornumber

Pixel density. 2 is retina: the same CSS size at twice the pixels.

headersobject

Extra HTTP headers sent with every request for the page.

hide_selectorsstring[]

CSS selectors to hide before capturing. Applied after load, so elements injected by script are covered.

no_cacheboolean

Force a fresh recording instead of using a cached result.

scriptstring

JavaScript statements executed inside the target page's main-frame context after load/wait conditions and css, before actions and capture. Runs as an async function body: use await or return a promise for asynchronous work. Completion is awaited; return values are discarded. At most 16384 UTF-8 bytes and 5000 ms execution, further bounded by the remaining timeout_ms budget. Syntax errors, execution failures and timeouts return 422 render_failed with a sanitized message. Supports screenshots and PDFs; no browser-session or Playwright/Puppeteer APIs are exposed.

timeout_msinteger

Per-render timeout. Clamped to the service maximum - it can lower the ceiling but not raise it.

user_agentstring

Overrides the user agent, including any set by device.

wait_for_selectorstring

Wait for this element before capturing. Fails the render if it never appears, rather than returning a half-drawn page.

wait_until'load' | 'domcontentloaded' | 'networkidle'

When the page counts as ready. networkidle waits for traffic to stop and is bounded by the render timeout, because a page with polling never truly idles.

dark_modeboolean

Record with prefers-color-scheme: dark.

delay_msinteger

Extra settle time after page load and before lazy-content preloading. Capped at ten seconds.

device'desktop' | 'tablet' | 'mobile'

Use a full device preset. Explicit width and height still win.

heightinteger

Output and browser viewport height in pixels. Width multiplied by height cannot exceed 1,200,000 pixels.

motion'per_page' | 'single_sweep'

per_page moves one viewport at a time with eased transitions and a 750ms reading pause. single_sweep makes one continuous eased pass from top to bottom.

urlstring uri required

Public HTTP or HTTPS page to record.

widthinteger

Output and browser viewport width in pixels.

Example request

{
  "actions": [
    {
      "selector": "#show-more",
      "type": "click"
    },
    {
      "selector": "#details",
      "type": "wait_for_selector"
    }
  ],
  "css": ".chat-widget { display: none !important; }",
  "script": "document.querySelector('#pricing')?.click();"
}

Response

The poster image and scrolling MP4 returned as two file parts.

Changes

No recorded changes to this operation across all 1 revision of this API.