To capture a website with Screenshotlayer from Laravel, send a server-side GET request to its capture endpoint with your secret access_key and a complete target URL, then handle the returned image or provider error. Keep the key out of browser code, configure a timeout, and test the request with Laravel’s HTTP fakes. Screenshotlayer’s published pricing is in USD; its free plan is marked non-commercial, so Indian developers should confirm current plan terms and billing details before using it for commercial work.
What you need before making a request
- A Screenshotlayer account and API access key.
- A Laravel application with the HTTP client available through
IlluminateSupportFacadesHttp. - A target website URL that includes
https://orhttp://.
Screenshotlayer documents http://api.screenshotlayer.com/api/capture as its capture endpoint and requires both access_key and url. Its documentation says HTTPS is available on paid plans; check your current plan’s entitlement before sending credentials over an API connection. Do not assume the free plan supports HTTPS. See the Screenshotlayer API specification.
As an Amazon Associate I earn from qualifying purchases.
Store the access key on the server
The key is a credential. Screenshotlayer’s terms place responsibility for keeping it secret on the user. Put it in an environment-backed Laravel configuration value, not a Blade template, browser JavaScript bundle, public repository, or logged request URL. See Screenshotlayer’s terms.
For example, add a service entry in config/services.php:
#1 Best Overall
'screenshotlayer' => [
'key' => env('SCREENSHOTLAYER_KEY'),
],
Then place the key in the server’s environment configuration:
SCREENSHOTLAYER_KEY=your_actual_key
After changing configuration in a deployment that caches config, refresh the configuration cache using your normal deployment process. Avoid committing a real key to version control.
Make a screenshot request with Laravel’s HTTP client
Pass query parameters as an array to get(); Laravel handles query-string encoding. This example requests a full-page PNG and imposes a 20-second timeout:
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →<?php
use IlluminateSupportFacadesHttp;
$targetUrl = 'https://example.com';
$response = Http::timeout(20)->get(
'https://api.screenshotlayer.com/api/capture',
[
'access_key' => config('services.screenshotlayer.key'),
'url' => $targetUrl,
'fullpage' => 1,
'format' => 'png',
]
);
if ($response->failed()) {
// Handle the provider or HTTP failure in your application.
}
$contentType = $response->header('Content-Type');
$imageBytes = $response->body();
Laravel’s HTTP client documents query arrays, timeouts, response inspection and retry controls in its 13.x HTTP client documentation. Confirm the response content type and provider’s current output options before treating a response body as an image. Screenshotlayer lists PNG as the default and documents JPEG and GIF; its homepage also mentions WebP in paid tiers, so availability depends on current documentation and plan entitlements.
Return or store the image safely
For an endpoint in your own application, return image bytes with an appropriate content type only after confirming the request succeeded and the provider returned an image. If you save the result, choose a server-controlled filename and storage location rather than trusting a filename supplied by a caller. Do not echo provider error content directly to end users.
Handle provider errors and transport failures
A successful network connection does not guarantee a successful screenshot. Screenshotlayer documents missing or invalid keys, usage-limit exhaustion and invalid target URLs. Laravel can also report failed HTTP responses or throw a connection/timeout exception. Treat provider response content as external input and log only safe diagnostics; never log the access key.
Rank #3
- Invalid or missing key: verify the environment value, Laravel configuration and account key. Correct configuration rather than retrying.
- Invalid URL: validate that the target is a complete URL with a protocol and is acceptable to your application before requesting capture.
- Usage limit reached: check account usage and plan quota; retries will not resolve an exhausted allowance.
- Timeout or connection failure: decide whether to return a temporary application error or retry a request that is safe to repeat. Do not retry indefinitely.
- Unexpected response format: inspect the HTTP status and content type before saving or serving the response as an image.
Use a try/catch around the request if your application needs to convert connection exceptions into a controlled response. Keep the timeout finite and select it according to your own request budget and the latency you can tolerate; the 20 seconds above is an example, not a provider guarantee.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchTest without calling the live API
Laravel’s HTTP client supports fakes and sent-request assertions. This lets routine tests verify URL construction and failure handling without depending on a Screenshotlayer account or making provider requests.
use IlluminateSupportFacadesHttp;
use IlluminateHttpClientRequest;
Http::fake([
'api.screenshotlayer.com/*' => Http::response('fake-image-bytes', 200, [
'Content-Type' => 'image/png',
]),
]);
// Call the application service or route that makes the screenshot request.
Http::assertSent(function (Request $request) {
return $request->url() === 'https://api.screenshotlayer.com/api/capture'
&& $request['url'] === 'https://example.com'
&& $request['format'] === 'png'
&& isset($request['access_key']);
});
Add separate tests for a normal image response, a provider error response and a simulated timeout or connection failure. Assert that application behavior is appropriate in each case, and avoid asserting or printing the actual secret value.
Rank #4
Check plan fit and India-specific billing before launch
Screenshotlayer’s pricing page lists the following monthly offers in USD as accessed in 2026. These are provider plan terms, not a market-wide price comparison; confirm the live page before buying because quotas, features and overage terms can change.
| Plan | Listed price | Monthly snapshots | Commercial use |
|---|---|---|---|
| Free | Free | 100 | Marked non-commercial |
| Basic | USD 19.99/month | 10,000 | Paid plans include commercial use |
| Professional | USD 59.99/month | 30,000 | Paid plans include commercial use |
| Enterprise | USD 149.99/month | 75,000 | Paid plans include commercial use |
Plan choice should account for commercial-use permission, monthly quota, HTTPS availability, output and export requirements, dedicated-worker options and possible overage fees—not just the headline monthly price. The provider’s FAQ lists Visa, MasterCard, Discover and Diners Club. The available provider information does not establish India-specific INR pricing, taxes, card acceptance, GST treatment or other local billing details. Confirm those points with the provider and your payment issuer before relying on a quoted USD amount. See Screenshotlayer pricing and its FAQ.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. Its one-request example in cURL is:
Best Value
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 documentation for request options. Cookie banners, popups and chat widgets are removed before the shot; bot checks, blank pages and failed loads are never billed. An MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan.
Frequently Asked Questions
Can Laravel call Screenshotlayer directly from a browser?
Keep the access key in server-side configuration and make the request from Laravel; exposing the key in browser code would disclose the credential.
Does Screenshotlayer’s free plan allow commercial use?
The provider’s pricing page marks its free plan as non-commercial. Confirm the current terms before using it for a commercial application.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Does the listed USD price confirm what an Indian customer will pay?
No. The listed prices are in USD, and the available provider information does not establish INR billing, taxes, GST treatment or India-specific payment acceptance.
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.




