Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk5 min

How to Use Browshot with Node.js to Fetch Screenshots by URL

A practical Node.js guide to Browshot: install the package, capture and save a URL screenshot, handle status and redirects, and choose relevant options.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Install Browshot’s Node.js package, pass a target URL to its simple API, and write the returned image bytes to a file. For more control, use the full API to create a screenshot, poll its status, and retrieve the finished image. Browshot’s published examples use CommonJS; the examples below follow that format.

Install Browshot and set your API key

In your project directory, install Browshot from npm:

As an Amazon Associate I earn from qualifying purchases.

npm install browshot

Set your API key in the environment rather than putting a real credential in source code. For example, in a macOS or Linux shell:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
export BROWSHOT_API_KEY='YOUR_API_KEY'

Browshot’s Node.js examples use CommonJS. If your application uses another module format, adapt the import accordingly. The package documentation and examples are at Browshot’s Node.js documentation.

#1 Best Overall
Dell Optiplex 3060 Desktop Computer | Intel i5-8500 (3.2) | 32GB DDR4 RAM | 1TB SSD Solid State | Built in WiFi | Bluetooth | Windows 11 Professional | Home or Office PC (Renewed)
  • [INTEL POWERED CONTENT] - Built with a 8th Generation Hexa-Core Intel i5 and 32GB of DDR4 RAM; Modern, Windows 11 ready, with 4K support, Executive multitasking, media streaming and smooth, multi-tab web browsing; Perfect as an all-purpose multimedia computer; built for content creators; Plenty of RAM and Mass storage for photo and video editing powered by Intel HD 630
  • [LATEST WIRELESS TECH] - This Dell Desktop Computer easily connects to the internet through the Built In WiFi / Bluetooth
  • [SOLID STATE STORAGE] - This Dell Computer setup comes with an ultra-fast 1TB Solid State Drive (SSD); Setup as the primary boot device; Boot and load programs with lightning speed ; Additional expansion available
  • [BUY & OWN WITH CONFIDENCE] - From the world's largest Microsoft Authorized Refurbisher; Quality Guarantee and Free Tech Support; Award-winning Customer Service; | Support Sustainable Business
  • [MODERN HI-SPEED PORTS] - USB 3.0 (x4) | USB 2.0 (x4) | DisplayPort (x1) | HDMI Port (x1) | Audio Combo Jack (x1) | Audio Out (x1) | RJ-45 Ethernet (x1) | Internal SATA (x3)

Fetch and save a screenshot with the simple API

For a single URL and a straightforward download, Browshot’s simple method accepts the URL and returns a result through a callback. This complete example saves the image data as screenshot.png:

'use strict';
const Browshot = require('browshot');
const fs = require('fs');

const apiKey = process.env.BROWSHOT_API_KEY;
if (!apiKey) {
  throw new Error('Set the BROWSHOT_API_KEY environment variable first.');
}

const client = new Browshot(apiKey);
client.simple({ url: 'https://example.com/' }, (result) => {
  if (result.code !== 200) {
    console.error('Screenshot failed. Browshot response code:', result.code);
    return;
  }

  fs.writeFile('screenshot.png', result.data, (err) => {
    if (err) {
      console.error('Could not save screenshot:', err);
      return;
    }
    console.log('Saved screenshot.png');
  });
});

Replace the example URL with the page you want to capture. A result with code 200 contains image bytes in result.data; the example writes those bytes to disk. Browshot describes this simple flow as easier to use than its complete API, but slower. Its documentation also warns that sample screenshots may consume credits.

Rank #2
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
  • Model: Dell OptiPlex 7050 Small Form Factor (SFF)
  • Processor: Intel Core i7-7700 3.60 GHz
  • Memory: 32GB DDR4 Ram
  • Storage: 1TB Solid State Drive (SSD) Fast Boot + Storage
  • Operating System: Windows 11 Pro (64-bit)

Use the full API for status and retrieval control

The full workflow is useful when you need to select an instance or screenshot size, or when you want to explicitly handle a capture that is still processing. Create the screenshot, inspect its status, and retrieve the image only after completion. Browshot documents screenshot creation, status checks, and image or thumbnail retrieval in its API documentation.

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

This outline shows the sequence; use the exact method signatures and response fields in the version of Browshot’s package you install:

Rank #3
Sale
HP All-in-OneDesktop Computer, 16GB DDR5 RAM, Intel Quad-Cores, 128GB SSD, WiFi6, Keyboard & Mouse, Windows 11
  • IMMERSIVE 24 INCH DISPLAY: Experience stunning clarity on a Full HD IPS screen with ultra-thin bezels, offering a 90% screen-to-body ratio that makes everything from spreadsheets to streaming come alive with vibrant colors and crisp details.
  • POWERFUL INTEL PROCESSING: Tackle demanding tasks with ease thanks to the Intel processor and 16GB of high-speed memory, delivering smooth performance whether you're multitasking between applications or running productivity software.
  • GENEROUS STORAGE: Store all your important files, photos, and programs with blazing-fast solid state drive technology that ensures quick boot times, rapid file access, and plenty of space for your digital life.
  • ENHANCED PRIVACY AND COLLABORATION: Work confidently with the pop-up privacy camera that tucks away when not in use, plus dual microphones with noise reduction for crystal-clear video calls that keep you connected professionally.
  • ECO-CONSCIOUS DESIGN: Feel good about your purchase with an EPEAT Gold registered and ENERGY STAR certified computer that combines premium performance with responsible environmental manufacturing practices.
  1. Call screenshotCreate({ url, instance_id, size }) with the target URL and desired options.
  2. If the returned status is in_process, call screenshotInfo(id, {}) again after a delay. Continue checking until the status is finished or error.
  3. When finished, request the screenshot file or a thumbnail using the retrieval method documented for your chosen output.
  4. If the status becomes error, stop polling and handle the failed capture rather than assuming an image is available.

