websnap / php
Websnap PHP Client
1.4.0
2021-07-26 05:46 UTC
Requires
- php: ^7.3|^8.0
- guzzlehttp/guzzle: ^6.0|^7.0
- psr/http-message: ^1.0
This package is auto-updated.
Last update: 2023-01-26 09:24:52 UTC
README
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.