To capture a website with Screenshotlayer from PHP, send a GET request to https://api.screenshotlayer.com/api/capture with your access_key and the complete target url, including https:// or http://. Check the response before saving it: successful responses contain image data, while invalid credentials, URLs, or exhausted usage can return errors.
This guide uses PHP cURL and shows how to add capture options, handle failures, and choose a plan. Screenshotlayer lists its prices in USD; its published materials do not establish INR billing, Indian tax treatment, or acceptance of any particular Indian-issued card.
What a Screenshotlayer PHP request needs
The capture endpoint is https://api.screenshotlayer.com/api/capture. Every request requires two query parameters:
access_key: your Screenshotlayer API key.url: the complete address of the page to capture, including its protocol, such ashttps://example.com.
Screenshotlayer also documents an HTTP endpoint, but says paid customers may use HTTPS. Use the HTTPS endpoint shown here to protect the request in transit. Keep the key on your server in an environment variable or other server-side configuration; do not put it in HTML or client-side JavaScript.
#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.
The example below is an implementation pattern based on the documented GET request. It has not been tested against a live API call; check the provider’s current documentation for parameter details before deploying.
Make a basic capture with PHP cURL
Save this as a PHP file on a server with PHP’s cURL extension enabled. Set the SCREENSHOTLAYER_ACCESS_KEY environment variable outside the web root, then run the file from your application or command line.
<?php
$accessKey = getenv('SCREENSHOTLAYER_ACCESS_KEY');
$targetUrl = 'https://example.com';
if ($accessKey === false || $accessKey === '') {
throw new RuntimeException('Set SCREENSHOTLAYER_ACCESS_KEY in the server environment.');
}
$query = http_build_query([
'access_key' => $accessKey,
'url' => $targetUrl,
]);
$endpoint = 'https://api.screenshotlayer.com/api/capture?' . $query;
$ch = curl_init($endpoint);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_TIMEOUT => 90,
]);
$body = curl_exec($ch);
if ($body === false) {
$message = curl_error($ch);
curl_close($ch);
throw new RuntimeException('Screenshotlayer request failed: ' . $message);
}
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE) ?: '';
curl_close($ch);
if ($status < 200 || $status >= 300 || strpos($contentType, 'image/') !== 0) {
// Do not save an API error response as an image.
throw new RuntimeException(
'Screenshotlayer returned HTTP ' . $status . ' (' . $contentType . '): ' . substr($body, 0, 1000)
);
}
if (file_put_contents(__DIR__ . '/capture.png', $body) === false) {
throw new RuntimeException('Could not write capture.png. Check the destination and permissions.');
}
echo "Saved capture.pngn";
http_build_query() encodes the key and target URL as query values. The code checks the HTTP status and content type before writing bytes, so an API error body is not silently mislabeled as a PNG. The endpoint documents PNG as the default format; if you request another format, choose a matching filename and validate the returned content type accordingly.
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.
Add capture options
Start with the required parameters, then add only the options the application needs. Screenshotlayer documents these options and defaults:
| Parameter | Purpose | Documented detail |
|---|---|---|
fullpage |
Capture the full page rather than only the viewport. | Use fullpage=1 for full-page capture. |
width |
Set the screenshot width, useful for a thumbnail-sized output. | Confirm accepted values in the current API documentation. |
viewport |
Set the browser viewport dimensions. | The documented default is 1440×900. |
format |
Select the output image format. | PNG is the default; the provider describes PNG, JPEG, and GIF as format choices. |
For example, update the query array in the PHP code to include 'fullpage' => 1 or 'format' => 'jpg'. Check Screenshotlayer’s current spelling and accepted values for format and dimensions before relying on them in production.
Handle API errors and common failures
Do not assume a successful transport means a successful capture. The specification documents error responses for missing or invalid access keys, usage limits, and invalid URLs. Check the response status and content type, log a safely redacted diagnostic, and avoid exposing the access key to users.
Rank #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.
| Symptom | Likely cause | What to check |
|---|---|---|
| Missing or invalid access-key error | The key was omitted, misspelled, or is not valid. | Confirm the environment variable is present in the PHP process and that the query includes access_key. Do not print the key in logs. |
| Invalid URL error | The target address is malformed or lacks a protocol. | Pass a complete URL such as https://example.com, then verify that the address is reachable and correctly encoded. |
| Usage-limit error | The account’s monthly allowance has been exhausted. | Check account usage and plan terms; the provider describes overage charges after quota exhaustion. |
| PHP cURL error or timeout | The PHP server could not complete the network request in time, or cURL is unavailable. | Check that the cURL extension is installed and enabled, outbound HTTPS is permitted, and the timeout suits the request. Distinguish a transport failure from a provider API error. |
| File is not a viewable image | An error object or other response was saved as image bytes, or the extension does not match the selected format. | Inspect HTTP status and content type before writing; use an extension consistent with the requested output. |
| Capture differs from the expected page | The target may depend on its own rendering or availability behavior. | Verify the target URL directly and review the provider’s current capture options for the needed viewport or full-page behavior. |
Choose a Screenshotlayer plan
Screenshotlayer’s pricing page, accessed 2026-10-03, lists the following USD prices and monthly snapshot allowances. Prices and included features can change, so verify the live plan page before purchase.
| Plan | Published price | Monthly snapshots | Listed details |
|---|---|---|---|
| Free | USD 0 per month | 100 | Non-commercial use. |
| Basic | USD 19.99 monthly or USD 215.99 yearly | 10,000 | Commercial use, Retina/2x and WebP support, and 10 dedicated workers. |
| Professional | USD 59.99 monthly or USD 629.99 yearly | 30,000 | 20 dedicated workers and FTP/S3 export options are listed. |
| Enterprise | USD 149.99 monthly or USD 1,529.99 yearly | 75,000 | 40 dedicated workers and FTP/S3 export options are listed. |
Compare plans against expected capture volume, whether the use is commercial, whether Retina/2x or WebP matters, how much concurrency dedicated workers provide for your workload, and whether FTP or S3 export is needed. Screenshotlayer says it notifies users at 75%, 90%, and 100% of the monthly allowance; its FAQ describes overage charges after the quota is exhausted. Confirm the current overage terms before configuring a production workload.
What Indian developers should verify
The published prices above are in USD. Screenshotlayer’s FAQ lists Visa, MasterCard, Discover, and Diners Club, but it does not establish whether a particular Indian-issued card will be accepted. The inspected provider information also does not establish INR billing, local tax treatment, or India-specific API behavior. Check the account checkout and ask Screenshotlayer about billing details relevant to your organization.
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
Or skip the browser setup
If you want a screenshot API with a single GET request, ScreenshotNeo is an alternative made by Yorker Media. Its clean-shot flow accepts cookie and consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify page verdict and billing status in headers. It also offers an MCP server for AI agents, with take_screenshot, get_page_info, and capture_pdf tools.
Here is the cURL request; replace the target URL with the page you need to capture and supply your API key:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
See the ScreenshotNeo documentation for request options. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo to start with the free monthly allowance.
Recommended Free Tools
Frequently Asked Questions
Can I use Screenshotlayer’s free plan for a commercial PHP application?
No. Screenshotlayer lists the free plan as non-commercial; its paid plans list commercial use.
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.
Does Screenshotlayer charge in Indian rupees?
The inspected pricing information is in USD and does not establish INR billing. Check the account checkout or contact the provider for current India-specific billing details.
How do I choose between a viewport screenshot and a full-page screenshot?
Use the viewport capture for a fixed-size view; set fullpage=1 when you need content beyond the initial viewport.
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.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →

