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

To display a website screenshot in a PHP page, generate a signed Urlbox render link on your server with Urlbox’s Composer package, then use that link as an image’s src. For workflows that need to download or process the result, use Urlbox’s separate JSON endpoint, POST /v1/render/sync, with the project secret in a server-side Bearer-authenticated request. These are different request flows with different response shapes; keep the secret out of browser code in either case.

Use a signed render link for a screenshot in a PHP page

Urlbox accepts a webpage URL or HTML and can render screenshots and other outputs. Its PHP example uses the urlbox-php Composer package to create a signed URL, which the page can then load as an image. See the official PHP example and Urlbox documentation overview.

1. Install the Composer package

From your PHP project directory, install the package:

composer require urlbox/urlbox-php

The PHP example identifies the Composer package as urlbox-php, but the available documentation does not specify a PHP version requirement or compatibility matrix. Check the package’s current Composer metadata and your project’s PHP version before deployment; do not assume Laravel compatibility from the standalone example.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • 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.

2. Generate the signed URL on the server

The following follows the documented client pattern. Replace the example URL with the public page you want to capture. Read credentials from environment variables or another server-side secret store rather than committing them to source control.

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

use UrlboxScreenshotsUrlbox;

$apiKey = getenv('URLBOX_API_KEY');
$apiSecret = getenv('URLBOX_API_SECRET');

if (!$apiKey || !$apiSecret) {
    throw new RuntimeException('Urlbox credentials are not configured.');
}

$urlbox = Urlbox::fromCredentials($apiKey, $apiSecret);
$options = [
    'url' => 'https://example.com',
    'width' => 1280,
    'height' => 800,
];

$screenshotUrl = $urlbox->generateSignedUrl($options);
?>
<img src="<?= htmlspecialchars($screenshotUrl, ENT_QUOTES, 'UTF-8') ?>"
     alt="Screenshot of example.com">

Set URLBOX_API_KEY and URLBOX_API_SECRET in the PHP runtime environment. The PHP process generates the signature; only the resulting render URL is sent to the browser. Signed render links use HMAC-SHA256 over the query-string options, so changing signed options invalidates the token. For production links that may be public, follow Urlbox’s guidance on secure links in its quickstart and render-link documentation.

Choose capture options to match the page

The render-link approach is convenient when the result belongs directly in an HTML page. Urlbox documents these options for screenshot behavior:

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 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.
  • full_page: true captures the full page. The default stitch approach scrolls down to trigger lazy-loaded content and measure page height. skip_scroll: true can avoid that initial scrolling behavior and may reduce render time, but can affect content that loads only when scrolled into view.
  • Stitch mode scrolls and combines page sections to support more layouts. Native full-page capture is faster, but the documentation cautions that it is less reliable on some sites.
  • full_width can help capture pages with horizontal scrolling. Use selector to target a specific CSS element rather than the whole page.
  • For very tall or wide images, the screenshot guide lists maximum dimensions of 65,535 by 65,535 for JPEG and 16,383 by 16,383 for WebP. It recommends PNG for full-page captures without those size limits.

Check the current screenshot options documentation for option names and formats before building a production request.

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

Use the JSON POST API for server-side workflows

If PHP needs to receive render metadata, download the output, or pass it to another service, use the documented synchronous JSON endpoint instead of embedding a render link. The current API reference gives the base URL as https://api.urlbox.com and the endpoint as POST /v1/render/sync. It accepts JSON or form-encoded options and requires either a publicly accessible url or html. Authentication for this endpoint is the project secret in an Authorization: Bearer header.

Runnable PHP cURL example

This example sends JSON from PHP to the named synchronous endpoint, decodes the response, and prints the returned render URL. It does not expose the secret to the browser.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • 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.
<?php
$secret = getenv('URLBOX_API_SECRET');
if (!$secret) {
    throw new RuntimeException('URLBOX_API_SECRET is not configured.');
}

$payload = [
    'url' => 'https://example.com',
    'format' => 'png',
];

$ch = curl_init('https://api.urlbox.com/v1/render/sync');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . $secret,
        'Content-Type: application/json',
        'Accept: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode($payload, JSON_THROW_ON_ERROR),
]);

$responseBody = curl_exec($ch);
if ($responseBody === false) {
    $error = curl_error($ch);
    curl_close($ch);
    throw new RuntimeException('Urlbox request failed: ' . $error);
}
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status < 200 || $status >= 300) {
    throw new RuntimeException('Urlbox returned HTTP ' . $status . ': ' . $responseBody);
}

$response = json_decode($responseBody, true, 512, JSON_THROW_ON_ERROR);
if (empty($response['renderUrl'])) {
    throw new RuntimeException('Urlbox response did not include renderUrl.');
}

