How to take website screenshots with PHP
The article examines how you can take screenshots of any URL with PHP by using Selenium, Puppeteer alternatives, or screenshot API as a service.
- Written by
- Dmytro Krasun
- Published on
- •
- 3 min read
Capture pixel-perfect website screenshots in PHP with a simple API call. No browser management, no complex setup—just clean, reliable screenshots.
Looks great
Remove annoying banners easily. ScreenshotOne can block complex GDPR and cookie consent forms. Most cases are covered.
last 30 days
3.5M+
Screenshots rendered
Renders the growing screenshot number every day. The API is performant and proven to handle scale.
Customize everything
Our screenshot API supports a large variety of options for customizing website screenshot rendering. No need to write custom code and logic anymore.
Pixel-perfect quality
Your customers will be pleasantly surprised by the quality of screenshots.
Integrate today
Use our official PHP SDK or send simple HTTP requests to capture screenshots.
<?php
// composer require screenshotone/sdk:^1.0
use ScreenshotOneSdkClient;use ScreenshotOneSdkTakeOptions;
$client = new Client("<access key>", "<secret key>");
$options = TakeOptions::url("https://example.com") ->fullPage(true) ->delay(2) ->geolocationLatitude(48.857648) ->geolocationLongitude(2.294677) ->geolocationAccuracy(50);
$url = $client->generateTakeUrl($options);echo $url.PHP_EOL;// expected output: https://api.screenshotone.com/take?url=https%3A%2F%2Fexample.com...
$image = $client->take($options);file_put_contents('example.png', $image);// the screenshot is stored in the example.png file
ScreenshotOne is the best product on the market - and that's before you take into account how responsive and easy Dmytro is to work with.
Any time we've found a rare edge case, it's been resolved in hours.
Great company, great founder - can't say enough!
Read
Practical guides and real updates based on our experience operating rendering infrastructure at production scale.
The article examines how you can take screenshots of any URL with PHP by using Selenium, Puppeteer alternatives, or screenshot API as a service.
How Kinsta uses ScreenshotOne to deliver reliable automatic updates.
Typeshare is a digital writing platform designed to enhance the writing experience by offering a suite of tools aimed at reducing common barriers writers face.
Exhaustive documentation, ready SDKs, no-code tools, and other automation to help you render website screenshots and outsource all the boring work related to that to us.