ScreenshotNeo

BlogHow-to

How to Capture a Full-Page Screenshot with GrabzIt

Capture a webpage from top to bottom with GrabzIt. Learn the three full-page settings, how to handle dynamic content, and how to save the result.

By the ScreenshotNeo team4 October 20269 min read

To capture a full webpage with GrabzIt, set the browser height and the output width and height to -1. For a remote URL, the key settings are bheight, width, and height; the Node.js SDK calls the first option browserHeight. A full-page capture is also called a scrolling screenshot. [GrabzIt’s overview](https://grabz.it/screenshot-website-api/) documents these values for a full-length image.

1. Choose how you are capturing the page

There are two common cases:

  • Capture a public URL: send the URL to GrabzIt from a server-side SDK or the REST API. This is the usual choice for scheduled captures, monitoring, or backend workflows.
  • Capture the page open in a visitor’s browser: use GrabzIt’s JavaScript ConvertPage method. This sends the current page content for conversion; it is different from asking a remote browser to visit a URL. [GrabzIt’s ConvertPage guide](https://grabz.it/support/article/javascript-screenshot/) describes this path.

The examples below use a public URL for cURL, Python, and Node.js, then show the browser-side JavaScript route separately. GrabzIt’s REST setup guide says a direct HTTP request does not require an SDK. [REST setup](https://grabz.it/support/article/set-up-your-demo/)

2. Capture a remote URL with GrabzIt

Obtain an application key and secret from GrabzIt, and keep credentials on the server when using a server-side integration. Replace the placeholders below. The REST example writes the returned image bytes to a file; the SDK example uses the official Node.js package.

cURL

curl --get "https://api.grabz.it/convert" \
  --data-urlencode "key=YOUR_APPLICATION_KEY" \
  --data-urlencode "format=png" \
  --data-urlencode "bheight=-1" \
  --data-urlencode "width=-1" \
  --data-urlencode "height=-1" \
  --data-urlencode "url=https://example.com" \
  --output full-page.png

Python

This uses the same REST endpoint. Install the HTTP client with python -m pip install requests.

import requests

params = {
    "key": "YOUR_APPLICATION_KEY",
    "format": "png",
    "bheight": -1,
    "width": -1,
    "height": -1,
    "url": "https://example.com",
}

response = requests.get(
    "https://api.grabz.it/convert",
    params=params,
    timeout=120,
)
response.raise_for_status()

with open("full-page.png", "wb") as image_file:
    image_file.write(response.content)

For production use, also confirm that the response is an image before storing it. A service error response may not be a valid PNG even when the HTTP request itself completed.

Node.js SDK

Install GrabzIt’s package in your project using its current package installation instructions. The documented SDK pattern is url_to_image followed by save_to. [GrabzIt Node.js documentation](https://grabz.it/api/nodejs/technical-documentation/)

const grabzit = require("grabzit");

const client = new grabzit(
  process.env.GRABZIT_APPLICATION_KEY,
  process.env.GRABZIT_APPLICATION_SECRET
);

const options = {
  browserHeight: -1,
  width: -1,
  height: -1,
};

client.url_to_image("https://example.com", options);
client.save_to("full-page.png", (error, id) => {
  if (error) {
    console.error("GrabzIt capture failed:", error);
    process.exitCode = 1;
    return;
  }
  console.log("Screenshot saved; capture ID:", id);
});

Set GRABZIT_APPLICATION_KEY and GRABZIT_APPLICATION_SECRET in the environment before running the script. Do not commit real credentials to source control.

What the three values mean

Option Value Effect
Browser height -1 Requests a browser tall enough for the full page.
Output width -1 Lets the output width follow the page rather than forcing a fixed width.
Output height -1 Requests the full page height instead of a viewport-height image.

For REST and JavaScript these are commonly written as bheight, width, and height. In the Node.js SDK, use browserHeight for browser height. The setting names differ by interface, but the full-page values are the same. [Full-page API examples](https://grabz.it/screenshot-website-api/)

3. Capture the page currently open in the browser

Use ConvertPage when the page to capture is the one already loaded in your site visitor’s browser—for example, a user-generated preview or a filled-in form. Include GrabzIt’s JavaScript library, substitute your application key, and authorize the website’s domain in your GrabzIt account. The documented example derives the browser width from document.documentElement.clientWidth and sets browser height and output dimensions to -1. [JavaScript screenshot guide](https://grabz.it/support/article/javascript-screenshot/)

<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@3.5.5/grabzit.min.js"></script>
<button id="capture" type="button">Capture this page</button>
<div id="capture-result"></div>
<script>
  document.getElementById("capture").addEventListener("click", function () {
    GrabzIt("YOUR_APPLICATION_KEY").ConvertPage({
      "bwidth": document.documentElement.clientWidth,
      "bheight": -1,
      "width": -1,
      "height": -1,
      "format": "png"
    }).AddTo("capture-result");
  });
</script>

This client-side method is not a way to make a private page publicly accessible to GrabzIt. The JavaScript guide notes that external resources such as stylesheets and images need to be publicly available to the conversion service. Avoid putting an application secret in browser code; use the browser library only as documented and protect the account by authorizing the domain.

4. Wait for delayed or interactive content

A full-page dimension setting does not guarantee that content which appears later has loaded. Pages that populate sections after JavaScript runs, load images as the visitor scrolls, or require a menu interaction may need additional capture controls.

  • Wait for an element: use the documented waitForElement option with a CSS selector for content that must become visible before capture.
  • Scroll to an element: scrollElement can move the capture browser to a target selector. This can help trigger scroll-dependent content.
  • Run page JavaScript: jsCode can execute custom JavaScript before capture when the page needs a specific action.
  • Add a delay after interaction: a click or scroll can trigger an animation or asynchronous request; allow time for its result to render before the screenshot.

These options are described in GrabzIt’s [Node.js technical documentation](https://grabz.it/api/nodejs/technical-documentation/) and [PHP capture controls](https://grabz.it/api/php/technical-documentation/). Selector names and option availability can depend on the API or SDK version. Check the matching language documentation before adding them. Validate the result against the actual target page: no wait setting guarantees that every lazy-loaded, authenticated, or interactive site will render identically.

5. Select an output format and save the capture

The examples request PNG. For the REST API, GrabzIt’s documented request pattern includes a format parameter; its overview also demonstrates JPEG. Pick an extension matching the requested format, and check the response before treating it as a successful image. [REST example](https://grabz.it/support/article/set-up-your-demo/) · [API overview](https://grabz.it/screenshot-website-api/)

  • PNG: useful when you want a lossless image or need transparency where supported.
  • JPEG: useful when a smaller photographic image is more important than lossless edges.
  • WebP: listed among the screenshot formats in GrabzIt’s overview; verify support and exact format spelling in the API documentation for your chosen interface.

For a very tall page, inspect the actual pixel dimensions and file size before passing the image to another service. Full-page captures can be much larger than viewport screenshots.

6. Troubleshoot common problems

Symptom Likely cause What to check
Only the top viewport appears One or more full-page values are missing, misspelled, or set to a fixed size. For a remote image, set browser height, width, and height to -1. In the Node.js SDK, use browserHeight; in REST use bheight.
The browser-side request is rejected The site domain is not authorized for the JavaScript application key. Authorize the domain in GrabzIt and confirm the key is the one associated with that account. [Setup guide](https://grabz.it/support/article/javascript-screenshot/)
Images, CSS, or fonts are missing in ConvertPage The remote conversion process cannot fetch private or locally served resources. Make required assets reachable through public URLs, and inspect browser console/network errors. The current page’s local session does not automatically grant the conversion service access to every resource.
Late sections are blank The capture started before asynchronous content appeared or before scrolling triggered lazy loading. Wait for a visible selector, scroll to relevant content, or run page JavaScript; then add a delay if an animation or request needs time. Verify on the specific page.
The saved file is corrupt or not an image The API returned an error payload, or the extension does not match the requested format. Check the HTTP status and response content type, inspect the service response, and ensure format and filename extension agree.
The full-page image is too large or capture takes too long The page is unusually tall, assets are heavy, or a high-definition setting multiplies output pixels. Use standard resolution unless extra detail is required, remove irrelevant page sections where the API supports it, and consider whether a PDF or selected-element capture fits the task better.
A private or login-only page cannot be reproduced A remote capture service may not have the visitor’s authenticated browser state. Use an authorized integration and supported credentials/cookies if available for your API plan, or capture the already-open page with the browser-side method while ensuring required assets can be fetched. Do not assume a public URL capture inherits your local login.

7. Performance, reliability, and cost considerations

Full-page captures need more rendering and image data than viewport captures. Tall pages and high-definition output can increase processing time, memory use, and file size; GrabzIt specifically notes that high-definition captures are slower and advises against unnecessarily large dimensions. [High-definition screenshot guidance](https://grabz.it/support/article/high-definition-screenshots/)

  • Keep output bounded where possible: use full length when the whole document matters; use a target element or fixed viewport for smaller tasks.
  • Wait for the right condition: a specific element is often a clearer readiness signal than an arbitrary long delay. Use a delay when the page’s animation or interaction requires it.
  • Handle failures explicitly: check SDK callbacks and HTTP status, set a finite client timeout, and avoid treating every response body as an image.
  • Protect credentials: keep application secrets server-side. For the browser JavaScript integration, authorize the domain as GrabzIt instructs.
  • Check current plan limits and pricing: the supplied GrabzIt documentation establishes the capture settings, but this guide does not assert current prices, quotas, or turnaround benchmarks.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server from Yorker Media. One GET request can return an image or PDF. Its capture flow accepts cookie and consent banners like a visitor, then removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents.

For a full-page capture, add full_page=true to the request:

cURL

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

Python

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={
        "access_key": "YOUR_API_KEY",
        "url": "https://example.com",
        "full_page": "true",
    },
    timeout=90,
)
r.raise_for_status()
with open("shot.webp", "wb") as f:
    f.write(r.content)

Node.js

const q = new URLSearchParams({
  access_key: process.env.SCREENSHOTNEO_API_KEY,
  url: 'https://example.com',
  full_page: 'true',
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`ScreenshotNeo returned ${res.status}`);
await import('node:fs/promises').then(({ writeFile }) =>
  writeFile('shot.webp', Buffer.from(await res.arrayBuffer()))
);

See the ScreenshotNeo API documentation for parameters and response details. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed; an MCP server lets AI agents take screenshots; and 1,000 screenshots a month are free with no card, with paid plans starting at $5 for 3,000. Sign up for the free plan.

FAQ

Does -1 mean unlimited image dimensions?

It is GrabzIt’s documented value for full-page browser height and output width and height. It requests dimensions that follow the page; it does not mean every page of any size can always be returned without service or plan limits.

Should I use ConvertURL or ConvertPage?

Use URL capture when GrabzIt should visit a public URL. Use ConvertPage when the content to capture is already open in the user’s browser.

Can I capture only part of a page?

Yes. GrabzIt documents target-element options for selecting a page element. Use that when the entire document is not needed, and check the relevant SDK documentation for its option syntax.

Can a full-page screenshot include lazy-loaded images?

It may require scrolling or waiting for content to load. Use the documented scroll, selector-wait, or JavaScript controls as appropriate, then inspect the output because page behavior differs.