Do not assume that a create request means the screenshot is ready immediately. Browshot notes that pages can take up to two minutes to load, and its simple endpoint may respond with a redirect while processing continues.

Choose the screenshot options that fit

The required screenshot-creation input is url. Other useful options documented by Browshot include:

Rank #4
Sale
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
  • This Certified Refurbished product is tested and certified to look and work like new. The refurbishing process includes functionality testing, basic cleaning, inspection, and repackaging. The product ships with all relevant accessories, a minimum 90-day warranty, and may arrive in a generic box. Only select sellers who maintain a high-performance bar may offer Certified Refurbished products on Amazon.com.
  • Dell Optiplex 3050 SFF Desktop computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD
  • Includes: USB Keyboard & Mouse, USB WiFi adapter, Microsoft office 30 days free trail.
  • Port: Front: USB 3.0(2), USB 2.0(2); Rear: DP, HDMI, USB 3.0(2), USB 2.0(2), RJ-45.
  • Support 4K (3840x2160) Dual display, makes it easy to connect two monitors at the same time, and you can expand working Windows, mirror content, or expand a single window across multiple monitors.
Option What it controls
instance_id Selects the Browshot instance used for the capture.
size Chooses screen or page; screen is the default.
cache Allows reuse of a screenshot of the same URL on the same instance within the cache interval.
delay Adds a delay for pages that need time before capture; consult the API reference for the supported value and behavior.
Dimensions and thumbnail options Control the output dimensions or request a thumbnail; use the API reference for the available parameters.

Use screen when you want a viewport capture and page when you need a full-page capture. Set caching only when reuse of a recent capture is acceptable for your use case. Browshot’s API reference lists additional screenshot parameters.

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

Handle redirects, failures, and slow pages

Browshot’s simple endpoint uses HTTP response codes to describe the result. Its documentation describes 200 as image data, 404 as screenshot execution failure, 400 as an invalid request, and 302 as processing underway. It also says callers must follow 302 and 307 redirects; some pages can take up to two minutes to load. Ensure your HTTP handling follows those redirects rather than treating the redirect response as the finished image.

Best Value
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
  • Connectivity: Includes WiFi, Bluetooth, and LAN for wireless and wired connections
  • Memory: Features 16GB DDR4 RAM for smooth multitasking and performance
  • Storage: Combines 500GB SSD and 1TB HDD for ample storage space
  • Graphics: Integrated Intel UHD Graphics 630 for crisp visuals and video playback
  • Design: Sleek desktop tower with black color and slim profile for modern look

The Node.js library example notes that its failure result does not expose the X-Error explanation. If you need that detail to diagnose a failed capture, use an integration path that exposes the response headers or consult Browshot’s API documentation for the relevant endpoint behavior.

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

Troubleshoot common problems

  • Missing API key: If the client cannot authenticate, confirm BROWSHOT_API_KEY is set in the process environment and that the code reads the same variable name.
  • Code 400: Browshot documents this as an invalid request. Check that the URL is present and correctly formed, and verify option names and values against the API reference.
  • Code 404 or status error: Browshot identifies this as screenshot execution failure. Do not write the response as if it were an image; log the result and inspect endpoint-level diagnostics if available.
  • Code 302 or 307: This may indicate processing or a redirect to the result. Follow the redirect as required and account for slow page loads, which Browshot says can take up to two minutes.
  • Output file cannot be written: Check that the Node process has permission to write in the current directory and inspect the filesystem error reported by fs.writeFile.
  • Capture is not ready on the first status check: If the full API reports in_process, poll screenshotInfo until a terminal status instead of attempting retrieval immediately.

Plan for latency and usage costs

The simple API is convenient for a one-URL download, but Browshot says it is slower than the complete API. Use the full create/status/retrieve flow when your application needs explicit progress handling or instance and size control. For reliability, treat redirects and in-progress status as part of the normal workflow, and avoid unbounded polling: use a reasonable interval and stop when the job reaches finished or error.

Browshot’s API documentation states that its default free instance is limited to 100 screenshots per month; the documentation page does not state a year for that figure. Its features page describes paid, credit-based instances. Commercial terms and available instances can change, so check the current Browshot pricing page before estimating ongoing costs.

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

Or skip the browser setup

ScreenshotNeo offers a website screenshot API and MCP server. One GET request can return a screenshot or PDF; the API documentation is at ScreenshotNeo’s API docs.

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

Before the shot, cookie banners are accepted and removed, along with known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed. Its MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.

Quick Recap

Bestseller No. 2
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
Model: Dell OptiPlex 7050 Small Form Factor (SFF); Processor: Intel Core i7-7700 3.60 GHz; Memory: 32GB DDR4 Ram
$392.99
SaleBestseller No. 4
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
Includes: USB Keyboard & Mouse, USB WiFi adapter, Microsoft office 30 days free trail.; Port: Front: USB 3.0(2), USB 2.0(2); Rear: DP, HDMI, USB 3.0(2), USB 2.0(2), RJ-45.
$150.00
Bestseller No. 5
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
Connectivity: Includes WiFi, Bluetooth, and LAN for wireless and wired connections; Memory: Features 16GB DDR4 RAM for smooth multitasking and performance
$255.00

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.