PHPackages                             screenshotcenter/screenshotcenter - 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. [API Development](/categories/api)
4. /
5. screenshotcenter/screenshotcenter

ActiveLibrary[API Development](/categories/api)

screenshotcenter/screenshotcenter
=================================

PHP SDK for the ScreenshotCenter API

v1.0.0(1mo ago)00MITPHPPHP &gt;=7.2

Since Mar 14Pushed 1mo agoCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

screenshotcenter-php
====================

[](#screenshotcenter-php)

Official PHP SDK for the [ScreenshotCenter](https://screenshotcenter.com) API.

Capture web screenshots, PDFs, HTML snapshots, and videos at scale.

Requirements
------------

[](#requirements)

- PHP ≥ 7.2
- `ext-curl`
- `ext-json`

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

[](#installation)

```
composer require screenshotcenter/screenshotcenter
```

Quick start
-----------

[](#quick-start)

```
use ScreenshotCenter\Client;

$client = new Client('your_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"
```

Authentication
--------------

[](#authentication)

Pass your API key to the constructor:

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

Get your key at .

Use cases
---------

[](#use-cases)

### Basic screenshot

[](#basic-screenshot)

```
$shot = $client->screenshot->create('https://example.com');
```

### Geo-targeting

[](#geo-targeting)

```
$shot = $client->screenshot->create('https://example.com', [
    'country' => 'fr',
    'lang'    => 'fr-FR',
    'tz'      => 'Europe/Paris',
]);
```

### Full-page screenshot

[](#full-page-screenshot)

```
$shot = $client->screenshot->create('https://example.com', [
    'full_page' => true,
]);
```

### PDF

[](#pdf)

```
$shot = $client->screenshot->create('https://example.com', ['pdf' => true]);
$done = $client->waitFor($shot['id']);
$client->screenshot->savePdf($done['id'], '/tmp/page.pdf');
```

### HTML snapshot

[](#html-snapshot)

```
$shot = $client->screenshot->create('https://example.com', ['html' => true]);
$done = $client->waitFor($shot['id']);
$client->screenshot->saveHtml($done['id'], '/tmp/page.html');
```

### Video

[](#video)

```
$shot = $client->screenshot->create('https://example.com', [
    'video'        => true,
    'video_length' => 5,
]);
$done = $client->waitFor($shot['id']);
$client->screenshot->saveVideo($done['id'], '/tmp/page.webm');
```

### Multiple shots

[](#multiple-shots)

```
$shot = $client->screenshot->create('https://example.com', ['shots' => 5]);
$done = $client->waitFor($shot['id']);
// Thumbnail of shot 3
$client->screenshot->saveImage($done['id'], '/tmp/shot3.png', ['shot' => 3]);
```

### Save all artifacts

[](#save-all-artifacts)

```
$done  = $client->waitFor($shot['id']);
$files = $client->screenshot->saveAll($done['id'], '/tmp/screenshots');
echo $files['image'];  // /tmp/screenshots/1001.png
echo $files['pdf'];    // /tmp/screenshots/1001.pdf (if requested)
```

### Batch

[](#batch)

```
// Batch requires the batch worker service to be running
$urls  = ['https://example.com', 'https://example.org', 'https://example.net'];
$batch = $client->batch->create($urls, 'us');
$done  = $client->batch->waitFor($batch['id'], interval: 3.0, timeout: 120.0);
$client->batch->saveZip($done['id'], '/tmp/batch.zip');
```

### Credit balance

[](#credit-balance)

```
$info = $client->account->info();
echo $info['balance'];  // available credits
```

### Error handling

[](#error-handling)

```
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()}";
}
```

API reference
-------------

[](#api-reference)

### `Client`

[](#client)

```
new Client(
    string $apiKey,
    string $baseUrl  = 'https://api.screenshotcenter.com/api/v1',
    int    $timeout  = 30,       // HTTP timeout (seconds)
    ?callable $transport = null  // Injectable transport for testing
)
```

### `$client->screenshot`

[](#client-screenshot)

MethodDescription`create(string $url, array $params = []): array`Create a screenshot`info(int $id): array`Get screenshot metadata`list(array $params = []): array`List screenshots`search(string $url, array $params = []): array`Search by URL`thumbnail(int $id, array $params = []): string`Raw image bytes`html(int $id): string`Raw HTML bytes`pdf(int $id): string`Raw PDF bytes`video(int $id): string`Raw video bytes`delete(int $id, string $data = 'all'): void`Delete a screenshot`saveImage(int $id, string $path, array $params = []): void`Save image to disk`saveHtml(int $id, string $path): void`Save HTML to disk`savePdf(int $id, string $path): void`Save PDF to disk`saveVideo(int $id, string $path): void`Save video to disk`saveAll(int $id, string $dir, string $basename = ''): array`Save all artifacts### `$client->batch`

[](#client-batch)

MethodDescription`create($urls, string $country, array $params = []): array`Create a batch`info(int $id): array`Get batch status`list(array $params = []): array`List batches`cancel(int $id): void`Cancel a batch`download(int $id): string`Download ZIP bytes`saveZip(int $id, string $path): void`Save ZIP to disk`waitFor(int $id, float $interval = 2.0, float $timeout = 120.0): array`Poll until done### `$client->account`

[](#client-account)

MethodDescription`info(): array`Get account info (balance, plan, etc.)### `$client->waitFor(int $id, float $interval = 2.0, float $timeout = 120.0): array`

[](#client-waitforint-id-float-interval--20-float-timeout--1200-array)

Poll a screenshot until `finished` or `error`.

Testing
-------

[](#testing)

### Environment variables

[](#environment-variables)

VariableDescription`SCREENSHOTCENTER_API_KEY`Required for integration tests`SCREENSHOTCENTER_BASE_URL`Override base URL (default: production)### Running tests

[](#running-tests)

```
# Unit tests only — no credentials needed
vendor/bin/phpunit

# Unit + integration tests against a local instance
SCREENSHOTCENTER_API_KEY=your_key \
SCREENSHOTCENTER_BASE_URL=http://localhost:3000/api/v1 \
vendor/bin/phpunit --testsuite integration
```

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance88

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

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

Unknown

Total

1

Last Release

59d ago

### Community

Maintainers

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

---

Tags

apiwebpdfautomationscreenshot

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[pdfcrowd/pdfcrowd

A client library for the Pdfcrowd API. It lets you convert between HTML, PDF and various image formats

631.1M1](/packages/pdfcrowd-pdfcrowd)[zyberspace/steam-web-api-client

Automatically generated api client for the Steam Web API in style of the google-api-php-client.

857.2k1](/packages/zyberspace-steam-web-api-client)[d-scribe/laraquick

A collection of classes to be extended/used in laravel applications for quick development

371.8k1](/packages/d-scribe-laraquick)

PHPackages © 2026

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