How to take full-page screenshots with an API
Capture entire webpages — including lazy-loaded images and sticky headers — reliably with a single API call.
The ScreenshotDude team · · 2 min read
A viewport screenshot shows what a visitor sees before scrolling. A full-page screenshot captures the entire document, top to bottom. It's what you want for archiving, design reviews, visual regression testing and documentation — and it's surprisingly easy to get wrong.
Why full-page captures are tricky
Modern pages don't render all at once:
- Lazy-loaded images only load when they scroll into view, so a naive capture shows grey placeholders.
- Infinite scroll keeps appending content, so the page has no stable height.
- Sticky headers and chat widgets get repeated or float over content.
- Animations triggered on scroll may be caught half-way.
The one-line version
With ScreenshotDude, a full-page capture is a single parameter:
curl -G "https://api.screenshotdude.com/v1/capture" \
--data-urlencode "url=https://example.com" \
-d full_page=true \
-H "x-api-key: $SCREENSHOTDUDE_API_KEY" -o full.pngHandling lazy-loaded content
Add full_page_scroll=true. The browser scrolls through the page before capturing so lazy images and scroll-triggered sections load. If a page needs more time, raise full_page_scroll_duration (milliseconds):
curl -G "https://api.screenshotdude.com/v1/capture" \
--data-urlencode "url=https://shop.example/catalog" \
-d full_page=true -d full_page_scroll=true -d full_page_scroll_duration=3000 \
-H "x-api-key: $SCREENSHOTDUDE_API_KEY" -o catalog.pngWaiting for the right moment
Single-page apps often render after the load event. You have three tools:
| Parameter | Use it when |
|---|---|
wait_until=networkidle0 |
The page fetches data after load and you want to wait until the network is quiet |
wait_for_selector=.product-grid |
You know which element signals "ready" |
delay=2 |
Something animates and you just need a pause (max 30 s) |
Cleaning up the result
Cookie banners and ads ruin full-page captures because they often appear more than once. Remove them:
-d remove_cookie_banners=true -d remove_ads=true \
--data-urlencode "remove_selectors=.chat-widget,#promo-bar"Very long pages: use PDF
For pages that are many screens long — terms of service, documentation, reports — format=pdf produces a paginated, searchable document that's easier to archive than a 20,000-pixel PNG.
Long renders and timeouts
Synchronous requests have a 60-second limit. If you capture heavy pages in bulk, switch to async with is_async=true and either poll /v1/jobs/{id} or receive a signed webhook. Polling is free, and you're only billed when the job succeeds.
Checklist
full_page=truefull_page_scroll=truefor lazy content- A wait strategy that matches the page
remove_cookie_banners=trueformat=pdffor very long documentsis_async=truefor bulk jobs
Read the full parameter list in the capture API reference.