Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
FREEDOM251

Freedom251 › Blog › Browsershot

How to Capture Screenshots of Multiple URLs in Laravel

By Freedom251 Team · · 6 min read

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

Keep the URLs in an array or query result, then call Spatie Laravel Screenshot’s documented one-URL capture method once for each URL. Give every output a unique filename. For a large list, move the captures to queued work instead of holding a web request open; the package documents queued generation, but not a dedicated batch-capture method.

Capture a list of URLs with a loop

The package’s documented API starts with a URL and saves an image, as in Screenshot::url('https://example.com')->save('screenshot.png'). Applying that operation to multiple URLs is an application-level loop:

As an Amazon Associate I earn from qualifying purchases.

<?php

use SpatieLaravelScreenshotScreenshot;

$urls = [
    'https://example.com',
    'https://example.org/about',
];

foreach ($urls as $index => $url) {
    // Use an application-controlled index for a safe, unique filename.
    $path = storage_path("app/screenshots/page-{$index}.png");

    Screenshot::url($url)->save($path);
}

This example assumes the destination directory exists and is writable. Create it during application setup or ensure it exists before the loop. If the URLs come from a database, retrieve the records first and use a stable record ID or another unique application-controlled value in each filename. Avoid using a raw URL as a path: URL characters can create unsafe or invalid filenames, and two URLs can otherwise collide after filename conversion.

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

The capture call shown in the Spatie Laravel Screenshot introduction accepts one URL. The loop is a straightforward way to apply it to a collection; the reviewed documentation does not describe a dedicated multi-URL batch method.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Install the package and check requirements

Use the package installation instructions for the release you intend to install, and confirm that your application’s PHP and Laravel versions meet that release’s requirements. The current requirements page states PHP 8.4+ and Laravel 12+; requirements can differ by package release, so check the requirements for your selected version before adding it.

Follow the official installation and setup guide for the driver you choose. The two documented choices have different deployment needs.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Choose where the browser runs

Driver What your Laravel deployment needs Choose it when
Browsershot Node.js and a Chrome or Chromium binary, in addition to the package’s PHP and Laravel requirements. You want browser rendering on infrastructure you control and can install and maintain those dependencies.
Cloudflare A Cloudflare account, an API token with Browser Rendering permission, and the account ID configured in the environment. The Laravel host does not need Node.js or a Chrome binary for this driver. You prefer a hosted rendering request and your application can reach the external service.

These are deployment and dependency differences, not a performance ranking: the reviewed documentation does not provide a comparative speed, reliability, or cost benchmark. See the driver setup instructions for configuration details.

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

Move larger capture jobs to a queue

Capturing pages takes time, so a long list can keep a web request open while each page renders. For work that need not finish inside the request, dispatch a Laravel job and use the package’s documented saveQueued() flow, which supports a completion callback. Consult the queued screenshot generation guide for the exact API and callback behavior for your installed version.

Rank #3
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Keep the input URLs and output paths associated with each job so failures can be traced to a specific page. Set worker capacity and concurrency based on measurements in your own deployment; the documentation reviewed here does not establish a throughput benchmark or universal concurrency recommendation.

Set capture dimensions and wait behavior deliberately

The Laravel Screenshot introduction documents defaults of a 1280 × 800 viewport, device scale factor 2, PNG output, and waiting for network idle. You can customize viewport and output. Choose dimensions and format according to how the images will be displayed or stored rather than assuming the defaults suit every page.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

For the Browsershot driver, the underlying API supports full-page output and waiting for network idle, JavaScript, or a selector. A page that fills content asynchronously may need a different readiness condition from a mostly static page. Prefer waiting for a meaningful selector when you know which element indicates that the needed content is present. A fixed delay can waste time on fast pages and still be too short on slow ones; it is not a universal remedy. See Browsershot’s image creation options.

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

Common problems and fixes

  • Missing Node.js or Chrome/Chromium: This affects the local Browsershot driver. Install and configure the required runtime and browser binary, or choose the Cloudflare driver if you prefer hosted rendering and can supply its account credentials.
  • Capture fails in a restricted container: Spatie notes that environments such as Docker may need Browsershot’s no-sandbox configuration. Check the Browsershot customization guide and your container’s security constraints before changing browser flags.
  • The image is blank or misses late content: Revisit the wait condition. Try waiting for a selector that appears with the content, or use the appropriate documented network-idle or JavaScript wait option for the page. Confirm the page is reachable from the rendering environment.
  • Files overwrite one another: Make output paths unique per URL or source record. Use a controlled ID or index rather than a filename derived directly from an untrusted URL.
  • A queued capture cannot use a customization closure: The customization documentation says withBrowsershot() cannot be combined with saveQueued(), because the closure cannot be serialized. For queueable customization, use configuration supported by your installed package version rather than placing a closure in queued work.
  • A request takes too long with many URLs: Move the work out of the request and into queued jobs. Measure job duration and worker behavior with your real target pages; the package documentation does not specify a guaranteed capture rate.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you do not want to provision a browser runtime or configure a rendering driver, ScreenshotNeo offers a screenshot API and MCP server. One GET request can return an image or PDF; this cURL example saves a WebP screenshot of one URL. For its complete parameters and response details, see the ScreenshotNeo API documentation.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

For a list, make one request per URL and give each response a unique output filename. Python:

import requests

urls = ["https://example.com", "https://example.org/about"]
for index, url in enumerate(urls):
    response = requests.get(
        "https://api.screenshotneo.com/v1/shot",
        params={"access_key": "YOUR_API_KEY", "url": url},
        timeout=90,
    )
    response.raise_for_status()
    with open(f"shot-{index}.webp", "wb") as image:
        image.write(response.content)

Node.js:

const urls = ['https://example.com', 'https://example.org/about'];

for (const [index, url] of urls.entries()) {
  const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url });
  const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
  if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
  const data = new Uint8Array(await res.arrayBuffer());
  await import('node:fs/promises').then(fs => fs.writeFile(`shot-${index}.webp`, data));
}

ScreenshotNeo removes known consent banners, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots. Sign up for 1,000 free screenshots a month with no card.

Frequently Asked Questions

Does Spatie Laravel Screenshot include a bulk method for a URL array?

The reviewed official documentation shows per-URL capture and queued capture, but does not document a dedicated batch method.

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

Can I combine withBrowsershot() with saveQueued()?

No. The customization guide says the closure cannot be serialized for queued work; consult your installed version’s supported configuration for queueable customization.

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.

BrowsershotLaravelPHPSpatie Laravel Screenshotwebsite screenshots

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.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver 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.