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]
| 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. |
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. |
