W3Snapshot API

W3Snapshot service is simply an HTTP GET or POST request. The service parameters are passed as simple HTTP parameters.

All requested URLs start with the host-name (customized URLs available for premium users) and resemble the following code:

http://images.w3snapshot.com/

How to request a thumbnail:

You can request screenshots with your key using this simple API.

Append to the standard request url above the method followed by a question mark.

http://images.w3snapshot.com/?

The method is followed by the actual query parameters, which take the form argument=value, where the arguments and values are url encoded. Multiple parameters are separated by an ampersand (&).

http://images.w3snapshot.com/?size=[size]&key=[key]&url=[url]&format=[format]&quality=[quality]&cbrand=[cbrand]&cimage=[cimage]&hash=[hash]

Parameter Type Description
key String (required) All requests to W3Snapshot service require a key. Sign-up and get your own key.
url String (required) The url to get the thumbnail for. The url must start with http:// or https://. Encode alll url parameter (in PHP you can use urlencode function for this purpose)
size String (Optional), default is T if not provided The size of thumbnail. Available sizes are: T (80 x 60), S (120 x 90) for Free users. Premium user can get image of any size, send width of required image as value of this field e.g. size=1024.. If the parameter value is not set, the T size will be returned..
format String (Optional) JPG/GIF/PNG. Default is JPG for all packages, only JPG is format is available for Free users.
quality String (Optional) Quality of generated thumbnails. Check your plan for available value(s) of this parameter.
cbrand String (Optional) Custom Brand on the thumbnails.
cimage String (Optional) A fully qualified URL of the error image to be shown.
hash String (Optional)

If you are using your key in a way that it is exposed to public (e.g. you are directly calling our API on HTML pages) then you can use this parameter to safeguard your key. This parameter will send us the MD5 hash of URL and Key calculated using your secret phrase that you will define in your account. e.g. you are requesting thumbnail of http://www.google.com/ and your key is 0a1b2c3d4e5f6f7e8d9c0b9a and you have defined your secret phrase as I HATE HACKERS then this parameter will have the hash calculated as md5_hash_function ( "http://www.google.com/" + "0a1b2c3d4e5f6f7e8d9c0b9a" + "I HATE HACKERS" ).

In PHP you can calculate this hash as:

$url = "http://www.google.com/";

$key = "0a1b2c3d4e5f6f7e8d9c0b9a";

$phrase = "I HATE HACKERS";

$hash = md5($url.$key.$phrase) ;

Do not expose your Secret Code to public. Currently this parameter is only availabe to paid customers.


The following example retrieves a large thumbnail for http://www.google.com:

http://images.w3snapshot.com/?url=http://www.google.com&size=L&key=1234567890&format=jpg&quality=80

Request a refersh of a URL :

Request a refresh of a URL. You can only put one request per URL per day.

Append to the standard request url followed by refresh/ and a question mark.

http://images.w3snapshot.com/refresh/?

The method is followed by the actual query parameters, which take the form argument=value, where the arguments and values are url encoded. Multiple parameters are separated by an ampersand (&).

http://images.w3snapshot.com/refresh/?key=[key]&url=[url]

Parameter Type Description
key String (required) All requests to W3Snapshot service require a key. Sign-up and get your own key.
url String (required) The url to refresh. The url must start with http:// or https://. Encode url parameter (in PHP you can use urlencode function for this purpose).

 

For each request, the server will return a JSON response indicating whether the request was successful or not.

Returned values:

Response Body Description
{"result": "OK"} Snapshot has been queued for Refresh for the requested URL.
{"result": "ERROR"} Some error has occured.

Check if a thumbnail exists:

Check existance of thumbnail before actually requesting a snapshot.

Append to the standard request url followed by exist/ and a question mark.

http://images.w3snapshot.com/exist/?

The method is followed by the actual query parameters, which take the form argument=value, where the arguments and values are url encoded. Multiple parameters are separated by an ampersand (&).

http://images.w3snapshot.com/exist/?key=[key]&url=[url]

Parameter Type Description
key String (required) All requests to W3Snapshot service require a key. Sign-up and get your own key.
url String (required) The url to get the thumbnail for. The url must start with http:// or https://. Try to encode url parameter (in PHP you can use urlencode function for this purpose) otherwise in some cases you might get "Forbidden 403" error.

 

For each request, the server will return a JSON response indicating whether the request was successful or not.

Returned values:

Response Body Description
{"result": "Invalid URL"} URL provided in the request is not validated by our system.
{"result": "Key is missing"} Key is not provided, all requests to W3Snapshot service require a key. Signup and get your own key.
{"result": "Invalid Key"} Key provided is not valid. This key is sent via email once you complete your registration. You can also get this key after login to our website.
{"result": "Not Allowed "} Your package does not allow you to acess this API, please upgrade your account.
{"result": "Yes"} Snapshot exists for the requested URL.
{"result": "No"} Snapshot is not yet captured by our system.

 

0.083