PHPackages                             urlbox/screenshots - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. urlbox/screenshots

ActiveLibrary[Image &amp; Media](/categories/media)

urlbox/screenshots
==================

Use urlbox to easily generate website thumbnail screenshots from a URL

3.0.1(2y ago)14250.4k—6.8%5[1 PRs](https://github.com/urlbox/urlbox-php/pulls)MITPHPPHP ^7.4|^8.0CI failing

Since Mar 10Pushed 1y ago2 watchersCompare

[ Source](https://github.com/urlbox/urlbox-php)[ Packagist](https://packagist.org/packages/urlbox/screenshots)[ Docs](https://github.com/urlbox/urlbox-php)[ RSS](/packages/urlbox-screenshots/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (11)Used By (0)

Urlbox/Screenshots
==================

[](#urlboxscreenshots)

Capture highly accurate webpage screenshots of any site using Urlbox.io in PHP
------------------------------------------------------------------------------

[](#capture-highly-accurate-webpage-screenshots-of-any-site-using-urlboxio-in-php)

This package uses the [Urlbox.io](https://urlbox.io) screenshot as a service to generate website screenshots.

Installation
------------

[](#installation)

This package can be installed through Composer.

```
composer require urlbox/screenshots
```

### Laravel Setup

[](#laravel-setup)

When using Laravel, if you are using a version pre v5.5 you will need to include the Service Provider manually:

```
// app/config/app.php

'providers' => [
    // ...
    'Urlbox\Screenshots\UrlboxProvider'
];
```

Setup your API keys:

```
// config/services.php

'urlbox' => [
    'key'    => env('URLBOX_KEY'),
    'secret' => env('URLBOX_SECRET'),
    'webhook_secret' => env('URLBOX_WEBHOOK_SECRET'),
];
```

and in your .env file:

```
# URLBOX
URLBOX_KEY=YOUR_URLBOX_KEY
URLBOX_SECRET=YOUR_URLBOX_SECRET
URLBOX_WEBHOOK_SECRET=YOUR_URLBOX_WEBHOOK_SECRET
```

You can find your API Credentials and Webhook Secret [here](https://www.urlbox.io/dashboard/projects)

Usage
-----

[](#usage)

You will need a [Urlbox](https://urlbox.io) account to use this package. Please signup [here](https://urlbox.io/pricing) and get your API Key and Secret from the Urlbox dashboard once you have logged in.

Here is a sample call to generate a Urlbox screenshot URL:

```
    use Urlbox\Screenshots\Urlbox;
    $urlbox = Urlbox::fromCredentials( 'API_KEY', 'API_SECRET' );

    $options = [
        // only required option is a url:
        'url' => 'example.com',

        // specify any other options to augment the screenshot...
        'width' => 1280,
        'height' => 1024,
    ];

    // Create the Urlbox URL
    $urlboxUrl = $urlbox->generateSignedUrl( $options );
    // $urlboxUrl is now 'https://api.urlbox.io/v1/API_KEY/TOKEN/png?url=example.com'

    // Generate a screenshot by loading the Urlbox URL in an img tag:
    echo ''
```

If you're using Laravel and have set up the service provider, you can use the Facade provided:

```
use Urlbox\Screenshots\Facades\Urlbox;

$options = [ 'url' => 'example.com' ];
$urlboxUrl = Urlbox::generateUrl( $options );
// $urlboxUrl is now 'https://api.urlbox.io/v1/API_KEY/TOKEN/png?url=example.com'
```

You can now use the result (`$urlboxUrl`) by placing it inside an `` tag as the `src` parameter.

When you load the image, a screenshot of example.com will be returned.

Options
-------

[](#options)

You can find the full list of available options within the [docs](https://urlbox.io/docs/options). Below is a list of the most commonly used options:

OptionDefaultDescription`url`-The URL of the website you want to screenshot **(Required)**`width`1280Viewport width of the browser in pixels`height`1024Viewport height of the browser in pixels`selector`-Take a screenshot of the element that matches this selector`thumb_width`-Width in pixels of the generated thumbnail, leave off for full-size screenshot`format`pngImage format of the resulting screenshot image (`png` or `jpg`)`user_agent`-User-Agent string used to emulate a particular client.`cookie`-Set a cookie value before taking a screenshot. E.g. OptIn=true. Can be set multiple times to set more than one cookie.`delay`-Amount of time to wait in milliseconds before urlbox takes the screenshot`wait_for`-Waits for the element specified by this selector to be visible on the page before taking a screenshot`timeout`30000Amount of time to wait in milliseconds for the website at url to respond`full_page`falseSpecify whether to capture the full-length of the website`flash`falseEnable the flash plugin for flash using websites`force`falseTake a fresh screenshot instead of getting a cached version`ttl`2592000 (30 days)Short for 'time to live'. Number of seconds to keep a screenshot in the cache. Note the default is also the maximum value for this option.`quality`80JPEG only - image quality of resulting screenshot (0-100)`disable_js`falseTurn off javascript on target url to prevent popups`retina`falseTake a 'retina' or high definition screenshot equivalent to setting a device pixel ratio of 2.0 or @2x. Please note that retina screenshots will be double the normal dimensions and will normally take slightly longer to process due to the much bigger image size.`click`-Element selector that is clicked before taking a screenshot e.g. #clickme would click the element with id="clickme"`hover`-Element selector that is hovered before taking a screenshot e.g. #hoverme would hover over the element with id="hoverme"`bg_color`-Hex code or css color string. Some websites don't set a body background colour, and will show up as transparent backgrounds with PNG or black when using JPG. Use this setting to set a background colour. If the website explicitly sets a transparent background on the html or body elements, this setting will be overridden.`crop_width`-Crop the width of the screenshot to this size in pixels`hide_selector`-Hides all elements that match the element selector by setting their style to `display:none !important;`. Useful for hiding popups.`highlight`-Word to highlight on the page before capturing a screenshot`highlightfg`whiteText color of the highlighted word`highlightbg`redBackground color of the highlighted word`use_s3`falseSave the screenshot directly to the S3 bucket configured on your account`webhook_url`-Urlbox will send a POST request back to the supplied URL with data about the screenshot in JSON format once it has completed rendering.---

Other implementations
---------------------

[](#other-implementations)

- [Node.js](https://github.com/urlbox-io/urlbox-screenshots-node)

Contributing
------------

[](#contributing)

We are open to pull requests.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

About Urlbox
------------

[](#about-urlbox)

Urlbox is a premium Screenshot as a Service API. It lets you render highly accurate screenshots of webpages and display them anywhere you like. [Urlbox.io](https://urlbox.io).

License
-------

[](#license)

The MIT License (MIT).

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 56.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~372 days

Recently: every ~319 days

Total

8

Last Release

748d ago

Major Versions

1.0.0 → 2.0.02017-03-10

2.1.0 → 3.0.02023-09-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2a58bf757f9491f22d9911c535efefda6841cee1288f5f4276f58536f393366?d=identicon)[urlbox](/maintainers/urlbox)

![](https://www.gravatar.com/avatar/8011e40151a091995dabef169fc3fb15c64ffdc60efd843ed749229adf5a9fa1?d=identicon)[ArnoldCubiciJones](/maintainers/ArnoldCubiciJones)

---

Top Contributors

[![mikeaag](https://avatars.githubusercontent.com/u/1278785?v=4)](https://github.com/mikeaag "mikeaag (18 commits)")[![cjroebuck](https://avatars.githubusercontent.com/u/12208?v=4)](https://github.com/cjroebuck "cjroebuck (10 commits)")[![urlbox-io](https://avatars.githubusercontent.com/u/14878758?v=4)](https://github.com/urlbox-io "urlbox-io (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![jborch](https://avatars.githubusercontent.com/u/5476285?v=4)](https://github.com/jborch "jborch (1 commits)")

---

Tags

browserheadlesslaravelphantomjsphppngpreviewrenderresponsivescreenshotscreenshot-libraryscreenshotssitethumbnailthumbnailswebpagewebpage-screenshotwebsite-previewwebsite-screenshotwebsite-thumbnailbrowserlaravelthumbnailconvertimageproviderwebsiteheadlesswebpagescreenshotfacadeThumbnailsresponsivepreviewcapturerenderphantomjsscreenshotsretinaurlbox

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/urlbox-screenshots/health.svg)

```
[![Health](https://phpackages.com/badges/urlbox-screenshots/health.svg)](https://phpackages.com/packages/urlbox-screenshots)
```

###  Alternatives

[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[folklore/image

Image manipulation library for Laravel 5 based on Imagine and inspired by Croppa for easy url based manipulation

270248.2k5](/packages/folklore-image)[lakshmaji/thumbnail

Thumbnails for videos

108122.2k](/packages/lakshmaji-thumbnail)[lakshmajim/thumbnail

Thumbnails for videos

1088.0k](/packages/lakshmajim-thumbnail)[h4cc/wkhtmltoimage-i386

Convert html to image using webkit (qtwebkit). Static linked linux binary for i386 systems.

33656.3k5](/packages/h4cc-wkhtmltoimage-i386)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
