Skip to content
PHP

PHP Screenshot API for Web Capture and PDF

Add web capture to any PHP application — Laravel, Symfony, WordPress plugins, or standalone scripts. Capture screenshots, generate PDFs, record videos, and extract HTML. No wkhtmltopdf or Puppeteer required.

What you can build

CMS & WordPress

Generate link previews, social share images, and PDF exports from WordPress pages or custom CMS content.

Invoice & report PDFs

Convert styled HTML invoices to pixel-perfect PDFs with paper size, margins, and header/footer support.

Authenticated captures

Use automation steps to log in and capture client portals, admin panels, and gated content.

Scheduled monitoring

Run capture jobs from Laravel scheduler or cron to monitor site appearance across countries.

What the API handles for you

Every output format

PNG, JPEG, WebP, full-page PDF, raw HTML, and video screencasts from one endpoint.

Automation steps

Click, type, scroll, navigate, and wait before capture — handle logins, cookie banners, and dynamic content.

80+ country routing

Render geo-gated pages from real browsers in any target country.

14+ app integrations

Deliver results to S3, Google Drive, Dropbox, Slack, and more — no upload code needed.

Batch & crawl

Capture entire sitemaps or crawl domains with built-in retries and progress tracking.

On-premise browsers

Run browser clients inside your network for compliance or latency requirements.

Installation

terminal
composer require screenshotcenter/screenshotcenter
Available on Packagistpackagist.org/packages/screenshotcenter/screenshotcenter

Quick start

index.php
use ScreenshotCenter\Client;

$client = new Client(getenv('SCREENSHOTCENTER_API_KEY'));

// Take a screenshot and wait for it to finish
$shot   = $client->screenshot->create('https://example.com');
$result = $client->waitFor($shot['id']);
echo $result['url'];     // final URL
echo $result['status'];  // "finished"

More examples

Ciblage géographique
$shot = $client->screenshot->create('https://example.com', [
    'country' => 'fr',
    'lang'    => 'fr-FR',
    'tz'      => 'Europe/Paris',
]);
$done = $client->waitFor($shot['id']);
$client->screenshot->saveImage($done['id'], '/tmp/fr.png');
Génération de PDF
$shot = $client->screenshot->create('https://example.com', ['pdf' => true]);
$done = $client->waitFor($shot['id']);
$client->screenshot->savePdf($done['id'], '/tmp/page.pdf');
Gestion des erreurs
use ScreenshotCenter\Errors\ApiError;
use ScreenshotCenter\Errors\TimeoutError;
use ScreenshotCenter\Errors\ScreenshotFailedError;

try {
    $result = $client->waitFor($shot['id'], interval: 2.0, timeout: 60.0);
} catch (ScreenshotFailedError $e) {
    echo "Screenshot failed: {$e->error}";
} catch (TimeoutError $e) {
    echo "Timed out after {$e->timeoutMs}ms";
} catch (ApiError $e) {
    echo "API error {$e->status}: {$e->getMessage()}";
}
Crawl de site web
$crawl = $client->crawl->create('https://example.com', 'example.com', 100);
$result = $client->crawl->waitFor($crawl['id']);
echo $result['total_discovered'];  // pages found

Resources

Frequently asked questions

Do I need wkhtmltopdf for PDF generation?

No. ScreenshotCenter renders PDFs in real browsers with full CSS, JavaScript, and web font support — no system-level tools to install.

Does it work with Laravel?

Yes. Install via Composer and use the SDK in any Laravel controller, job, or artisan command.

Can I capture pages behind a login?

Yes. Define automation steps (click, type, navigate) to walk through login flows before the capture.

Is PHP 8 supported?

Yes. The SDK supports PHP 8.0+ and uses modern language features.

Related

Start capturing with PHP today

Get 500 captures on the free trial — no credit card required. Install the SDK and take your first screenshot in minutes.