How to Set a Screenshot API to Return a Full-Page Capture Instead of a Viewport
Set your screenshot API’s full-page option to capture the full scrollable page. Learn the Playwright setting, hosted API differences, lazy-load handling, and common fixes.
To capture the whole scrollable page instead of only the currently visible viewport, enable your screenshot tool’s full-page option. In Playwright, set fullPage: true. Hosted screenshot APIs use their own parameter names and limits, so check the documentation for the endpoint you call.
await page.screenshot({ path: 'page.png', fullPage: true });
Full-page capture is not the same as making the viewport taller. The full-page setting asks the browser or API to capture the page’s scrollable content; viewport dimensions control the visible browser area, and clipping selects a region. Those are separate controls. See the Playwright screenshot guide and screenshot option reference.
1. Set full-page capture in Playwright
Install Playwright and its Chromium browser, then navigate to the target URL and pass fullPage: true to page.screenshot(). The option defaults to false, so leaving it out produces a viewport capture.
npm init -y
npm install playwright
npx playwright install chromium
Save this as capture.mjs and run it with node capture.mjs https://example.com:
import { chromium } from 'playwright';
const url = process.argv[2];
if (!url) throw new Error('Usage: node capture.mjs https://example.com');
const browser = await chromium.launch({ headless: true });
try {
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
await page.goto(url, { waitUntil: 'networkidle', timeout: 30000 });
await page.screenshot({ path: 'page.png', fullPage: true });
} finally {
await browser.close();
}
networkidle can be useful for pages that load content after navigation, but some sites keep network requests open continuously. If navigation never reaches that state, use domcontentloaded or load, then wait for a specific element your capture needs:
await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30000 });
await page.locator('main article').waitFor({ state: 'visible', timeout: 10000 });
await page.screenshot({ path: 'page.png', fullPage: true });
In Playwright Python, the equivalent option is full_page=True. The same distinction applies: full-page capture requests the entire scrollable page; the viewport option sets the browser’s visible dimensions.
from playwright.sync_api import sync_playwright
import sys
url = sys.argv[1]
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
try:
page = browser.new_page(viewport={"width": 1440, "height": 900})
page.goto(url, wait_until="domcontentloaded", timeout=30000)
page.locator("main article").wait_for(state="visible", timeout=10000)
page.screenshot(path="page.png", full_page=True)
finally:
browser.close()
2. Find the full-page setting in a hosted screenshot API
For a hosted API, look in the endpoint’s screenshot options for a full-page field. The name is provider-specific: the reviewed Screenshot API reference uses full_page, while ScreenshotAPI documents fullPage. Cloudflare Browser Rendering accepts fullPage inside screenshotOptions in its screenshot endpoint.
Do not assume a field name works across providers. A request that silently ignores an unrecognized option may still return a valid image, just the viewport. Confirm the exact endpoint schema and response format before adapting examples.
| Tool or reference | Full-page setting | Important detail |
|---|---|---|
| Playwright JavaScript | fullPage: true |
Defaults to false. |
| Playwright Python | full_page=True |
Python uses snake case. |
| Screenshot API | full_page |
Its documentation lists a provider-specific maximum full-page height of 4320 pixels. |
| ScreenshotAPI | fullPage |
Its reference also documents a separate doScroll option for triggering lazy-loaded content. |
| Cloudflare Browser Rendering | screenshotOptions.fullPage |
The endpoint also documents navigation wait conditions, wait-for-selector, and timeout controls. |
Provider limits and parameter names are not universal. If the page is very tall, check for a maximum output height or image-size constraint in the specific API reference.
3. Handle lazy-loaded content and late rendering
A full-page setting does not guarantee that every image or section has loaded before capture. Pages often load content only after it approaches the viewport, or render it after an asynchronous request. If the bottom of the screenshot is empty or images are missing:
- Wait for the page’s main content to appear, using a selector when possible.
- Use a short delay only when the page has no reliable readiness selector.
- Check whether the API supports scrolling before capture. ScreenshotAPI documents
doScrollfor this purpose. - For a browser you control, scroll through the page in steps before taking the final full-page screenshot, allowing lazy-loaded elements to enter view.
- Check that the target page has finished rendering its lower sections and that no consent dialog or modal covers the content you need.
Cloudflare’s screenshot endpoint documents wait conditions, wait-for-selector, and timeout controls. Screenshot API documents a delay option. Treat these as provider-specific ways to wait for content, and choose the narrowest condition that reliably signals readiness.
4. Choose between full-page, viewport, and clipped capture
| Goal | Setting to use |
|---|---|
| Capture the full scrollable document | Enable the API’s full-page option. |
| Capture only what is visible at a particular browser size | Set viewport width and height and leave full-page capture off. |
| Capture a particular region | Use the API’s clipping or element capture option, if available. |
| Capture a full page that loads images as the reader scrolls | Enable full-page capture and use the provider’s scroll or lazy-load handling option if needed. |
Increasing viewport height alone can change responsive layout and still fail to capture the entire document. Clipping also limits the output to the selected region; it is not a replacement for full-page mode.
5. Troubleshoot common full-page capture problems
| Symptom | Likely cause | What to do |
|---|---|---|
| The result still shows only the first screen | The full-page field is missing, misspelled, or placed at the wrong level in the request. | Check the endpoint’s exact schema. Use the provider’s spelling and nesting, such as full_page, fullPage, or screenshotOptions.fullPage. |
| The page is cut off at a fixed height | The provider enforces an output-height limit. | Look up the API’s documented maximum. Screenshot API, for example, documents 4320 pixels; this is specific to that provider. |
| Images or sections below the fold are missing | Lazy loading or delayed rendering prevented the content from appearing before capture. | Wait for a selector, use a supported delay, or enable the API’s documented scroll-before-capture behavior. |
| The request times out | The page is slow, or a wait condition such as network idle never occurs. | Raise the timeout within the provider’s supported range, use a less restrictive navigation condition, and wait for the specific content you need. |
| The layout differs from the expected page | Viewport size, device scale, or responsive breakpoints changed the page layout. | Set the intended viewport dimensions and device scale separately from full-page mode. |
| The image is unexpectedly huge or fails to render | A very tall page can produce a large image that exceeds provider or downstream image limits. | Check documented limits, reduce output scale if supported, or capture separate sections when the consumer cannot handle one tall image. |
6. Performance, reliability, and cost considerations
A full-page image can be much taller and larger than a viewport image, so it takes more browser work to render and more bandwidth and storage to move. Set a practical viewport width, wait only for required content, and use a provider’s height or image-size limits to avoid oversized output. When the page is extremely long, capturing separate regions may be more reliable for downstream systems than a single image.
Reliability depends on the target site as well as the capture tool: scripts may fail, resources may load slowly, and bot checks may prevent access. Use explicit timeouts and readiness checks, and treat a successful HTTP response as distinct from a complete page capture. For hosted tools, review how the provider reports failed loads, limits, and billing so you can distinguish a valid screenshot from an error response.
DIY browser capture has no per-image API charge, but you operate the browser runtime and handle its compute, maintenance, retries, and storage. Hosted APIs trade that setup for a request-based service; compare their documented full-page behavior, height limits, wait controls, and price before choosing one.
7. Or skip the browser setup
ScreenshotNeo accepts a URL in one request and can return a full-page image with lazy images loaded. Its full-page option and other request fields are listed in the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -d full_page=true -o shot.webp
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com", "full_page": "true"},
timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://stripe.com',
full_page: 'true'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await Bun.write('shot.webp', res);
ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before the shot. Bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. See ScreenshotNeo and sign up for 1,000 free screenshots a month, with no card.
8. Frequently asked questions
Does full-page mode include content hidden behind tabs or collapsed menus?
Usually, a screenshot captures the page’s rendered state. Expand or activate content you need before capture; full-page mode does not inherently click controls or reveal hidden sections.
Can I use full-page capture for a PDF?
Some screenshot APIs support PDF output with separate page sizing and margin options. A full-page image setting and PDF pagination are different output controls; check whether the endpoint supports the format and layout you need.
Will a full-page capture match what a user sees while scrolling?
It captures the document as rendered by the browser at capture time. Sticky headers, animations, and content that changes during scrolling can appear differently from a sequence of viewport screenshots.
Is there a standard full-page parameter name across screenshot APIs?
No. Use the exact spelling and request structure in the documentation for the endpoint you call.


