Guides / Full-page captures
Full-page and viewport captures
Most teams start with a fixed viewport. When you need marketing-grade “entire page” shots, ScreenNabster expands the document scroll height before rasterizing—without you stitching tiles manually.
Overview
Two dimensions matter: the viewport (what the browser window sees at once) and the capture region (what ends up in the file). By default we use a 1280×800 viewport and grab only that visible area. Enabling page_full: true switches the pipeline to measure the full scrollable document and capture it as one image (or PDF page stack).
You can combine viewport tweaks with full page mode—for example emulate a phone width but still capture the entire article length.
Viewport sizing
Use screen_width and screen_height for custom layouts. Toggle screen_landscape when you want width and height swapped without doing math client-side.
{
"url": "https://example.com",
"screen_width": 1440,
"screen_height": 900,
"page_full": false
}For retina-like density without changing CSS layout, set device_scale_factor (for example 2) alongside your viewport.
Full-page mode
Set page_full: true. The worker walks the DOM scroll height and produces one continuous bitmap for raster formats, which is ideal for landing pages and long dashboards. Very tall pages increase memory and time—pair with blocking options from the performance guide if you only need above-the-fold detail.
curl -X POST "https://screennabster.com/api/v1/capture" \
-H "X-API-Key: pk_live_…" \
-H "Content-Type: application/json" \
-d "{\"url\":\"https://example.com\",\"page_full\":true,\"output\":\"png\"}" \
--output full.pngDevice presets
Pass device with a Playwright device name (for example Pixel 7) to apply that profile's viewport and user agent. Legacy aliases iPad and Galaxy S21 remain supported. Unknown names return a validation error—check spelling exactly as in the Playwright catalog bundled with our worker.
{
"url": "https://example.com",
"device": "iPhone 14",
"page_full": true,
"output": "webp"
}When the page is ready
wait_until controls the navigation lifecycle gate: load (default), domcontentloaded, networkidle, or commit. Heavy SPAs often need networkidle plus a short wait millisecond delay, or a wait_for_selector targeting the hero element.
Use scroll_to when you must align a sticky header or lazy section before the final shot—especially on infinite-scroll sites where the top of the document is not representative.
Common pitfalls
- Fixed-position elements (cookie bars, chat widgets) may repeat down a full-page PNG. Combine
hide_selectorsor filters with full page mode. - Animations can blur text if you capture mid-transition—add
waitor inject CSS to pause motion. - PDF output interprets “full page” through the print engine; see the PDF guide for margin and background options.