To capture a page with Screenshotlayer from Node.js, send a GET request to its capture endpoint with your access key and the target URL, then save the image response as a file. Keep the key in an environment variable and configure Axios to treat a successful response as binary image data—not JSON. The example below uses the HTTPS endpoint; confirm that HTTPS is available on your plan and check Screenshotlayer’s current API documentation for parameter and response details.
Make a Screenshotlayer request with Axios
Install Axios if it is not already in your project:
npm install axios
Set your API key in the environment before running the script. For example, on macOS or Linux:
export SCREENSHOTLAYER_ACCESS_KEY="your_access_key"
Then save this as screenshot.js:
const axios = require('axios');
const fs = require('node:fs/promises');
async function capture() {
const accessKey = process.env.SCREENSHOTLAYER_ACCESS_KEY;
if (!accessKey) {
throw new Error('Set SCREENSHOTLAYER_ACCESS_KEY before running this script.');
}
const endpoint = 'https://api.screenshotlayer.com/api/capture';
try {
const response = await axios.get(endpoint, {
params: {
access_key: accessKey,
url: 'https://example.com',
format: 'PNG'
},
responseType: 'arraybuffer',
timeout: 60000
});
const contentType = response.headers['content-type'] || '';
if (!contentType.toLowerCase().startsWith('image/')) {
const body = Buffer.from(response.data).toString('utf8');
throw new Error(`Expected an image response; received ${contentType || 'unknown content type'}: ${body}`);
}
await fs.writeFile('screenshot.png', Buffer.from(response.data));
console.log('Saved screenshot.png');
} catch (error) {
if (error.response) {
const contentType = error.response.headers?.['content-type'] || '';
const body = Buffer.from(error.response.data).toString('utf8');
console.error('Screenshotlayer returned HTTP', error.response.status, contentType, body);
} else {
console.error('Request failed:', error.message);
}
process.exitCode = 1;
}
}
capture();
The code assumes a Node.js version with the built-in node:fs/promises module. It uses Axios’s arraybuffer response type so the image bytes can be written without text decoding. Axios error and response behavior can vary by Axios version; check the documentation for the version installed in your project and adjust error-body parsing if needed. Screenshotlayer’s official homepage and FAQ document the capture endpoint and image formats: Screenshotlayer and FAQ.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11#1 Best Overall
- 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.
What the request parameters do
The required inputs are the API access key and page URL. The homepage examples use access_key and url as query parameters. Axios’s params option encodes these into the GET request URL.
format: The FAQ identifies PNG as the default and says JPEG and GIF can also be requested. Set the desired output format using the currently documented parameter syntax before changing the output filename or downstream processing.viewport: The homepage shows viewport dimensions as a capture option. Use the current API documentation for its accepted format.fullpage: The homepage lists full-page capture as an option. Check its currently accepted values in the API documentation.width: The homepage example includes a width option for thumbnail sizing.- Other settings: The homepage lists custom headers, injected CSS, capture delay, caching, and export to AWS S3 or FTP. Exact parameter names and constraints should be confirmed in the live API documentation.
Screenshotlayer’s homepage examples show an HTTP endpoint, while its product page advertises HTTPS support for paid plans. The code uses HTTPS, but whether it works depends on the current plan and service terms. Review the current endpoint and plan details before relying on HTTPS.
Rank #2
- 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.
Keep the API key out of source control
Screenshotlayer authenticates requests with a personal access key. Load it from an environment variable or a secrets manager, rather than embedding it in a committed JavaScript file. The key is included in the query string for this API, so avoid logging complete request URLs and take care when sharing error logs. Screenshotlayer’s terms state that users are responsible for keeping credentials secret: terms.
Handle image responses and API errors
A successful call returns image content, not a JSON object containing an image by default. The sample requests binary response data, checks the returned content type, and writes the bytes to a PNG file. If you ask for JPEG or GIF, save with a matching extension and verify the content type and current API parameter for that format.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsRank #3
- 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.
HTTP errors are caught separately from failures that occur before a response arrives. When Screenshotlayer returns an error response, the example prints its status and response body. Do not assume every error body is JSON; it may be text or another format. The precise response envelope and error schema are not established here, so inspect the service’s current API documentation before building a parser around them.
Troubleshooting
- Missing-key error: Check that
SCREENSHOTLAYER_ACCESS_KEYis set in the same shell or process environment that starts Node.js. Do not paste the key into the source as a workaround. - Authentication failure: Confirm the key is current and belongs to the account you intend to use. Verify the spelling of
access_keyand avoid accidentally including whitespace in the environment variable. - HTTP endpoint or HTTPS failure: The homepage samples use HTTP, while HTTPS is advertised for paid plans. Confirm the endpoint scheme supported by your plan in the live documentation rather than silently downgrading a production integration.
- “Expected an image response”: The response may be an API error body, or the request may not have produced an image. Check the logged status, content type, body, URL, and key; consult the current API docs for the required parameters.
- Corrupt output: Make sure Axios is configured for binary data, and do not convert successful image bytes to a UTF-8 string. Use an extension consistent with the requested format.
- Timeout: The example sets a 60-second client timeout. A timeout means the client did not receive a response within that interval; it does not establish whether the service completed the capture. Choose a timeout appropriate to your application and handle retries carefully to avoid unintended repeat usage.
Plans, quotas, and usage costs
As advertised on Screenshotlayer’s pricing and signup pages on October 3, 2026, the plans list the following monthly allowances and prices. These are volatile service terms; check the current pages before selecting a plan. The official pricing page also advertises annual billing discounts.
Rank #4
- 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
| Plan | Monthly snapshots | Advertised price | Dedicated workers |
|---|---|---|---|
| Free | 100 | Free | Not stated on the cited pricing page |
| Basic | 10,000 | USD 19.99/month | 10 |
| Professional | 30,000 | USD 59.99/month | 20 |
| Enterprise | 75,000 | USD 149.99/month | 40 |
Sources: Screenshotlayer pricing and signup page, figures advertised October 3, 2026. The FAQ describes the free allowance as 100 monthly snapshots with limited features. The terms say usage depends on the subscription and unused monthly call amounts do not carry over; that terms page was last modified February 17, 2018, so confirm current account terms.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If you would rather make one request to a screenshot API than configure and maintain browser capture infrastructure, ScreenshotNeo returns an image or PDF from a GET request. Cookie and consent banners are accepted and removed along with 60+ known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. It also has an MCP server with screenshot, page-info, and PDF tools for AI agents.
Recommended Free Tools
For a PNG capture, install Axios and set SCREENSHOTNEO_API_KEY in your environment. See the ScreenshotNeo API documentation for current parameters and response details.
Best Value
- 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.
const axios = require('axios');
const fs = require('node:fs/promises');
async function capture() {
const response = await axios.get('https://api.screenshotneo.com/v1/shot', {
params: {
access_key: process.env.SCREENSHOTNEO_API_KEY,
url: 'https://example.com'
},
responseType: 'arraybuffer',
timeout: 90000
});
await fs.writeFile('screenshot.webp', Buffer.from(response.data));
}
capture().catch(console.error);
ScreenshotNeo includes 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo free.
Frequently Asked Questions
Does Screenshotlayer return JSON by default?
No. Its documented default output is a PNG image; the example treats a successful response as binary data.
Can I use Screenshotlayer for JPEG or GIF captures?
The official FAQ says JPEG and GIF are supported in addition to the default PNG; check current parameter syntax and save the result with the matching file extension.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Do unused Screenshotlayer monthly calls roll over?
The terms page, last modified February 17, 2018, says unused monthly call amounts do not carry over. Check your current account terms for any changes.
Quick Recap
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.

