The PageGlimpse web service is a REST service, meaning that you can easily construct request URLs that will work in your code, in your browser or at the command line. The REST access to the PageGlimpse service is simply an HTTP GET or POST request (RFC2616). The service parameters are passed as simple HTTP parameters.
All request URLs start with the host-name followed by the API version number and resemble the following code:
http://images.pageglimpse.com/v1/
GET thumbnails)Append to the standard request url above the method followed by a question mark.
http://images.pageglimpse.com/v1/thumbnails?
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 (&).
| Parameter | Value | Description |
|---|---|---|
devkey |
string (required) | All requests to PageGlimpse service require a devkey. Sign-up and get your own devkey. |
url |
string (required) | The url to get the thumbnail for. The url must start with http:// or https:// Example: http://www.techcrunch.com/, https://secure.amazon.com/books/coolstuff/page.aspx?page=1 |
size |
string | The size of thumbnail. Available sizes are: small, medium, large. If the parameter value is not set, the small size will be returned. |
root |
string | Indicates if the thumbnails for the domain root should be displayed. If set to "no", it will display the not found image, otherwise it will display the thumbnails for root domain page. Default value is "yes". |
nothumb |
string | If the thumbnail for the website is not yet taken, it will be queued and the value of this parameter will be sent back. If this parameter is not set a PageGlimpse default image will be returned. Example of value: http://www.yoursite.com/nothumb.jpg |
The following example retrieves a large thumbnail for http://www.techcrunch.com (note also the devkey has to be present):
GET request)Use this method to add an url to the queue to be captured and generate thumbnails.
Append to the standard request url above the method followed by a question mark.
http://images.pageglimpse.com/v1/thumbnails/request?
For each request, the server will return a JSON response indicating whether the request was successful or not.
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 (&).
| Parameter | Value | Description |
|---|---|---|
devkey |
string (required) | All requests to PageGlimpse service require a devkey. Sign-up and get your own devkey. |
url |
string (required) | The url to get the thumbnail for. The url must start with http:// or https:// Example: http://www.techcrunch.com/, https://secure.amazon.com/books/coolstuff/page.aspx?page=1 |
| Response status | Response body | Description |
|---|---|---|
| 200 | ["result", "success"] |
The url was successfully queued and it will be available shortly. |
| 403 | ["result", "Invalid Developer Key"] |
The developer key provided is invalid. |
The following example posts an url to request thumbnails to be generated for the following website: http://www.nytimes.com.
http://images.pageglimpse.com/v1/thumbnails/request?url=http://www.nytimes.com/&devkey=1234567890
Our infrastructure was designed to be scalable in order to quickly capture images in a few seconds. Usually it takes about 5-10 seconds to capture image, but depending on the service demand this can take a little bit longer. The good news is that our cluster of capturing machines can quickly scale up by demand.
GET exists)Append to the standard request url above the method followed by a question mark.
http://images.pageglimpse.com/v1/thumbnails/exists?
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 (&).
| Parameter | Value | Description |
|---|---|---|
devkey |
string (required) | All requests to PageGlimpse service require a devkey. Sign-up and get your own devkey. |
url |
string (required) | The url to verify whether we have a thumbnail for. The url must start with http:// or https:// Example: http://www.techcrunch.com/, https://secure.amazon.com/books/coolstuff/page.aspx?page=1 |
size |
string | The size of thumbnail. Available sizes are: small, medium, large. If the parameter value is not set, the small will be considered. |
For each request, the server will return a JSON response indicating whether the request was successful or not.
Return values| Response status | Response body | Description |
|---|---|---|
| 200 | ["result", "yes"] |
PageGlimpse has a thumbnail for the requested url. |
| 404 | ["result", "no"] |
PageGlimpse does not have a thumbnail for the requested url. |
| 403 | ["result", "Invalid Developer Key"] |
The developer key provided is invalid. |
The following example verifies whether PageGlimpse already has a (large) thumbnail for http://www.techcrunch.com: