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 DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk8 min

How to Use ScreenshotOne with PHP and Laravel

A practical PHP and Laravel integration guide to ScreenshotOne: install its SDK, request screenshots, store results, protect credentials, and pace queued work.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use ScreenshotOne’s official PHP SDK to request a screenshot, then wire it into Laravel with environment-backed configuration and your own application code. The SDK can build a request URL or retrieve image bytes directly. The sources document the PHP SDK, not a first-party Laravel package or service provider, so the Laravel examples below are implementation patterns rather than vendor-prescribed scaffolding.

Choose the PHP SDK or Laravel’s HTTP client

The official SDK is the most direct PHP route: Composer installs it, its Client and TakeOptions classes represent the request, and take() returns the rendered bytes. Laravel’s HTTP client is another reasonable route if you want to use Laravel’s existing request and response abstractions; that means representing ScreenshotOne’s API options and response handling yourself.

As an Amazon Associate I earn from qualifying purchases.

For either approach, keep credentials in environment-backed configuration, use HTTPS, and treat a screenshot request as an external network operation that can fail or take time. ScreenshotOne accepts GET and POST requests. Its API key may be sent in a query parameter, JSON body, or X-Access-Key header. Use JSON POST for large HTML or Markdown input rather than putting it in a URL; the documented maximum POST body is 100 MiB. See ScreenshotOne’s Getting Started guide.

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

Install the PHP SDK

Install the package with Composer:

composer require screenshotone/sdk:^1.0

The package metadata for version 1.0.10, published July 30, 2026, declares PHP >=7.4 and Guzzle ^7.15.2 || ^8.0.1. Check the metadata for the exact version Composer resolves and your application’s PHP and dependency constraints before installing. Package metadata on Packagist.

The SDK’s basic usage imports ScreenshotOneSdkClient and ScreenshotOneSdkTakeOptions, creates a client with access and secret keys, and supplies the target URL and options. The secret key has a distinct purpose from the access key: it is used for signing public links or verifying signed webhook payloads, not as a request parameter. ScreenshotOne’s API-key guide.

Configure credentials in Laravel

Store keys in the environment, not in committed source code. For example, add these entries to .env locally and to your deployment’s secret configuration:

SCREENSHOTONE_ACCESS_KEY=your_access_key
SCREENSHOTONE_SECRET_KEY=your_secret_key

Expose them through a Laravel config file, such as config/services.php:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
'screenshotone' => [
'access_key' => env('SCREENSHOTONE_ACCESS_KEY'),
'secret_key' => env('SCREENSHOTONE_SECRET_KEY'),
],

After changing environment-backed configuration in a deployment that caches configuration, rebuild the cache using your normal Laravel deployment process. Never pass the secret key in a request parameter. Avoid exposing an access-key-bearing request URL to browsers, logs, or public pages; if you need a public URL, use the vendor’s signing mechanism rather than publishing credentials. Always call the API over HTTPS, as ScreenshotOne advises in its Getting Started documentation.

Take a screenshot with the SDK

This standalone PHP example follows the SDK’s documented flow. Substitute real credentials and a page you are authorized to capture:

<?php

require __DIR__ . '/vendor/autoload.php';

use ScreenshotOneSdkClient;
use ScreenshotOneSdkTakeOptions;

$client = new Client('YOUR_ACCESS_KEY', 'YOUR_SECRET_KEY');

$options = TakeOptions::url('https://example.com')
->fullPage(true)
->delay(2)
->geolocationLatitude(37.7749)
->geolocationLongitude(-122.4194)
->geolocationAccuracy(100);

// Retrieve the rendered image bytes.
$image = $client->take($options);
file_put_contents(__DIR__ . '/screenshot.png', $image);

// Or ask the SDK to build a request URL.
$requestUrl = $client->generateTakeUrl($options);

The full-page, delay, and geolocation settings mirror the PHP SDK guide’s example. The delay is in seconds; use it only when a page needs time to render after initial load. The generated URL is useful when your application needs a URL representation, but do not make a URL containing credentials public. For signed public links, follow the documented signing flow. PHP SDK example · API keys and signing.

Use the bytes returned by take() according to the selected output format. The vendor documents image formats including PNG, JPEG/JPG, WebP, GIF, JP2, TIFF, AVIF, and HEIF, plus PDF, HTML, and Markdown outputs. Choose an image format for image display or processing, PDF for a document workflow, and HTML or Markdown when rendered text is the desired result. Check current API terms for availability of a format in your account.

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

Wire the SDK into Laravel

The following is an application pattern, not an official ScreenshotOne Laravel package recipe. A small wrapper gives controllers and queued jobs one place to construct the SDK client and request options.

Create a service wrapper

For example, create app/Services/ScreenshotOneService.php:

<?php

namespace AppServices;

use ScreenshotOneSdkClient;
use ScreenshotOneSdkTakeOptions;

class ScreenshotOneService
{
private Client $client;

public function __construct()
{
$this->client = new Client(
config('services.screenshotone.access_key'),
config('services.screenshotone.secret_key')
);
}

public function capture(string $url): string
{
$options = TakeOptions::url($url)->fullPage(true);

return $this->client->take($options);
}
}

This wrapper returns bytes rather than writing files, so the caller can choose Laravel storage, a queue, or another destination. Validate or allowlist URLs if an end user can supply them; otherwise your app may be asked to fetch unintended destinations.

Call it from application code

A controller can inject the wrapper and store the returned bytes using Laravel’s storage facade. Choose a disk appropriate to your retention and access requirements:

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

namespace AppHttpControllers;

use AppServicesScreenshotOneService;
use IlluminateSupportFacadesStorage;

class ScreenshotController
{
public function store(ScreenshotOneService $screenshots)
{
$bytes = $screenshots->capture('https://example.com');

$path = 'screenshots/' . uniqid('shot-', true) . '.png';
Storage::disk('local')->put($path, $bytes);

return response()->json(['path' => $path]);
}
}

Use an extension consistent with the requested output format. This simple example uses a local disk; select and configure a different Laravel disk if the file needs to be shared across workers or served from object storage. Do not return a public URL unless the disk and access policy are deliberately configured for public access.

Use Laravel’s HTTP client instead

If you prefer not to add the SDK, Laravel’s HTTP client can make the generic API request. This example uses the access key header and requests PNG output, then checks the HTTP result before persisting the response body. The exact option set is represented as API parameters; consult the current ScreenshotOne options reference for available names and behavior.

use IlluminateSupportFacadesHttp;
use IlluminateSupportFacadesStorage;

$response = Http::timeout(90)
->withHeaders([
'X-Access-Key' => config('services.screenshotone.access_key'),
])
->get('https://api.screenshotone.com/take', [
'url' => 'https://example.com',
'full_page' => true,
'format' => 'png',
]);

if (! $response->successful()) {
throw new RuntimeException('ScreenshotOne request failed: ' . $response->status());
}

Storage::disk('local')->put('screenshots/example.png', $response->body());

Use the API endpoint and parameter names documented for your chosen integration; the PHP SDK’s endpoint construction avoids hand-building that request. HTTPS is required for protecting keys and other request data in transit. ScreenshotOne’s generic API documentation says errors include a human-readable message, error code, and HTTP status. Handle unsuccessful responses explicitly rather than saving an error payload as an image. Getting Started.

Persist results and control caching deliberately

There are two separate persistence decisions:

  • Laravel storage: saving returned bytes to a configured Laravel disk gives your application control over retention, access, naming, and deletion.
  • ScreenshotOne caching or storage: cache=true can avoid repeat renders, while configured storage options can upload rendered output to S3-compatible storage.

ScreenshotOne’s caching documentation states the default cache lifetime is four hours and can be configured up to one month; cached results do not consume rendering quota. Ordinary binary responses are not stored by ScreenshotOne by default unless caching, storage, or a similar feature is used. A JSON response can involve temporary storage to provide a content URL. Decide whether you need a durable application-owned copy, a repeat-render cache, vendor-side storage, or some combination. Caching documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Queue captures and pace request volume

For slow pages or larger workloads, move capture work out of a synchronous web request and into a Laravel queue job. This is an application design choice: ScreenshotOne does not automatically retry API requests, so define retry and backoff behavior in your worker and avoid retrying permanent errors indefinitely.

The usage endpoint reports total, available, and used request counts plus a concurrency object. The vendor clarifies that concurrency.remaining and concurrency.reset describe request starts left in the current minute bucket, not the number of renders actively running. A worker can consult usage information to pace starts rather than interpreting that bucket as active-render capacity. Get Usage · Bulk screenshots guide.

For repeated captures of the same page, caching can reduce duplicate work. For many distinct URLs, the vendor’s bulk screenshot guide may be a better fit than dispatching a large unpaced burst of individual requests. Apply bounded concurrency and backoff in your own queue design.

Common problems and fixes

  • Composer reports a PHP or Guzzle conflict: confirm the resolved SDK version’s declared PHP and Guzzle constraints in Packagist; align your runtime and dependency versions or choose a compatible release.
  • The request returns an authentication error: confirm the access key is correct and is sent through a supported method. Do not substitute the secret key for the access key or send the secret key as a parameter.
  • The saved file contains an error instead of an image: inspect the HTTP status and API error response before writing bytes. ScreenshotOne documents a human-readable message and error code for errors.
  • The capture is incomplete or too early: a fixed delay may help pages that finish rendering after initial load, but it is not a universal guarantee. Review the available wait-related options in the API reference and choose a condition that matches the page.
  • The same page is repeatedly rendered: consider enabling the documented cache option and set an appropriate lifetime; the default is four hours, configurable up to one month.
  • Queued jobs hit rate limits or create bursts: use the usage endpoint’s minute-bucket information to pace request starts. Remember it is not an active render count, and implement retries with backoff in your application.
  • A request stalls or times out: set a client timeout suitable for your application and account for it in queue job timeouts. Do not treat a timeout as proof that the vendor automatically retried the request.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. A GET request returns an image or PDF, so your PHP or Laravel app does not need to manage a browser instance:

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.
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 options and integration details. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo free.

Frequently Asked Questions

Does ScreenshotOne provide an official Laravel package?

The reviewed vendor materials document a PHP SDK and generic HTTP API, but not a Laravel-specific package or service-provider recipe. Laravel wiring is application code.

Can I use the ScreenshotOne secret key to authenticate a screenshot request?

No. Use the access key for API authentication. The secret key is for signing public links or verifying signed webhook payloads, not for a request parameter.

Does ScreenshotOne automatically retry failed API requests?

No. Retry and backoff behavior for queued work must be designed in your application.

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.

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.

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
Windows Errors? Fix Them Before They SpreadFree repair scan

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.