Publishing

Capture a page screenshot

Renders one page of the site in a real browser and returns the image, so you can check layout, spacing, and responsive behaviour that source-level checks cannot see. path is site-relative and may include a query string, so dynamic routes are captured with real values rather than placeholders. Focus the capture with selector (plus optional padding for surrounding context) or a clip rectangle in CSS pixels from the top-left of the page; the region is scrolled into view and captured within the configured viewport, so it must fit inside it, and these options exclude each other and fullPage. Fonts, images, and (for fullPage) lazy content are awaited before the capture, and CSS animations are fast-forwarded to their end state by default. Fails with 409 when the draft build is still in progress or has failed; poll websiteSourceCode.deployment.status and retry.

post/websitePreview/capture

Request

  • Base URL: https://api.cactal.ai/v1
  • URL: https://api.cactal.ai/v1/websitePreview/capture
  • Auth: HTTP bearer

Request body

websiteIdstring required
pathstring

Site-relative path to render, including any query string, e.g. /blog/my-post.

target'head' | 'published'

head renders the current draft; published renders the live site.

viewport'desktop' | 'tablet' | 'mobile'

Device class to render at.

colorScheme'dark' | 'light'

Browser color preference to emulate. Omit it to use the renderer default.

fullPageboolean

Capture the whole scrollable page instead of just the viewport. Excludes selector and clip.

selectorstring

Crop to the first element matching this CSS selector, scrolled into view. Preferred: it follows the layout at every viewport.

paddinginteger

CSS pixels of surrounding page to include on every side of the selector match.

waitForSelectorstring

Wait for this CSS selector to match before capturing.

delayMsinteger

Extra settle time before capturing, in milliseconds.

freezeAnimationsboolean

Fast-forward CSS animations and transitions to their end state so captures are deterministic.

Response

Rendered page image.

Changes

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