Keyword: full page screenshot api

Full Page Screenshot API: How to Capture Long Web Pages Without Cropping or Bugs

If you need stable long-page screenshots for monitoring, SEO audits, regression testing, or user-generated reports, this guide shows exactly how to do it with ScreenshotAPI. You will get practical examples, reliability tips, and a complete reference for every available /screenshot parameter.

What is a Full Page Screenshot API?

A full page screenshot API captures an entire rendered document height, not just the visible viewport. Instead of scrolling manually in a browser and stitching images, you send one request to an endpoint and receive a finished image (or base64 / JSON response).

ScreenshotAPI is built for production use: caching, async jobs, request blocking, metadata extraction, and deterministic parameterized captures.

Why Long Screenshots Are Usually Cropped or Broken

  • Viewport-only capture when full_page is disabled.
  • Lazy-loaded sections not yet visible or loaded at capture time.
  • Sticky headers and cookie banners covering content.
  • Animations that shift layout between requests.
  • Racing dynamic data where the page is captured too early.
  • Inconsistent waits and missing deterministic selectors.

Quick Start: Capture a Long Screenshot

This request captures a full-page PNG and returns binary data:

curl "https://api.snapshotflow.com/screenshot?url=https://example.com&full_page=true&format=png" \
  -H "X-Api-Key: your-api-key" \
  --output full-page.png

Recommended reliable variant for dynamic pages:

curl "https://api.snapshotflow.com/screenshot?url=https://example.com&full_page=true&width=1440&wait_until=networkidle2&delay=1200&block_cookie_banners=true&block_ads=true" \
  -H "X-Api-Key: your-api-key" \
  --output full-page-stable.png

Best Practices for Bug-Free Full Page Screenshots

  1. Set full_page=true for long captures; otherwise only viewport height is returned.
  2. Use deterministic waits with wait_for_selector for key blocks.
  3. Add small delay (300-1500 ms) on animation-heavy pages.
  4. Block overlays with block_cookie_banners, hide_selectors, and click.
  5. Disable flakiness using reduced_motion=true and controlled viewport settings.
  6. Use caching for repeatable snapshots and lower cost on repeated requests.

All Available /screenshot Parameters

The table below maps directly to the backend query schema and defaults.

Source

ParameterDefaultDescription
url""Target URL to capture. Required unless html is passed.
html""Raw/base64 HTML source to render instead of URL navigation.

Viewport

ParameterDefaultDescription
width1280Viewport width in pixels (100-3840).
height800Viewport height in pixels (100-2160).
device_scale_factor1Device pixel ratio for sharper captures (0.5-3).
viewport_mobilefalseUse a mobile-like viewport behavior.

Capture

ParameterDefaultDescription
formatpngOutput format: png, jpeg, webp, pdf.
quality80JPEG/WebP quality (1-100).
full_pagefalseCapture full document height. Core flag for long screenshots.
omit_backgroundfalseAllows transparent background when format supports it.
selector""Capture a single DOM element by CSS selector.
clip_x0X coordinate for manual clipping.
clip_y0Y coordinate for manual clipping.
clip_width0Clip area width (0 = disabled).
clip_height0Clip area height (0 = disabled).

Timing

ParameterDefaultDescription
delay0Extra wait in milliseconds before capture (0-10000).
wait_untilnetworkidle2Navigation readiness: load, domcontentloaded, networkidle0, networkidle2.
wait_for_selector""Wait until a CSS selector appears before screenshot.

Emulation

ParameterDefaultDescription
dark_modefalseEmulate dark color scheme.
reduced_motionfalseReduce motion/animations for stable output.
media_typescreenEmulate CSS media: screen or print.
timezone""Override browser timezone.
geolocation_latitude0Latitude for location emulation.
geolocation_longitude0Longitude for location emulation.
geolocation_accuracy100Accuracy radius for geolocation.
user_agent""Override user-agent string.

Injection and Interaction

ParameterDefaultDescription
headers""Custom request headers (JSON string).
cookies""Cookie list to preload (JSON string).
scripts""JavaScript to inject before capture.
styles""CSS to inject before capture.
hide_selectors""Selectors to hide (for popups, chat widgets, banners).
click""CSS selector to click before capture.

Image Resize

ParameterDefaultDescription
image_width0Post-capture resize width (0 = keep original).
image_height0Post-capture resize height (0 = keep original).

PDF

ParameterDefaultDescription
pdf_print_backgroundfalsePrint CSS backgrounds for PDF output.
pdf_landscapefalseUse landscape orientation in PDF.
pdf_paper_formata4PDF page size: a4, a3, a2, a1, letter, legal, tabloid.

Blocking

ParameterDefaultDescription
block_adsfalseBlocks common ad resources and placements.
block_trackersfalseBlocks tracking scripts/resources.
block_cookie_bannersfalseAttempts to suppress cookie dialogs.
block_requests""Custom network blocking patterns.

Content and Metadata

ParameterDefaultDescription
extract_contentfalseReturn extracted page content together with response.
content_formatmarkdownExtracted content format: html, markdown, text.
metadatafalseInclude page metadata (title, og tags, status).

Cache and Response

ParameterDefaultDescription
cachetrueEnable cache reads/writes for deterministic requests.
response_typeimageResponse shape: image, json, base64, url.

Async

ParameterDefaultDescription
asyncfalseQueue a background job and return job_id.
webhook_url""Webhook endpoint for async completion notifications.

Production Checklist

  • Always pass API key in X-Api-Key.
  • Use full_page=true for long-page mode.
  • Tune wait_until, wait_for_selector, and delay per site profile.
  • Set response_type=json when your pipeline needs metadata/content payloads.
  • Use async mode for large volume jobs and monitor /jobs/:id.
  • Use consistent parameter sets to maximize cache hit ratio.

FAQ

How do I prevent full-page screenshots from cutting off bottom sections?

Set full_page=true and add a deterministic wait strategy. For dynamic pages, combine wait_for_selector and a short delay.

Can I capture authenticated states?

Yes, provide session cookies via cookies and any required headers via headers.

Is this API suitable for SEO monitoring snapshots?

Yes. Use deterministic viewport settings, reduced motion, and stable content waits to reduce screenshot variance.

Start Capturing Long Pages Reliably

If you need a full page screenshot API that works in production, ScreenshotAPI is ready to use.