<?php

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

$browshot = new Browshot('my_api_key');

$account = $browshot->account_info();

# Check my balance
echo sprintf("Free screenshots left for this month: %d\n", $account->{'free_screenshots_left'});
echo sprintf("Credits left: %d\n", $account->{'balance'});

if ($account->{'balance'} < 100) {
	# Send an alarm when the balance is low
}

?>