Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To capture a long webpage as one image with Browserless, send a POST request to its /screenshot endpoint and set options.fullPage to true. Save the binary response directly to a file. If the page loads content as you scroll, also set scrollPage to true so Browserless can trigger lazy loading before capture.

Capture a full-page screenshot with the Browserless REST API

You need a Browserless API token and the endpoint for your account’s fleet and region. This example uses Browserless’s documented shared SFO endpoint. Keep the token private; use an environment variable or secret store in production rather than embedding a real token in code.

  1. Get an API token from your Browserless account dashboard.
  2. POST the target page URL and screenshot settings to https://production-sfo.browserless.io/screenshot?token=YOUR_API_TOKEN_HERE.
  3. Write the response body to a file. The endpoint returns image bytes, not JSON to parse.

Example request body:

{
  "url": "https://example.com/long-page",
  "scrollPage": true,
  "options": {
    "fullPage": true,
    "type": "png"
  }
}

Run it with cURL

Set BROWSERLESS_TOKEN in your shell environment, then run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -X POST "https://production-sfo.browserless.io/screenshot?token=$BROWSERLESS_TOKEN" 
  -H "Content-Type: application/json" 
  --data '{"url":"https://example.com/long-page","scrollPage":true,"options":{"fullPage":true,"type":"png"}}' 
  --output screenshot.png

Replace the example URL with the page you want to capture. The output file contains the image response.

#1 Best Overall

Choose settings for the page you need

Full-page capture and lazy-loaded content

Set options.fullPage explicitly: it defaults to false in the documented screenshot options. For pages that reveal images or other content only after scrolling, set the top-level scrollPage option to true as well. Browserless documents scrolling as the way to trigger lazy-loaded content; site-specific interactions can still mean some content does not load.

Viewport width and responsive layout

The screenshot reflects the width at which the page is rendered. Set the viewport intentionally when the output should match a device or breakpoint: a narrow viewport can switch the page to a mobile layout, changing line breaks and total page height. Browserless documents viewport configuration for this purpose: Screenshot REST API.

Output format and quality

The REST API documents PNG, JPEG, and WebP output. PNG is a straightforward lossless option. The quality setting does not apply to PNG; quality controls are relevant to compressed formats. Choose the format and any applicable quality setting based on whether you prioritize lossless detail or a smaller file. See the Screenshot REST API reference for available request options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Wait for images and page readiness

For image-heavy pages, consider waitForImages or another readiness condition supported by the endpoint. Navigation completing does not necessarily mean client-rendered content is ready. The screenshot API documents wait and navigation options; choose a condition appropriate to the page rather than assuming all scripts and media have finished.

Capture an element instead of the entire page

If you need only one part of a page, use a selector for a specific element or a clip rectangle for a fixed region. These options are alternatives to a full-page capture, not substitutes for fullPage: true when you need the entire rendered page.

Timeout expectations

The Browserless BQL screenshot reference documents a default screenshot timeout of 30 seconds. That is a reference default, not a promise that every long or script-heavy page will render within that time. Long pages, slow resources, and custom client-side behavior can require a different wait or timeout configuration. See the BQL screenshot reference.

When to use another Browserless route

The /screenshot REST endpoint is the direct route for one URL-to-image request and does not require a WebSocket browser connection. Use a connected Puppeteer, Playwright, or BAP session when you need to interact with the page or run custom logic before taking the screenshot. Smart Scrape can also return a full-page screenshot as a base64 PNG in its response and forces a browser strategy when screenshot output is requested.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not assume that every Browserless feature called “screenshot” captures the whole page. The Agent Run API documentation describes its screenshot result as a visible-viewport PNG encoded in base64, rather than a full-page image: Agent Run API.

Need a PDF instead of one long image?

Browserless’s /pdf endpoint uses Chrome’s print engine and produces selectable text; it does not create a single long-page PDF containing the entire webpage on one page. Browserless says custom full-page PDF generation is possible through /function. Choose PDF when print layout and selectable text matter, not when you need one tall screenshot image. See the PDF API documentation.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common capture problems

  • The result shows only the visible viewport: confirm that the request uses options.fullPage: true. The documented default is false.
  • Images or sections are missing: try scrollPage: true to trigger lazy loading, and use waitForImages or another readiness condition when appropriate. This is a supported approach, not a guarantee for every site’s custom behavior.
  • The layout does not match the intended device: set the viewport deliberately. Responsive breakpoints affect both layout and page height.
  • The saved file is invalid or contains text: treat the response as binary image data and write the response body directly to the file; do not parse it as JSON.
  • The request fails or times out: verify that the token and region-specific endpoint match your account, then consider the page’s loading time and the documented default timeout. A 30-second reference default is not a guarantee for every page.
  • The PDF is paginated rather than one continuous page: that is expected from /pdf; it is a print-engine PDF endpoint, not a one-page full-height screenshot endpoint.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server from Yorker Media. Its one-call API can return a screenshot or PDF; the API documentation is at ScreenshotNeo docs.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/long-page -o shot.webp

ScreenshotNeo removes cookie banners, popups, and chat widgets before capture; 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, and paid plans start at $5 for 3,000. Learn about ScreenshotNeo, then sign up free for 1,000 screenshots a month with no card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Does Browserless return a full-page screenshot as JSON?

No. The /screenshot endpoint returns image data; save its response body directly to a file.

Does scrolling guarantee every lazy-loaded element appears?

No. Browserless documents scrollPage as a way to trigger lazy-loaded content, but site-specific behavior may still require custom interaction or additional waiting.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.