Enter your target URL:

Library for PHP

We provide a library for PHP and for Template Toolkit. The PHP extension module makes it easy to download your thumbnails.

Quick code sample

The PHP code to generate a Thumbalizr URL is pretty simple, you can easily copy and paste it into your project:

<?php

function thumbalizr($url, $options = array()) {
	$embed_key = 'MY_EMBED_API_KEY'; # replace it with you Embed API key
	$secret = 'MY_SECRET'; # replace it with your Secret
	
	$query = 'url=' . urlencode($url);
	
	foreach($options as $key => $value) { 
		$query .= '&' . trim($key) . '=' . urlencode(trim($value)); 
		
	}
	
	
	$token = md5($query . $secret);
	

	return "https://api.thumbalizr.com/api/v1/embed/$embed_key/$token/?$query";
}


?>


<img src="<?php echo thumbalizr("https://browshot.com/", array('width' => 300, 'size' => 'page')); ?>" title="Screenshot done with Thumbalizr">
<img src="<?php echo thumbalizr("google.com"); ?>" title="Screenshot done with Thumbalizr">

Download code sample

PHP library

You can install Thumbalizr from PAckagsit with Composer. You'll find the source code in GitHub

Your API key and Secret can be found in the member section after you sign up for a free account.

<?php

include_once 'src/thumbalizr.php';

$thumbalizr = new Thumbalizr('MY_KEY', 'MY_SECRET');

$url = $thumbalizr->url('https://www.google.com/');
echo("$url\n");

$res = $thumbalizr->download_wait($url, "google.png");
echo($res[0]);

?>

Download code sample