PHPackages                             renderscreenshot/renderscreenshot - 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. renderscreenshot/renderscreenshot

ActiveLibrary[API Development](/categories/api)

renderscreenshot/renderscreenshot
=================================

Official PHP SDK for RenderScreenshot - Screenshot API for developers

v1.0.0(3mo ago)08MITPHPPHP &gt;=8.0

Since Jan 30Pushed 3mo agoCompare

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

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

RenderScreenshot PHP SDK
========================

[](#renderscreenshot-php-sdk)

Official PHP SDK for [RenderScreenshot](https://renderscreenshot.com) - Screenshot API for developers.

[![CI](https://github.com/Render-Screenshot/rs-php/actions/workflows/ci.yml/badge.svg)](https://github.com/Render-Screenshot/rs-php/actions/workflows/ci.yml)[![PHP Version](https://camo.githubusercontent.com/854124dd57cfd3aad3184fca9760bf1f33a5ec1e5d080cfbe8aa4e3337ba46e6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e302d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

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

[](#installation)

```
composer require renderscreenshot/renderscreenshot
```

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

[](#requirements)

- PHP 8.0 or higher
- Guzzle 7.0 or higher

Quick Start
-----------

[](#quick-start)

```
use RenderScreenshot\Client;
use RenderScreenshot\TakeOptions;

$client = new Client('rs_live_xxxxx');

// Take a screenshot
$image = $client->take(
    TakeOptions::url('https://example.com')->preset('og_card')
);

// Save to file
file_put_contents('screenshot.png', $image);
```

Features
--------

[](#features)

- **Fluent API** - Chainable option builder for clean, readable code
- **Type safety** - Full type hints for IDE autocompletion
- **Webhook helpers** - Easy signature verification and parsing
- **Signed URLs** - Generate time-limited URLs for embedding
- **Batch processing** - Capture multiple URLs efficiently
- **Cache management** - Retrieve, delete, and purge cached screenshots

Usage
-----

[](#usage)

### Basic Screenshot

[](#basic-screenshot)

```
$client = new Client('rs_live_xxxxx');

// Using fluent builder
$options = TakeOptions::url('https://example.com')
    ->width(1200)
    ->height(630)
    ->format('png')
    ->blockAds()
    ->darkMode();

$image = $client->take($options);
file_put_contents('screenshot.png', $image);
```

### Get JSON Metadata

[](#get-json-metadata)

```
$response = $client->takeJson(
    TakeOptions::url('https://example.com')->preset('og_card')
);

echo $response['url'];     // CDN URL
echo $response['width'];   // 1200
echo $response['height'];  // 630
echo $response['cached'];  // true/false
```

### Generate Signed URL

[](#generate-signed-url)

```
use DateTime;

$url = $client->generateUrl(
    TakeOptions::url('https://example.com')->preset('og_card'),
    new DateTime('+24 hours')
);

// Use in HTML:
