websnap / php
Websnap PHP Client
1.5.1
2023-03-09 07:12 UTC
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^6.0|^7.0
- psr/http-message: ^1.0
Requires (Dev)
- pestphp/pest: ^1.22
This package is auto-updated.
Last update: 2024-12-15 00:14:57 UTC
README
Installation
Install with composer: composer require websnap/php
Getting started
- Register for free at https://www.websnap.app
- Create a project and copy it's
token
Usage
You can either pass an url to a website or a string containing html to the client. The client will return a \Psr\Http\Message\ResponseInterface
object containing the generated pdf/screenshot.
Generate an image
$client = new \Websnap\Php\Client('YOUR_TOKEN');
// Take screenshot of an url
$response = $client->screenshot('https://www.websnap.app');
// Take screenshot of passed html
$response = $client->screenshot('<h1>Hello world!</h1>');
Generate a pdf
$client = new \Websnap\Php\Client('YOUR_TOKEN');
// Capture content as PDF
$response = $client->pdf('https://www.websnap.app');
// Generate pdf of passed html
$response = $client->pdf('<h1>Hello world!</h1>');
Please see the documentation for further options.
Contact
Did you found a bug or need a certain feature? Please get in touch with us or raise an issue.