Enter your target URL:

Embed API

This API should can be used to embed thumbnails directly on your website.

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

.
https://api.thumbalizr.com/api/v1/embed/EMBED_API_KEY/TOKEN/?url=https://www.google.com/&mode=page

TOKEN is the MD5 of the URL query string and secret:

TOKEN = md5(url=https://www.google.com/&mode=pageSECRET)

The list of options available is shown below. Only the url parameter is required, other values default to the option you choose in your profile.

Parameter value free silver gold platinum
api_key your key
url url
width (thumbnail) 1 - 2000 1-1280 1-1280 1-1600 1-2000
format (thumbnail) jpg, png
quality (for JPEG thumbnails only) 10 - 100
timestamp (generate a new thumbnail) any value not available
No watermark (thumbnail) watermark
size (full page or visible screen) page - screen screen
delay (time after page loaded) 1 - 30 5 5
bwidth (browser width) 1 - 2000 1280 1280 1-1600 1-2000
bheight (browser height) 1 - 1600 1024 1024 1-1600 1-2000
country (location of the browser) us, germany germany germany

You need to ensure that all parameters are encoded correctly, especially the url parameter.

timestamp: use a different timestamp to geenrate a new image. You can use any string but we recommend to use the current date: timestamp=2017-02-04:18:56:03

country: you can take screenshots from US or Germany. Contact us for other countries.

bwidth and bheight define the viewport of the browser.

Response

You can track the status of the screenshots through the HTTP headers sent back by thumbalizr.com:

X-Thumbalizr-Status: status of the screenshot:

  • QUEUED: screenshot is being processed
  • OK: screenshot is done, your received the thumbnail you requested
  • FAILED: screenshot has failed

X-Thumbalizr-Generated: date the screenshot was generated, for example 02 Apr 2014 11:03:24 GMT.

X-Thumbalizr-Error: reason why the screenshot failed.

Code samples

PHP

<?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

Python

import hashlib
import urllib


def thumbalizr(url='', options={}):
  embed_key = 'MY_EMBED_API_KEY' # replace it with you Embed API key
  secret = 'MY_SECRET' # replace it with your Secret
  
  query = 'url=' + urllib.quote_plus(url)

  for key, value in options.items():
    query += '&' + key + '=' + urllib.quote_plus(str(value))
  
  
  token = hashlib.md5(query + secret).hexdigest()
  

  return "https://api.thumbalizr.com/api/v1/embed/%s/%s/?%s" % (embed_key, token, query)


print thumbalizr("https://browshot.com/", { 'width': 300, 'size': 'page' })
print thumbalizr("google.com")

Download code sample

Ruby

require 'url'
require 'digest'

def thumbalizr(url='', options={})
  embed_key = 'MY_EMBED_API_KEY' # replace it with you Embed API key
  secret = 'MY_SECRET' # replace it with your Secret
  
  query = 'url=' + CGI::escape(url.to_s)
  
  options.each_pair do |key, value|
    query += "&#{key}=" + CGI::escape(value.to_s)
  end
  
  token = Digest::MD5.hexdigest(query + secret)
  
  
  return "https://api.thumbalizr.com/api/v1/embed/#{embed_key}/#{token}/?#{query}"
end


puts thumbalizr("https://browshot.com/", {:width => 300, :size => 'page' })
puts thumbalizr("google.com")

Download code sample

Perl

#!/usr/bin/perl -w

use strict;
use warnings;
use Carp;

use URI::Escape qw(uri_escape);
use Digest::MD5 qw(md5_hex);
use Text::Trim;



print thumbalizr("https://browshot.com/", 'width' => 300, 'size' => 'page'), "\n";
print thumbalizr("google.com"), "\n";

exit(0);

sub thumbalizr  {
	my ($url, %options) = @_;
	
	my $embed_key = 'MY_EMBED_API_KEY'; # replace it with you Embed API key
	my $secret = 'MY_SECRET'; # replace it with your Secret
	
	my $query = 'url=' . uri_escape($url);

	foreach my $option (keys %options)  { 
		$query .= '&' . trim($option) . '=' . uri_escape(trim $options{$option}); 
	}
	
	
	my $token = md5_hex($query . $secret);
	

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

Download code sample

Bash

#!/bin/bash

EMBED_KEY="MY_EMBED_API_KEY" # replace it with you Embed API key
SECRET="MY_SECRET" # replace it with your Secret

URL="https://browshot.com/" # URL must be encoded appropriately
OPTIONS="width=300&size=page"

TOKEN=$(echo -n "url=$URL&$OPTIONS$SECRET" | md5sum | cut -d " " -f 1)

curl "https://api.thumbalizr.com/api/v1/embed/$EMBED_KEY/$TOKEN/?url=$URL&$OPTIONS"

# sh thumbalizr.sh > thumbnail.png

Download code sample

Old API

This API should NOT be used to embed a screenshot directly on a web page unless you are able to hide your API key for visitors. This API is best suited to download thumbnails offline.

We recommend to use the new Embed API instead. We will keep supporting this legacy API. We have added a few parameters.

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

.

https://api.thumbalizr.com/?api_key=API_KEY&url=https://www.google.com/&mode=page

The list of options available below. Only the url parameter is required, other values default to the option you choose in your profile.

Parameter value free silver gold platinum
api_key your key
url url
width (thumbnail) 1 - 2000 1-1280 1-1280 1-1600 1-2000
encoding (thumbnail format) jpg, png
quality (for JPEG thumbnails only) 10 - 100
timestamp (generate a new thumbnail) any value not available
No watermark (thumbnail) watermark
size (full page or visible screen) page - screen screen
delay (time after page loaded) 1 - 30 5 5
bwidth (browser width) 1 - 2000 1280 1280 1-2000
bheight (browser height) 1 - 2000 1024 1024 1-1600 1-2000
country (location of the browser) us, germany germany germany

You need to ensure that all parameters are encoded correctly, especially the url parameter.

timestamp: use a different timestamp to geenrate a new image. You can use any string but we recommend to use the current date: timestamp=2017-02-04:18:56:03. You should use it in place of generate=1

country: you can take screenshots from US or Germany. Contact us for other countries.

bwidth and bheight define the viewport of the browser.

Response

You can track the status of the screenshots through the HTTP headers sent back by thumbalizr.com:

X-Thumbalizr-Status: status of the screenshot:

  • QUEUED: screenshot is being processed
  • OK: screenshot is done, your received the thumbnail you requested
  • FAILED: screenshot has failed

X-Thumbalizr-Generated: date the screenshot was generated, for example 02 Apr 2014 11:03:24 GMT.

X-Thumbalizr-Error: reason why the screenshot failed.