Request Anatomy

Code Examples

Sample code is available in the following languages, If you would like help integrating our API please get in touch.

PHP Curl Ruby C# Python
public static string sitesnapr(string siteurl)

    string APIKey = "xxxxxxx";
    string APISecret = "xxxxxxx";

    string url = HttpUtility.UrlEncode(siteurl);

    string getstring = "fullpage=true&url=" + url;

    string sitesnapr_hash = Md5HashPHPCompliant(APISecret + "+" + getstring).ToLower();

    return "" + APIKey + "/" + sitesnapr_hash + "/?" + getstring;


public static string Md5HashPHPCompliant(string pass)

    System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();

    byte[] dataMd5 = md5.ComputeHash(Encoding.UTF8.GetBytes(pass));
    StringBuilder sb = new StringBuilder();

    for (int i = 0; i <= dataMd5.Length - 1; i++)
        sb.AppendFormat("{0:x2}", dataMd5[i]);

    return sb.ToString();

import hashlib
from urllib import urlencode

def sitesnapr(url, api_key, secret, fullpage=true, force=true):

    data = {
        'url': url,
        'fullpage': 'true' if fullpage else 'false',
        'force': true
    filtered_data = dict((opt, data[opt]) for opt in data if data[opt])

    query_string = urlencode(filtered_data)

    token = hashlib.md5('{}{}'.format(query_string, secret)).hexdigest()
    return "{}/{}/?{}".format(api_key, token, query_string)


print sitesnapr ("", api_key, secret)
require 'cgi' unless defined?(CGI)
require 'digest' unless defined?(Digest)
class sitesnapr
  attr_reader :apikey, :secret, :query_string, :token
  def initialize options
    @apikey = 'xxxxxxx'
    @secret = 'xxxxxxx'
    @query_string = { |k,v| "#{CGI::escape(k.to_s)}=#{CGI::escape(v.to_s)}" }.join("&")
    @token = Digest::MD5.hexdigest(query_string + secret)
  def url
options = {
  url: "",
  fullpage: true

TOKEN=$(echo -n "?$SECRET" | md5sum | cut -d " " -f 1)

curl -vvs "$APIKEY/$TOKEN/?" > screenshot.png

function sitesnapr_v2($url, $args) {

    $APIKEY = "xxxxxxx";
    $SECRET = "xxxxxxx";
    # urlencode request target
    $options['url'] = urlencode($url);
    $options += $args;
    # create the query string based on the options
    foreach($options as $key => $value) { $_parts[] = "$key=$value"; }
    # create a token from the ENTIRE query string
    $query_string = implode("&", $_parts);
    $TOKEN = md5($query_string . $SECRET);
    return "$APIKEY/$TOKEN/?$query_string";

# usage
$options['force']       = 'false';     # [false,true] Default: false
$options['fullpage']    = 'false';     # [true,false] Default: false
$options['thumb']       = '500';      # [0%-100%] reduce or limit the size of the captured image by upto 100%
$options['delay']       = '2000';      # [ms] wait an extra ms milliseconds after the page has finished loading before capturing the image 
$options['width']       = '1280';
$options['height']      = '1024';
$src = sitesnapr_v2("", $options); 

Request Options

Construct a querystring using the below variables to control the snapshot behavior.


Specify the URL of the webpage to be captured.



Sets the viewport width in pixels



Sets the viewport height in pixels



Fetch a new screenshot instead of displaying a cached one

&force=false #default


Capture the entire length of a webpage or just the visible area.

&fullpage=false #default


Reduces the dimesions of returned image to the specified width in pixels.



Waits the specified number of milliseconds after the page has loaded before taking the screenshot.