1. Go to this page and download the library: Download webshotapi/client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
webshotapi / client example snippets
ebshotapi\Client\WebshotApiClient;
use Webshotapi\Client\Exceptions\WebshotApiClientException;
try{
$API_KEY = 'YOU_API_KEY';
$URL = 'PUT_LINK_TO_WEBSITE_HERE';
$SAVE_PATH = '/tmp/save2.jpg';
$params = array(
'remove_modals' => true, // Remove cookies popups before take screenshot
'premium_proxy' => true, // use premium proxy
'geotargeting' => 'us', // use ip from USA
'no_cache' => true, // Do not return result files from cache
'ads' => '1', // Remove ads
'width' => '1280',
'height' => '2040',
'image_quality' => 75,
'transparent_background' => false,
'full_page' => true,
);
$webshotapi = new WebshotApiClient($API_KEY);
//Download, save jpg and send to browser
$response = $webshotapi->screenshot($URL, $params);
$response->save($SAVE_PATH);
} catch (WebshotApiClientException $e){
echo"ERROR: ";
echo $e->getMessage();
}