echo htmlspecialchars($response['renderUrl'], ENT_QUOTES, 'UTF-8');

The API response includes renderUrl and size information. The quickstart says that this URL expires after 30 days; download the result or configure storage if the application needs to retain it longer. Confirm response fields and available options against the live API reference and quickstart.

Do not mix endpoint authentication rules

The current reference for POST /v1/render/sync specifies Bearer authentication. A separate legacy Post API page describes a different /v1/render endpoint using HTTP Basic authentication with the secret as the username. Do not combine the legacy endpoint’s authentication instructions with the synchronous endpoint shown above. Name and follow the documentation for the exact endpoint used.

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

Choose between the two PHP integration patterns

Need Signed render link JSON POST endpoint
Typical use Put the screenshot directly in a page with an image element. Have the PHP application handle the API response for a server-side workflow.
Request pattern Composer client generates a URL signed with the project credentials. PHP sends JSON or form-encoded options to POST /v1/render/sync.
Authentication Generate the signed URL server-side; do not disclose the project secret. Send the project secret in the Bearer Authorization header from the server.
Output handling Use the generated URL as an image source. Parse the JSON response, which includes a temporary renderUrl and size information.
Retention consideration Use the render-link flow for the page display it documents. The returned URL expires after 30 days; download the output or configure storage when longer retention is needed.

India-specific setup, billing, and deployment notes

The Urlbox documentation cited here does not establish India-specific PHP or Laravel support, rupee pricing, GST treatment, or local payment options. For billing, use Urlbox’s live pricing page: it lists Lo-Fi at $19/month for up to 2,000 renders, Hi-Fi at $49/month for up to 5,000, Ultra at $99/month for up to 15,000, Business at a $495 monthly base plus $3 per 1,000 renders, and Enterprise from $3,000/month. The page says prices exclude VAT at the prevailing rate. These are listed plan prices, not India-specific quotes; confirm current terms with Urlbox and assess applicable Indian tax obligations for your situation.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • 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

Estimate volume from actual render requests and the capture modes your application needs. Full-page stitching may take longer than native capture because it scrolls and combines sections; native mode trades speed for reliability on some layouts. For retention, include the cost and implementation work of downloading output or using configured storage rather than assuming a temporary URL is permanent.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common PHP integration problems

  • The Composer class cannot be loaded: confirm the package is installed in the project that runs the PHP code, include vendor/autoload.php, and import UrlboxScreenshotsUrlbox with the correct namespace.
  • Credentials are empty or invalid: verify that both environment variables are available to the PHP process, not only to an interactive shell. Keep the secret server-side and confirm that the credentials belong to the intended Urlbox project.
  • The signed link stops working after an option change: regenerate it after changing query options. The signature depends on those options, so editing them after signing invalidates it.
  • The JSON request is unauthorized: for /v1/render/sync, send the secret as Authorization: Bearer .... Do not substitute the legacy /v1/render page’s Basic-auth pattern.
  • The API rejects the capture target: the synchronous API requires a publicly accessible URL or HTML. Check that the submitted payload includes one of those fields and that its JSON encoding is valid.
  • The image misses lazy-loaded content: use full-page stitching, which scrolls to trigger lazy elements; avoiding the scroll can be faster but may omit content that has not loaded.
  • A full-page capture fails on a complex layout: try stitch mode rather than native capture, or target a specific element with selector. For oversized output, consider PNG where JPEG or WebP dimension limits apply.
  • A previously returned render URL no longer works: the quickstart describes the JSON API’s renderUrl as expiring after 30 days. Download it earlier or configure storage for longer-term use.

Or skip the browser setup

For a one-call screenshot API alternative, ScreenshotNeo returns a screenshot or PDF from a GET request. It removes cookie/consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.

Install the PHP HTTP client if needed, then make the request from your server. Keep the API key private. See the ScreenshotNeo API documentation for request parameters and response behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<?php
$response = file_get_contents(
    'https://api.screenshotneo.com/v1/shot?access_key=' . rawurlencode(getenv('SCREENSHOTNEO_API_KEY')) .
    '&url=' . rawurlencode('https://example.com')
);
if ($response === false) {
    throw new RuntimeException('ScreenshotNeo request failed.');
}
file_put_contents(__DIR__ . '/shot.webp', $response);

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 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.

Frequently Asked Questions

Can I use the Urlbox PHP example in Laravel?

The cited PHP example documents a Composer client, but the available official documentation does not establish a Laravel compatibility matrix. Confirm package and framework compatibility for your application before deployment.

Does Urlbox provide India-specific pricing or GST details?

The cited pricing page lists prices in dollars and says prices exclude VAT at the prevailing rate; it does not establish rupee pricing or Indian GST treatment. Check the live pricing page and confirm tax treatment for your circumstances.

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.