How to Capture an Entire Webpage with GrabzIt
Capture a full-length webpage with GrabzIt by setting the browser and output dimensions to -1. Learn the URL and current-page workflows, credential safety, and alternatives.
A normal screenshot captures only the visible browser area. To capture an entire webpage with GrabzIt, set the browser height, output width, and output height to -1 in its URL-to-image workflow. For the page already open in a browser, GrabzIt’s JavaScript API uses ConvertPage with bheight, width, and height set to -1. These are documented special values for a full-length capture, not pixel dimensions.
Choose the capture workflow
Use URL-to-image when your application has a page URL to capture. Use ConvertPage when you need to capture the current page open in the visitor’s browser. The option names and syntax vary by interface, so use the names documented for the API or SDK you choose.
| What you have | Workflow | Full-page settings |
|---|---|---|
| A URL or HTML source | GrabzIt URL/HTML capture API or REST API | Browser height, output width, and output height: -1 |
| A page already open in a browser | JavaScript API ConvertPage |
bheight, width, and height: -1 |
GrabzIt describes this output as a full-page, scrolling, or full-length screenshot: the page or document is captured in one image. See its official screenshot API documentation for the relevant interface’s current options.
Capture a URL with GrabzIt’s Python API
This example follows the documented Python URL-to-image flow: configure the full-length dimensions, create the capture, then save it. Replace the placeholder application key and target URL with your own values.
from GrabzIt import GrabzItImageOptions
from GrabzIt import GrabzItClient
application_key = "YOUR_APPLICATION_KEY"
application_secret = "YOUR_APPLICATION_SECRET"
url = "https://example.com"
client = GrabzItClient.GrabzItClient(application_key, application_secret)
options = GrabzItImageOptions.GrabzItImageOptions()
options.browserHeight = -1
options.width = -1
options.height = -1
capture = client.URLToImage(url, options)
capture.SaveTo("full-page.png")
Install and configure the GrabzIt Python package as its documentation requires. Keep credentials on the server. The example’s important full-page settings are browserHeight, width, and height, each set to -1; do not substitute similarly named options from another SDK.
Capture the current browser page with JavaScript
For a page already open to a user, use the JavaScript API’s ConvertPage route and its own documented option names:
var grabzit = new GrabzIt("YOUR_APPLICATION_KEY");
var options = {
bheight: -1,
width: -1,
height: -1
};
grabzit.ConvertPage(options, function (id) {
if (id) {
grabzit.SaveTo("grabzit_result", "YOUR_DOMAIN");
}
});
Set the permitted domains in GrabzIt’s authorization settings for this client-side API. Current-page capture can also depend on external CSS, fonts, and images being publicly reachable by the capture process. Consult the JavaScript support documentation for the current integration details.
Why the dimensions are set to -1
For this full-length mode, -1 is a special setting that tells GrabzIt to use the full page extent. It is not a literal width or height of negative one pixel. Setting only the output height can leave the browser capture constrained; the documented examples set browser height and both output dimensions together. Exact option names depend on whether you are using the Python API, JavaScript API, REST interface, or another SDK.
Protect application credentials
- Do not call GrabzIt’s REST API directly from browser code with an application key. Its REST documentation warns that client-side REST use exposes the key.
- For a current-page browser capture, use the documented JavaScript API and authorize only the domains allowed to use the key.
- For URL capture initiated by your own application, keep the credential on the server and return the resulting image or a controlled reference to the browser.
- Use placeholders in examples and logs; never commit real keys or secrets to source control.
Or skip the browser setup
ScreenshotNeo captures a URL with one GET request and returns an image or PDF. Its cookie and consent handling accepts banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, and failed loads are never billed, and response headers report the page verdict and billing status. An MCP server provides screenshot tools for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots. See the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://example.com"},
timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com' });
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);
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
Troubleshooting
| Symptom | Likely cause | What to check |
|---|---|---|
| Only the initial viewport appears | One or more full-length dimensions were not set, or the wrong interface’s option names were used. | For Python URL capture, check browserHeight, width, and height. For JavaScript ConvertPage, check bheight, width, and height. |
| The saved image is missing styles or images | Referenced resources could not be fetched during current-page capture. | Make required CSS and image resources publicly available to the capture process and check their URLs. |
| The browser integration rejects or misuses a key | The key is unauthorized for the calling domain or REST was called from client code. | Use the JavaScript API for a client-side capture and authorize the domain; keep REST credentials server-side. |
| The output dimensions look wrong | -1 may have been replaced with a guessed pixel value, or only one dimension was changed. |
Use all three documented full-length values together and verify the option names against the chosen API’s documentation. |
| Python cannot save the capture | The capture setup or save destination does not match the installed SDK interface. | Confirm the SDK is installed and configured, then follow its documented URLToImage and SaveTo method signatures. |
Performance, reliability, and cost considerations
A full-page image contains more content than a viewport capture, so it can take more time and produce a larger file, especially for long pages or pages with many images. Use full-page mode only when the whole document is needed. Check the resulting dimensions and file size before storing or distributing captures at scale.
Capture reliability depends on the page being reachable and its resources loading. Dynamic pages may change while the capture is being prepared; current-page captures may omit external resources that are not publicly accessible. For production workflows, handle API errors, use bounded timeouts, and avoid treating a failed or partial capture as a valid image. GrabzIt’s trial and commercial terms can change; check its current pricing page before planning usage costs.
FAQ
Does -1 mean the screenshot is one pixel wide or tall?
No. It is GrabzIt’s documented special value for full-length dimensions in these examples.
Can I use the Python option names in JavaScript?
No. The documented JavaScript ConvertPage example uses bheight; the Python example uses browserHeight. Follow the selected interface’s syntax.
Can current-page capture include images hosted on a private network?
The documented JavaScript workflow notes that referenced resources need to be publicly available to load. Private resources may therefore be absent.
Is a full-page screenshot the same as a PDF?
No. This guide covers a full-length image capture. A PDF is a different output format with separate layout and pagination behavior.


