<?php

#######################
# WARNING
# Running this code sample will cost you Browshot credits
#######################

require 'vendor/autoload.php'; # Composer
# require_once 'Browshot.php'; # or download Browshot.php

$browshot = new Browshot('my_api_key');

$info = $browshot->simple_file('google-640.png', array('url' => 'http://www.google.com/', 'width' => 640, 'height' => 480));

if ($info['file'] == '' || $info['code'] != 200) {
  echo "Screenshot failed\n";
}
else {
  echo sprintf("Thumbnail saved at %s\n", $info['file']);
}

?>