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

To fetch a website screenshot with Browshot in Node.js, install its browshot package, create a client with your API key, and call client.simple() with the URL. The callback returns image bytes when the response code is 200, which you can save with Node’s file-system module. Use Browshot’s full create-and-poll workflow when you need control over screenshot size, instance selection, or processing status.

Install Browshot and prepare your API key

Browshot’s official Node.js examples use CommonJS. In your project directory, install the package:

npm i browshot

Set your Browshot API key in the environment as BROWSHOT_API_KEY. Keep the real key out of source code and version control; the examples below use the environment variable rather than a literal credential.

Fetch and save a screenshot with the simple API

For one URL and a straightforward image download, Browshot’s simple API is the shortest route. This complete CommonJS example requests a screenshot and writes the returned bytes to screenshot.png:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#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)
'use strict';
const Browshot = require('browshot');
const fs = require('fs');

const apiKey = process.env.BROWSHOT_API_KEY;
if (!apiKey) {
  throw new Error('Set BROWSHOT_API_KEY before running this script');
}

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');
  });
});
  1. Save the code as screenshot.js.
  2. Set BROWSHOT_API_KEY in the shell or environment where Node runs it.
  3. Run node screenshot.js. On a successful callback with code 200, the image data is written to the current directory.

The Browshot simple API documentation describes this approach as easier to use than the complete API, but slower. Browshot also warns that sample screenshots may consume credits, so use a URL and run count appropriate for your account.

Use the full API for status and retrieval control

Choose the full API if you need to select an instance, request a screen-sized or page-sized capture, or explicitly manage an in-progress job. Browshot documents this sequence: create a screenshot, inspect its status, poll while it is processing, then retrieve the image or a thumbnail.

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)
  1. Call screenshotCreate({ url, instance_id, size }) with the target URL and any required instance selection.
  2. If the response status is in_process, call screenshotInfo(id, {}) again after a suitable wait.
  3. Continue polling until the status is finished or error. Treat error as a terminal failure, not as a finished image.
  4. When finished, request the screenshot file or a thumbnail using the retrieval method in the Browshot API.

Do not assume that a create request has produced an immediately downloadable image. The official Node.js examples use CommonJS; adjust the import syntax if your project uses a different module format. Consult Browshot’s API documentation for the current method signatures and retrieval details.

Choose screenshot size and request options

  • url: Required target page for screenshot creation.
  • instance_id: Selects the Browshot instance used for the capture.
  • size: screen captures the visible screen and is the default; page requests the page-sized capture.
  • cache: Can reuse a screenshot of the same URL on the same instance within its cache interval.
  • delay and dimensions/thumbnails: Browshot documents these and other advanced options for cases that need additional time or a particular output size. Check the API reference for accepted values and behavior.

Handle redirects, processing responses, and failures

Browshot documents these response meanings for its simple endpoint:

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.
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.
Response Meaning and handling
200 Screenshot image data is returned; save the bytes.
404 Screenshot execution failed; do not write the result as a valid image.
400 The request is invalid; check the URL and request parameters.
302 Processing is underway; follow the redirect rather than treating it as a completed image response.

Browshot also says callers must follow 302 and 307 redirects because some pages can take up to two minutes to load. Make sure the HTTP client or calling flow follows these redirects and allows enough time for the capture. In the full API workflow, poll status and stop on either finished or error.

Troubleshoot common problems

  • The script reports an unsuccessful response: Print and inspect result.code. A 400 points to an invalid request, while a 404 means the screenshot execution failed. Confirm the URL and options, then retry if appropriate.
  • The request returns a redirect instead of image data: Follow 302 or 307; a page may take up to two minutes to load.
  • The full API remains in progress: Poll screenshotInfo(id, {}) while the status is in_process. Handle error as failure and retrieve the image only after finished.
  • The output file is missing: Check that the callback reached code 200, and handle the error passed to fs.writeFile. The example reports filesystem write errors separately from screenshot failures.
  • You need the underlying failure explanation: Browshot’s Node.js library example notes that its failure result does not expose the X-Error explanation. Check the available API response or documentation for the diagnostic route appropriate to your workflow.

Cost and usage considerations

Browshot’s API documentation states that the default free instance is limited to 100 screenshots per month; the documentation page does not state a year for that allowance. Its features page describes paid, credit-based instances. Check Browshot’s current pricing page for up-to-date instance availability and commercial terms before estimating recurring usage.

Rank #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)
  • 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.
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 screenshot API that accepts one GET request with a URL and returns an image or PDF. Its capture flow accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with response headers indicating the page verdict and billing status.

Example cURL request, using the documented endpoint and parameters:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. An MCP server also provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan.

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

Frequently Asked Questions

Does Browshot’s simple API return a screenshot file directly?

On a successful response with code 200, the Node.js callback provides image data that you can save as a file.

When should I use Browshot’s full API instead of simple()?

Use the full workflow when you need explicit instance or size selection, or need to manage processing status and retrieve the image after completion.

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
$399.99
Bestseller 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.
$179.98
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.