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

To take a screenshot with GrabzIt’s JavaScript API, load its JavaScript library, use an application key authorized for the domain running your code, choose a source method such as ConvertURL, then handle the asynchronous result with onfinish. The API can convert a URL, supplied HTML, or the current page; it can display the result in the page, keep it hidden, or return it as a data URL. This guide shows the core flow and the choices that matter when configuring and saving captures.

Before you write the capture code

You need a GrabzIt application key and a page hosted on a domain authorized for that key. GrabzIt’s setup instructions state that the JavaScript API will not work until the domain is configured. This also helps prevent another site from using your key and consuming account resources. Follow the current JavaScript API setup instructions for the current library include and domain-authorization steps; the documentation may change, and the material available here does not establish a library release version.

Keep any application secret or storage credentials out of browser code. Browser-side JavaScript is visible to visitors. Use the JavaScript API for the client-side capture flow, and put retrieval or storage operations that require secret credentials behind a protected server endpoint.

Choose what to capture

GrabzIt provides three source methods. Each accepts an optional options object for capture settings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Method Use it for
ConvertURL(url, options) A page identified by a URL.
ConvertHTML(html, options) HTML markup supplied by your application.
ConvertPage(options) The visitor’s current page.

Choose ConvertURL when the target is an independently addressable page, ConvertHTML when you need to render markup you already have, and ConvertPage when the page currently open in the browser is the source.

Load the library and start a capture

Use GrabzIt’s current official code sample for the library URL and initialization pattern. The following illustrates the documented conversion and completion flow; replace the key, target URL, and options with your values, and verify the current CDN include in the live documentation before deploying.

<script src="https://cdn.grabz.it/javascript/ grabzit.min.js"></script>
<script>
  const grabzIt = new GrabzIt("YOUR_APPLICATION_KEY");

  grabzIt.ConvertURL("https://example.com", {
    format: "png",
    bwidth: 1280,
    bheight: 800,
    onfinish: function (captureId) {
      console.log("Capture ready:", captureId);
    },
    onerror: function (error) {
      console.error("Capture failed:", error);
    }
  }).Create();
</script>

The CDN path above is illustrative rather than a verified current package URL; copy the exact script include and constructor syntax from GrabzIt’s JavaScript documentation before use. The documented API accepts optional JSON capture parameters, and onfinish receives the capture ID when the screenshot is ready. Error callbacks and supported settings are described in the live parameter and event reference.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Choose how the result is returned

The conversion method starts the capture; the result method controls what happens with the completed output.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Create() inserts the capture at the beginning of the document body, or at the document root if there is no body.
  • AddTo(elementOrId) puts the result in a particular page element. Supply the target element or its ID as documented.
  • CreateInvisible() creates the capture without displaying it on the page.
  • DataURI(callback, decrypt) passes a base64 data URL to a callback. The optional decrypt argument is for encrypted captures.

For example, if the page should show the screenshot in a known container, use the documented AddTo result method instead of inserting it at the start of the body. Use a data URL when subsequent client-side code needs the encoded result. Choose invisible creation when the capture is needed for processing rather than presentation. Check the current JavaScript API reference for exact method chaining and callback syntax.

Configure dimensions, timing, and output

Capture settings are optional, but choosing the right ones avoids confusing a browser viewport with the dimensions of the resulting image.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
  • Output format: The parameter reference lists formats including JPG, PNG, and PDF, along with other capture or export types. Select a format that suits whether the result is an image or document.
  • Browser dimensions: bwidth and bheight set the browser dimensions used to render the source. The reference lists a maximum of 10,000 pixels for browser dimensions; check the current reference and account package before relying on that limit.
  • Output dimensions: width and height describe output image dimensions, not the browser viewport. Output-size maxima can depend on the account package, so there is no single universal maximum to assume.
  • Timing: Use delay when a fixed wait is appropriate. The reference lists a maximum of 30,000 milliseconds. For pages that reveal content after a specific event, waitfor can wait for a matching visible element; its documented maximum wait is 25 seconds.
  • Full-page capture: The reference documents a full-length option where supported. Confirm that it applies to your chosen output type and package.

For exact parameter names, defaults, combinations, and account-dependent limits, use the live GrabzIt JavaScript parameter reference. The available documentation does not establish one set of defaults or output-size limits that applies to every format and package.

Handle completion and retrieve the capture

Captures complete asynchronously. The event reference describes onstart, onfinish, and error handling. Use onfinish to learn that the result is ready; its capture ID can then be passed to server-side code that retrieves the result.

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

A typical persistence flow is:

  1. Start the conversion from the browser.
  2. In onfinish, send the capture ID to an application endpoint you control.
  3. On the server, validate the request and the capture ID, then use a server-side GrabzIt API such as PHP GetResult to retrieve the capture bytes.
  4. Write the bytes to a location your application controls and return an appropriate status to the client.

The support example demonstrates the capture-ID-to-server-retrieval pattern, but it is not a complete security design. Protect your endpoint against unauthorized requests, validate its inputs, and do not place the application secret in client-side code. If using storage export, GrabzIt’s support guidance recommends its Secure Export URL option so browser code does not expose storage credentials.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Troubleshoot common failures

  • The API does not work on the page: Confirm that the page’s domain is authorized for the application key and that the library is loaded from the current documented URL.
  • The callback never reports a ready capture: Check the browser console and network requests, verify the URL or HTML source, and add the documented error callback. Review the event and parameter reference for the current error behavior.
  • The screenshot misses late-loading content: A fixed delay may be too short or waste time. Use a suitable waitfor selector when a visible element indicates that the needed content has loaded; ensure that the selector exists and becomes visible.
  • The image has unexpected dimensions: Check whether you set browser dimensions (bwidth/bheight) or output dimensions (width/height), and verify the selected format’s limits for your package.
  • The result is not saved on your server: A capture ID is not itself the image file. Have a protected server endpoint retrieve the result through a server-side API and write the returned bytes.
  • Credentials are exposed: Remove storage secrets from browser JavaScript. Use a server-side retrieval or GrabzIt’s Secure Export URL option as applicable.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server for developers. A GET request can return a PNG, JPEG, WebP, or PDF. Its capture flow accepts cookie banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; each step can be disabled. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and other MCP clients.

One cURL request looks like this (see the ScreenshotNeo API documentation for the current options and response details):

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

For JavaScript, use the Node.js example below. It writes the response body to the process output; save it to a file or handle it in your application as needed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Python equivalent:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo free to try it without a card.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Frequently Asked Questions

Can I use GrabzIt to capture HTML that is not hosted at a public URL?

Yes. Use ConvertHTML to submit markup directly instead of capturing a URL.

Does onfinish return the screenshot image itself?

It supplies a capture ID. Use a documented result method or retrieve the capture through server-side code.

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.

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